Control method, device, equipment and system of application examples

By releasing the current application instance in the serverless platform and creating a second application instance with different resource specifications, the problem of slow network request response is solved, and rapid response and flexibility is improved.

CN113190343BActive Publication Date: 2025-02-07ALIBABA GROUP HOLDING LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010038302.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-14
Publication Date
2025-02-07
Estimated Expiration
2040-01-14

AI Technical Summary

Technical Problem

In serverless platforms, when receiving network requests from applications, the application instance needs to be recreated, resulting in slow response to network requests.

Method used

By determining that all application instances of the target application need to be released, control the release of the current application instance and create a second application instance with different resource specifications in response to the network request of the target application.

Benefits of technology

It realizes that the application instance can quickly respond to network requests after releasing it, shortens the response time, and improves the flexibility of the application instance to wait for network requests to respond.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113190343B_ABST
    Figure CN113190343B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a control method, device, equipment and system for an application instance, the method comprising: determining that all application instances of a target application need to be released, the current application instance of the target application being a first application instance; controlling the creation of a second application instance of the target application and releasing the first application instance, so as to control the second application instance to respond to a network request of the target application, the resource specification of the second application instance being different from the resource specification of the first application instance. The present application avoids the problem of slow response to network requests caused by recreating application instances upon receiving a network request of an application, shortens the response time of network requests, and realizes timely response to network requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a control method, device, equipment and system for an application example. Background Art

[0002] The serverless platform is the latest emerging business software platform. In Serverless, application developers no longer need to pay attention to server-related matters, such as server selection, application operating environment configuration, load balancing, log collection, system monitoring, etc. These matters can all be handed over to the Serverless platform. The only thing application developers need to do is to write application code and implement business logic.

[0003] Typically, a cloud service consumer device (Cloud Service Consumer, CSC) can send a network request for an application to the cloud platform, and the cloud platform can respond to the network request through the application instance of the application to provide services to the cloud server consumer device. In addition, the cloud platform can increase the number of application instances when the network requests of the application increase, and can reduce the number of application instances when the network requests of the application decrease, thereby realizing automatic expansion and contraction of application instances. In addition, when no network requests for the application are received for a period of time, the cloud platform will release all application instances of the application in order to reduce costs.

[0004] However, in the above method, after all application instances of the application are released, when a network request of the application is received, the application instance needs to be re-created, thereby resulting in a problem of slow response to the network request. Summary of the invention

[0005] The embodiments of the present application provide a method, device, equipment and system for controlling an application instance, so as to solve the problem in the prior art that after all application instances of the application are released, when a network request of the application is received, the application instance needs to be recreated, resulting in a slow response to the network request.

[0006] In a first aspect, an embodiment of the present application provides a control method of an application example, including:

[0007] Determining that all application instances of a target application need to be released, wherein a current application instance of the target application is a first application instance;

[0008] A second application instance of the target application is created, the second application instance is controlled to respond to a network request of the target application, and the first application instance is released, wherein a resource specification of the second application instance is different from a resource specification of the first application instance.

[0009] In a second aspect, an embodiment of the present application provides a control method for an application instance, which is applied to a cloud service consumption device, including:

[0010] In the case where the cloud platform is required to provide services for the target application, generating a network request for the target application;

[0011] Sending the network request of the target application to the cloud platform;

[0012] Among them, the sending of the target application network request can trigger the cloud platform to determine that all application instances of the target application need to be released, and the current application instance of the target application is the first application instance, so that the cloud platform controls the creation of a second application instance of the target application and releases the first application instance to control the second application instance to respond to the network request of the target application, and the resource specifications of the second application instance are different from the resource specifications of the first application instance.

[0013] In a third aspect, an embodiment of the present application provides a control device of an application example, including:

[0014] A determination module, used for determining that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance;

[0015] A control module is used to create a second application instance of the target application, control the second application instance to respond to the network request of the target application, and release the first application instance, wherein the resource specification of the second application instance is different from the resource specification of the first application instance.

[0016] In a fourth aspect, an embodiment of the present application provides a control device of an application example, including:

[0017] A generation module, used to generate a network request for the target application when the cloud platform needs to provide services for the target application;

[0018] A sending module, used for sending the network request of the target application to the cloud platform;

[0019] Among them, the sending of the target application network request can trigger the cloud platform to determine that all application instances of the target application need to be released, and the current application instance of the target application is the first application instance, so that the cloud platform controls the creation of a second application instance of the target application and releases the first application instance to control the second application instance to respond to the network request of the target application, and the resource specifications of the second application instance are different from the resource specifications of the first application instance.

[0020] In a fifth aspect, an embodiment of the present application provides a control device of an application example, comprising: a memory, a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method described in any one of the first aspects above.

[0021] In the sixth aspect, an embodiment of the present application provides a control device of an application example, comprising: a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method described in any one of the second aspects above.

[0022] In a seventh aspect, an embodiment of the present application provides a control system of an application instance, comprising: a control device of the application instance described in any one of the fifth aspect, and a control device of the application instance described in any one of the sixth aspect.

[0023] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes at least one section of code, and the at least one section of code can be executed by a computer to control the computer to execute the method as described in any one of the first aspects.

[0024] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes at least one section of code, and the at least one section of code can be executed by a computer to control the computer to execute a method as described in any one of the second aspects.

[0025] An embodiment of the present application further provides a computer program, which, when executed by a computer, is used to implement the method as described in any one of the first aspects.

[0026] An embodiment of the present application further provides a computer program, which, when executed by a computer, is used to implement the method as described in any one of the second aspects.

[0027] The control method, device, equipment and system of the application instance provided by the embodiment of the present application, by determining that all application instances of the target application need to be released, controlling the release of the current application instance of the target application (i.e., the first application instance), and controlling the creation of a second application instance of the target application with a resource specification different from that of the first application instance, so as to control the second application instance to respond to the network request of the target application, realizes that when all embodiments of the target application need to be released, a second application instance with a different resource specification is created to wait for the network request of the target application to be responded to, so that when the network request of the target application is received again, the second application instance can directly respond to the network request, avoiding the problem of slow response to the network request caused by re-creating the application instance when the network request of the target application is received, shortening the response time of the network request, and realizing the timely response of the network request. In addition, since the resource specification of the second application instance is different from the resource specification of the first application instance, compared with the first application instance with the minimum number of reserved ones, the flexibility of the application instance for waiting to respond to the network request can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 A schematic diagram of an application scenario of an embodiment of the present application;

[0030] Figure 2-3C A schematic diagram of the principles of the cloud platform provided in the embodiment of the present application;

[0031] Figure 4 A flowchart of a control method for an application example provided by an embodiment of the present application;

[0032] Figure 5 A flowchart of a control method of an application example provided by another embodiment of the present application;

[0033] Figure 6 A schematic diagram of the principles of the cloud platform provided in the embodiment of the present application;

[0034] Figure 7 A flowchart of a control method of an application example provided by another embodiment of the present application;

[0035] Figure 8 A schematic diagram of the structure of a control device for an application example provided by an embodiment of the present application;

[0036] Fig. 9 A schematic diagram of the structure of a control device of an application example provided by another embodiment of the present application;

[0037] Fig.10 A schematic diagram of the structure of a control device of an application example provided in yet another embodiment of the present application;

[0038] Fig.11 A schematic structural diagram of a control device of an application example provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said", and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.

[0041] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0042] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0043] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.

[0044] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0045] The control method of the application example provided in the embodiment of the present application can be applied to Figure 1 In the application scenario shown, Figure 1 As shown, the application scenario may include a cloud platform 11 implemented based on serverless and a cloud service consumption device 12, and the cloud platform 11 and the cloud service consumption device 12 are connected via network communication.

[0046] Among them, the cloud service consumption device 12 can be a user of the cloud platform 11 and needs to use the cloud platform 11 to provide services for it. A cloud service consumption device 12 can use the services of one or more applications provided by the cloud platform 11. When the cloud service consumption device 12 uses the service of an application provided by the cloud platform 11, the cloud service consumption device 12 can send a network request of the application to the cloud platform 11 according to demand. After receiving the network request of the application, the cloud platform 11 can respond to the network request through the application instance of the application, thereby enabling the cloud platform 11 to provide the service of the application to the cloud service consumption device. It should be noted that this application does not limit the specific type of network request, for example, it can be a data storage request, an identity authentication request, etc.

[0047] like Figure 2 As shown, the cloud platform 11 may include a request forwarding device 11A and an application instance control device 11B. The request forwarding device 11A is used to receive a network request sent by the cloud service consumption device 12 through the network, determine the application corresponding to the network request, and forward the network request to the application instance of the corresponding application for response. The application instance control device 11B is used to control the creation and release of the application instance. Specifically, the application instance control device can control the increase in the number of application instances when the network requests of the application increase, and can control the decrease in the number of application instances when the network requests of the application decrease. The request forwarding device can be, for example, a gateway, and the application instance control device can be included in the host machine where the application instance is located, or can be included in other devices other than the host machine where the application instance is located.

[0048] It should be noted that, for the sake of distinction, in the embodiments of the present application, Figure 2 The application instance in the normal scaling scenario shown in is called the first application instance. It is understandable that there can be multiple first application instances of an application, and the multiple first application instances are completely identical, specifically, have the same functions, and have the same instance specifications, for example, the instance specifications are all 2 processor cores (core) + 4g memory.

[0049] It should be noted that Figure 2 In the example, the number of applications is 2. It can be understood that the number of applications can be greater than 2.

[0050] Usually, when the cloud platform 11 determines that it has not received a network request for an application for a period of time, in order to reduce costs, the cloud platform 11 will release all application instances of the application. Later, when the cloud platform 12 receives a network request for the application, it needs to recreate the application instance of the application in order to respond to the network request of the application and provide services to the cloud service consumer device 12. However, since it takes a certain amount of time from creating an application instance to the application instance being able to respond to a network request, there is a certain delay in processing the network request, so there is a problem of slow response to network requests. Figure 2 Based on the above, when no network request of application 1 is received for a period of time, the cloud platform 11 releases all implementations of the application. The result can be as follows: Figure 3A shown.

[0051] Alternatively, in order to solve the problem of slow response to network requests, when the cloud platform 11 determines that it has not received a network request for an application for a period of time, it does not release all application instances of the application, but retains a minimum number of application instances so that when the cloud platform receives a network request for the application again, it can respond in time. However, this method has the problem of high cost. Figure 2 Based on the above, when no network request of application 2 is received for a period of time, the cloud platform 11 retains one application instance of application 2. Figure 3B shown.

[0052] The control method for application instances provided in the embodiments of the present application determines that all application instances of the target application need to be released, the current application instance of the target application is the first application instance, controls the creation of a second application instance of the target application and releases the first application instance, so as to control the second application instance to respond to the network request of the target application. The resource specifications of the second application instance are different from those of the first application instance. When it is determined that all application instances of the target application need to be released, a second application instance with different resource specifications can be created to wait for the network request of the response application, thereby enabling timely response to the application network request. Moreover, since the resource specifications of the second application instance are different from those of the first application instance, the flexibility of the application instance waiting for the response network request can be improved. Figure 2 Based on the above, when no network request of application 2 is received for a period of time, the cloud platform 11 releases all application instances of application 2 and creates a second application instance. Figure 3C shown.

[0053] It should be noted that Figure 2-3C The medium-thin solid line represents the data surface, and the thick solid line represents the control surface.

[0054] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0055] Figure 4 This is a flow chart of a control method for an application example provided by an embodiment of the present application. The execution subject of this embodiment may be Figure 1 The cloud platform 11 in the embodiment may be specifically executed by the control device of the application instance in the cloud platform 11. Figure 4 As shown, the method of this embodiment may include:

[0056] Step 401: determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance.

[0057] In this step, the specific algorithm for determining whether it is necessary to release all application instances of the target application can be flexibly implemented. Exemplarily, step 401 may specifically include: determining whether a network request for the target application is received within the most recent preset time length; if a network request for the target application is not received within the most recent preset time length, determining that all application instances of the target application need to be released. Further, if a network request for the target application is received within the most recent preset time length, determining that all embodiments of the target application do not need to be released. For example, when the number of network requests for the target application received within the most recent 1 minute is 0, it can be determined that all application instances of the target application need to be released. When the number of network requests for the target application received within the most recent 1 minute is greater than 0, it can be determined that all application instances of the target application do not need to be released.

[0058] Assuming that when it is determined that all application instances of the target application need to be released, the target application currently has three application instances, then the three application instances can be understood as the first application instance of the target application, which is different from the second application instance described below.

[0059] It should be noted that the embodiment of the present application is directed to the specific processing when it is determined that all application instances of the target application need to be released. When it is determined that all application instances of the target application do not need to be released, step 402 does not need to be performed and the process can be terminated.

[0060] Step 402, controlling the creation of a second application instance of the target application and releasing the first application instance to control the second application instance to respond to a network request of the target application, wherein the resource specification of the second application instance is different from the resource specification of the first application instance.

[0061] In this step, there may be no order restriction between controlling the release of the first application instance of the application and controlling the creation of the second application instance of the application. By controlling the creation of the second application instance first and controlling the release of the first application instance later, it is beneficial to achieve timely response to network requests to the greatest extent. By controlling the release of the first application instance first and controlling the creation of the second application instance later, it is beneficial to complete the recovery of resources deployed in the first application instance as soon as possible.

[0062] It should be noted that controlling the second application instance to respond to the network request of the application can be executed by the control device that provides the application instance, or can be executed by other devices or equipment other than the control device of the application instance, and this application does not limit this.

[0063] The specific manner in which the resource specification of the second application instance is different from the resource specification of the first application instance can be flexibly implemented according to demand. The resource specification of the application instance can refer to the amount of resources that the application instance needs to use. Among them, the resources can be, for example, software resources such as memory and processor cores, or, for example, hardware resources such as processor chips, or, for example, electrical energy resources, etc.

[0064] In this embodiment, by controlling the release of the current application instance of the target application (i.e., the first application instance) when it is determined that all application instances of the target application need to be released, and controlling the creation of a second application instance of the target application with a resource specification different from that of the first application instance, the resource specification of the second application instance is different from that of the first application instance, so that when it is determined that all implementations of the target application need to be released, a second application instance with a different resource specification is created to respond to the network request of the target application, so that when the network request of the target application is received again, the second application instance can directly respond to the network request, avoiding the problem of slow response to the network request caused by re-creating the application instance when the network request of the target application is received, shortening the response time of the network request, and realizing timely response to the network request. In addition, since the resource specification of the second application instance is different from that of the first application instance, compared with retaining the minimum number of first application instances, the flexibility of the application instance used to wait for the response to the network request can be improved.

[0065] In the above Figure 4 On the basis of the illustrated embodiment, illustratively, the resource specifications of the second application instance are different from the resource specifications of the first application instance, including one or more of the following: the instance specifications of the second application instance are lower than the instance specifications of the first application instance, the power of the processor chip for deploying the second application instance is lower than the power of the processor chip for deploying the first application instance, or the resources for deploying the first application instance are exclusive resources that do not need to be preempted with other application instances and the resources for deploying the second application instance are oversold resources that need to be preempted with other application instances. Based on this, it is possible to achieve that the resource specifications of the second application instance are lower than the resource specifications of the first application instance, which is beneficial to saving the cost of the cloud platform compared to retaining a minimum number of first application instances in the related art.

[0066] Exemplarily, the instance specifications may include the number of processor cores, memory size, etc. For example, the instance specification of the first application instance may be 2 processor cores + 4 GB memory, and the instance specification of the second application instance may be 0.5 processor cores + 4 GB memory. For example, the instance specification of the first application instance may be 2 processor cores + 4 GB memory, and the instance specification of the second application instance may be 1 processor core + 2 GB memory.

[0067] The specific method of making the instance specification of the second application instance lower than that of the first application instance can be implemented flexibly. By making the number of processor cores of the second application instance lower than that of the first application instance, the processor core resources can be reduced. By making the memory size of the second application instance lower than that of the first application instance, the memory resources can be reduced.

[0068] The method for determining the instance specifications of the second application instance can be implemented flexibly. Exemplarily, the instance specifications of the second application instance can be set by the user, or the instance specifications of the second application instance can be automatically determined by the cloud platform based on the instance specifications of the first application instance in accordance with a preset downgrading strategy. The instance specifications of the second application instance are automatically determined by the control device of the application instance according to the instance specifications of the first application instance and the preset downgrading strategy, which is conducive to improving the flexibility of the cloud platform in determining the instance specifications of the second application instance. Among them, the downgrading strategy can, for example, reduce the number of processor cores, or reduce the processor cores by a few percent. It should be noted that this application does not limit the method for determining the instance specifications of the first application instance, for example, it can be configured by the user.

[0069] Since the power of processor chips is different, the power consumption of processor chips will be different. Therefore, by deploying the processor chip of the second application instance with a power lower than the power of deploying the processor chip of the first application instance, it is possible to deploy the second application instances on processor chips with lower power, which is beneficial to saving power consumption and thus reducing costs.

[0070] Exemplarily, the instruction systems of the first application instance and the second application instance are different. By having the instruction system of the second application instance be different from the instruction system of the first application instance, the scope of selecting a processor chip with lower power for the second application instance can be expanded, which is conducive to improving the flexibility of hardware implementation of deploying the first application instance and the second application instance on processing chips with different power. Among them, the instruction system of the first application instance can be, for example, an Intel instruction set, and the instruction system of the second application instance can be, for example, an Advanced RISC Machine (ARM) instruction set, so that unlike deploying the processor chip of the first application instance as an Intel chip, deploying the second application instance can select an ARM chip.

[0071] It should be noted that, in a scenario where the resources of the first application instance are exclusive resources and the resources of the second application instance are oversold resources, the instance specifications of the second application instance may be the same as those of the first application instance.

[0072] Among them, the resources for deploying application instances are exclusive resources and are explained as follows: assuming that the resources of application instance a are exclusive resources, the instance specification of application instance a is 2 processor cores, and the number of processor cores of a server is 32, then the server can deploy a maximum of 16 application instances a, each application instance a exclusively uses 2 processor cores, and the 16 application instances a do not compete for resources with each other.

[0073] During the actual operation of application instances, the resource usage of application instances often does not reach the number of resources agreed upon in their instance specifications, resulting in resource waste. In order to improve resource utilization, the concept of overselling is introduced, that is, the sum of the resources agreed upon in the instance specifications of all application instances on the server exceeds the amount of resources owned by the server itself. In the process of overselling, different application instances will compete for resources, which is also caused by the nature of overselling. The maximum resources that an application instance can occupy are the number of resources agreed upon in its instance specifications.

[0074] Among them, the resource for deploying application instances is oversold resource as explained below: assuming that the resource of application instance b is oversold resource, the instance specification of application instance b is 2 processor cores, and the number of processor cores of a server is 32, then the server can deploy more than 16 application instances b at most, for example, 32 application instances b can be deployed, the 32 application instances b compete for resources with each other, and one application instance b can occupy 2 processor cores at most.

[0075] It can be seen that the resources of the second application instance are oversold resources, which can improve resource utilization compared to the first application instance, which is an exclusive resource, thereby reducing the resource specifications of the application instance.

[0076] In the above Figure 4 Based on the illustrated embodiment, illustratively, the controlling the creation of the second application instance of the target application may specifically include: allocating resources to the second application instance of the target application, and controlling the running of the second application instance in the resources allocated to the second application instance. Specifically, the resources allocated to the second application instance may be selected from the resource pool according to the resource allocation information of the second application instance, and the resource allocation information includes relevant information for allocating resources to the second application instance, such as the instance specification of the second application instance, the processor chip of the second application instance, etc.

[0077] In the above Figure 4 On the basis of the illustrated embodiment, illustratively, the controlling the second application instance to respond to the network request of the target application may specifically include: when determining that the second application instance can process the network request of the target application, adding the second application instance to the instance list of the target application, so that the request forwarding device can forward the network request of the target application to the second application instance according to the instance list. The instance list of the target application is used to request the forwarding device to forward the received network request of the target application, so that the application instance of the target application can receive the network request of the target application and respond. It is understandable that when the first application instance is released, the first application instance can be deleted from the instance list of the target application.

[0078] In the above Figure 4 Based on the illustrated embodiment, illustratively, the number of the second application instance is 1. By setting the number of the second application instance to 1, the cost can be reduced to the greatest extent.

[0079] Figure 5 This is a flow chart of a control method for an application instance provided by another embodiment of the present application. Based on the above embodiment, this embodiment mainly describes an optional implementation method after releasing the first application instance and creating the second application instance. Figure 5 As shown, the method of this embodiment may include:

[0080] Step 501: determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance.

[0081] It should be noted that step 501 is similar to step 401 and will not be described in detail here.

[0082] Step 502, controlling the creation of a second application instance of the target application and releasing the first application instance to control the second application instance to respond to a network request of the target application, wherein the resource specification of the second application instance is different from the resource specification of the first application instance.

[0083] It should be noted that step 502 is similar to step 402 and will not be described in detail here.

[0084] Step 503, determining whether a preset condition is met.

[0085] In this step, the resource specifications of the second application instance are different from those of the first application instance, and its processing capacity is different from that of the first application instance. In order to ensure that the processing capacity of the application instance of the target application can meet the demand as much as possible, it can be indicated that the first application instance needs to be recreated when the preset conditions are met. If the preset conditions are not met, it means that the first application instance does not need to be recreated.

[0086] Among them, the preset condition is used to predict whether there will be a large number of network requests of the target application that need to be responded to in the future. If the preset condition is met, it can be characterized by the prediction that a large number of network requests of the target application will need to be responded to in the future; if the preset condition is not met, it can be characterized by the prediction that there will not be a large number of network requests of the target application that need to be responded to in the future. The preset condition can be flexibly implemented according to specific needs. Exemplarily, the preset condition may include any one of the following: receiving a network request of the target application, the number of network requests of the target application received is greater than the number threshold, the network request of the target application is received and the time from the receiving time is greater than the time threshold, or the load of the second application instance is greater than the load threshold, etc.

[0087] Step 504: If the preset condition is met, control the creation of the first application instance to control the first application instance to respond to the network request of the target application.

[0088] It should be noted that the specific method of controlling the creation of the first application instance and controlling the first application instance to respond to the network request is similar to the specific method of controlling the creation of the second application instance and controlling the second application instance to respond to the network request, and will not be repeated here.

[0089] Optionally, after step 504, the method may further include: when the first application instance is able to respond to the network request of the target application, controlling the second application instance to no longer respond to the network request of the target application. Exemplarily, the second application instance may be deleted from the instance list so that the second application instance no longer responds to the network request of the target application. It should be noted that the second application instance may continue to respond to the network request that the second application instance is responding to until the response is completed.

[0090] By controlling the second application instance to no longer respond to the network request of the target application, the first application instance is used to respond to the network request of the target application in normal expansion and contraction scenarios. Since the processing capability of the second application instance is different from that of the first application instance, by controlling the second application instance to no longer respond to the network request when the first application instance can respond to the network request, the special scenario where application instances with different processing capabilities respond to the network request can be avoided, thereby avoiding special implementation for the special scenario, which is conducive to simplifying the implementation.

[0091] Exemplarily, controlling the second application instance to no longer respond to the network request of the target application may specifically include: controlling the release of the second application instance. By controlling the release of the second application instance, resources used to deploy the second application instance can be recycled, which is conducive to improving resource utilization.

[0092] In this embodiment, by determining whether a preset condition is met, if the preset condition is met, the creation of the first application instance is controlled to control the first application instance to respond to the network request of the target application. This achieves that, on the basis of the second application instance being able to respond to the network request of the target application, when it is predicted that a large number of network requests of the target application will need to be responded to, the first application instance whose processing capacity can meet the demand is controlled to respond to the network request, thereby avoiding the problem of the cloud platform being unable to respond to network requests in a timely manner due to the limited processing capacity of the second application instance and the large number of network requests.

[0093] Specifically, the specific process of the cloud platform processing network requests can be as follows: Figure 6 Reference Figure 6In a normal scaling scenario, the request forwarding device forwards the network request of the target application to the first application instance, and the first application instance responds to the network request. The control device of the application instance can automatically scale the first application instance according to demand, where a small square represents an application instance of the target application, and those numbered 1, 2, 3, 4, 5, ... are first application instances, and those not numbered are second application instances. When it is determined that all application instances of the target application need to be released, the control device of the application instance controls the release of the first application instance and controls the creation of the second application instance. The request forwarding device forwards the network request of the target application to the second application instance, and the second application instance responds to the network request. It should be noted that Figure 6 The solid line indicates the flow direction in normal scaling scenarios, the dotted line indicates the flow direction in special scenarios of abnormal scaling, the thin solid line and the thin dotted line indicate the data plane, and the thick solid line and the thick dotted line indicate the control plane.

[0094] Figure 7 This is a flow chart of a control method of an application example provided by another embodiment of the present application. The execution subject of this embodiment may be Figure 1 The cloud service consumption device 12 in the embodiment. Figure 7 As shown, the method of this embodiment may include:

[0095] Step 701, generating a network request for the target application when the cloud platform is required to provide services for the target application;

[0096] Step 702, sending the network request of the target application to the cloud platform;

[0097] Among them, the sending of the target application network request can trigger the cloud platform to determine that all application instances of the target application need to be released, and the current application instance of the target application is the first application instance, so that the cloud platform controls the creation of a second application instance of the target application and releases the first application instance to control the second application instance to respond to the network request of the target application, and the resource specifications of the second application instance are different from the resource specifications of the first application instance.

[0098] It should be noted that for the specific method of the cloud platform determining that all application instances of the target application need to be released, and controlling the creation of the second application instance of the target application and releasing the first application instance, please refer to the relevant description of the aforementioned embodiment, which will not be repeated here.

[0099] In this embodiment, when the cloud platform is required to provide services for the target application, the cloud service consumption device generates a network request for the target application and sends the network request for the target application to the cloud platform; wherein the sending of the network request for the target application can trigger the cloud platform to determine that all application instances of the target application need to be released, so that the cloud platform can control the release of the current application instance of the target application (i.e., the first application instance) and control the creation of a second application instance with different resource specifications from the first application instance when it is determined that all application instances of the target application are released, so as to control the second application instance to respond to the network request of the target application, so that when the network request of the target application is received again, the second application instance can directly respond to the network request, thereby avoiding the problem of slow response to the network request caused by re-creating the application instance when the network request of the target application is received, shortening the response time of the network request, and achieving timely response to the network request.

[0100] Figure 8 This is a schematic diagram of the structure of a control device for an application example provided by an embodiment of the present application; Figure 8 As shown, this embodiment provides a control device for an application example, which can execute the above Figure 4-Figure 5 The control method of the application example shown, specifically, the control device of the application example may include:

[0101] A determination module 81, used to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance;

[0102] The control module 82 is used to control the creation of a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from the resource specification of the first application instance.

[0103] Optionally, the resource specifications of the second application instance are different from the resource specifications of the first application instance, including one or more of the following: the instance specifications of the second application instance are different from the instance specifications of the first application instance, the power of the processor chip for deploying the second application instance is lower than the power of the processor chip for deploying the first application instance, or the resources for deploying the first application instance are exclusive resources that do not need to be preempted with other application instances and the resources for deploying the second application instance are oversold resources that need to be preempted with other application instances.

[0104] Optionally, the determination module 81 is further configured to determine the instance specification of the second application instance according to the instance specification of the first application instance and a preset downgrading strategy.

[0105] Optionally, the first application instance and the second application instance have different instruction systems.

[0106] Optionally, the control module 82 is used to control the creation of the second application instance of the target application, specifically including:

[0107] Resources are allocated to a second application instance of the target application, and the second application instance is controlled to run in the resources allocated to the second application instance.

[0108] Optionally, the control module 82 is used to control the second application instance to respond to the network request of the target application, specifically including:

[0109] When it is determined that the second application instance can process the network request of the target application, the second application instance is added to the instance list of the target application, so that the request forwarding device can forward the network request of the target application to the second application instance according to the instance list.

[0110] Optionally, the device further comprises a judgment module, configured to judge whether a preset condition is met;

[0111] The control module 82 is further configured to control the creation of the first application instance if a preset condition is met, so as to control the first application instance to respond to the network request of the target application.

[0112] Optionally, the preset condition includes any one of the following: receiving a network request for the target application, the number of network requests for the target application received is greater than a number threshold, the network request for the target application is received and the duration from the receiving moment is greater than a duration threshold, or the load of the second application instance is greater than a load threshold.

[0113] Optionally, the control module 82 is further configured to control the second application instance to no longer respond to the network request of the target application when the first application instance is able to respond to the network request of the target application.

[0114] Optionally, the control module 82 is used to control the second application instance to no longer respond to the network request of the target application, specifically including: controlling the release of the second application instance.

[0115] Optionally, the number of the second application instances is 1.

[0116] Figure 8 The device shown can perform Figure 4-Figure 5 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 4-Figure 5 The implementation process and technical effects of this technical solution refer to Figure 4-Figure 5 The description in the illustrated embodiment will not be repeated here.

[0117] In one possible implementation, Figure 8 The physical structure of the control device of the application example shown can be as follows Fig. 9 Reference Fig. 9 The control device of the application example may include: a processor 91 and a memory 92. The memory 92 is used to store the control device supporting the application example to execute the above Figure 4-Figure 6 The processor 91 is configured to execute the program stored in the memory 92 for the control method of the application example provided in the illustrated embodiment.

[0118] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the processor 91, the following steps can be implemented:

[0119] Determining that all application instances of a target application need to be released, wherein a current application instance of the target application is a first application instance;

[0120] Control creation of a second application instance of the target application and release the first application instance to control the second application instance to respond to a network request of the target application, wherein a resource specification of the second application instance is different from a resource specification of the first application instance.

[0121] Optionally, the processor 91 is further configured to execute the aforementioned Figure 4-Figure 5 All or part of the steps in the illustrated embodiments.

[0122] The control device of the application example may further include a communication interface 93 for the control device of the application example to communicate with other devices or a communication network.

[0123] Fig.10 A schematic diagram of a control device for an application example provided in another embodiment of the present application; see attached Fig.10 As shown, this embodiment provides a control device for an application example, which can execute the above Fig.10 The control method of the application example shown, specifically, the control device of the application example may include:

[0124] A generating module 101 is used to generate a network request for a target application when a cloud platform is required to provide a service for the target application;

[0125] A sending module 102, used to send the network request of the target application to the cloud platform;

[0126] Among them, the sending of the target application network request can trigger the cloud platform to determine that all application instances of the target application need to be released, and the current application instance of the target application is the first application instance, so that the cloud platform controls the creation of a second application instance of the target application and releases the first application instance to control the second application instance to respond to the network request of the target application, and the resource specifications of the second application instance are different from the resource specifications of the first application instance.

[0127] Fig.10 The device shown can perform Figure 7 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 7 The implementation process and technical effects of this technical solution refer to Figure 7 The description in the illustrated embodiment will not be repeated here.

[0128] In one possible implementation, Fig.10 The physical structure of the control device of the application example shown can be as follows Fig.11 Reference Fig.11 The control device of the application example may include: a processor 111 and a memory 112. The memory 112 is used to store the control device supporting the application example to execute the above Figure 7 The processor 111 is configured to execute the program stored in the memory 112 for the control method of the application example provided in the illustrated embodiment.

[0129] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the processor 111, the following steps can be implemented:

[0130] In the case where the cloud platform is required to provide services for the target application, generating a network request for the target application;

[0131] Sending the network request of the target application to the cloud platform;

[0132] Among them, the sending of the target application network request can trigger the cloud platform to determine that all application instances of the target application need to be released, and the current application instance of the target application is the first application instance, so that the cloud platform controls the creation of a second application instance of the target application and releases the first application instance to control the second application instance to respond to the network request of the target application, and the resource specifications of the second application instance are different from the resource specifications of the first application instance.

[0133] Optionally, the processor 111 is also used to execute the aforementioned Figure 7 All or part of the steps in the illustrated embodiments.

[0134] The control device of the application example may further include a communication interface 113 for the control device of the application example to communicate with other devices or a communication network.

[0135] In addition, the present application embodiment provides a control system of an application example, including: Fig. 9 The control device of the application example shown, and Fig.11 The control device of the application example shown.

[0136] In addition, the present application embodiment provides a computer storage medium for storing computer software instructions used by a computer device, which includes instructions for executing the above Figure 4-Figure 5 The program involved in the control method of the application example in the method embodiment shown.

[0137] The present application provides a computer storage medium for storing computer software instructions used by a computer device, which includes instructions for executing the above Figure 7 The program involved in the control method of the application example in the method embodiment shown.

[0138] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0139] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on this understanding, the above technical solution is essentially or the part that contributes to the traditional technology can be embodied in the form of a computer product, and the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0140] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0144] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0145] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A control method for an application instance, applied to a cloud platform, characterized in that: include: According to a network request of a target application, controlling the automatic expansion and contraction of a first application instance of the target application, determining that all application instances of the target application need to be released, the first application instance of the target application being used to respond to the network request of the target application; Control creation of a second application instance of the target application and release the first application instance to control the second application instance to respond to a network request of the target application, wherein a resource specification of the second application instance is lower than a resource specification of the first application instance.

2. The method according to claim 1, characterized in that The resource specification of the second application instance is lower than the resource specification of the first application instance, including one or more of the following: The instance specification of the second application instance is lower than the instance specification of the first application instance, the power of the processor chip for deploying the second application instance is lower than the power of the processor chip for deploying the first application instance, or the resources for deploying the first application instance are exclusive resources that do not need to be preempted with other application instances and the resources for deploying the second application instance are oversold resources that need to be preempted with other application instances.

3. The method according to claim 2, characterized in that The method further comprises: According to the instance specification of the first application instance, the instance specification of the second application instance is determined according to a preset downgrading strategy.

4. The method according to claim 2, characterized in that: The first application instance and the second application instance have different instruction systems.

5. The method according to claim 1, characterized in that The controlling the creation of the second application instance of the target application includes: Resources are allocated to a second application instance of the target application, and the second application instance is controlled to run in the resources allocated to the second application instance.

6. The method according to claim 1, characterized in that The controlling the second application instance to respond to the network request of the target application includes: When it is determined that the second application instance can process the network request of the target application, the second application instance is added to the instance list of the target application, so that the request forwarding device can forward the network request of the target application to the second application instance according to the instance list.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determining whether a preset condition is met, where the preset condition is met, indicating that a large number of network requests of the target application are predicted to need to be responded to; If the preset condition is met, the creation of the first application instance is controlled to control the first application instance to respond to the network request of the target application.

8. The method according to claim 7, characterized in that The preset condition includes any one of the following: receiving a network request for the target application, the number of network requests for the target application received is greater than a number threshold, the network request for the target application is received and the duration from the receiving time is greater than a duration threshold, or the load of the second application instance is greater than a load threshold.

9. The method according to claim 7, characterized in that: The method further comprises: When the first application instance is able to respond to the network request of the target application, the second application instance is controlled to no longer respond to the network request of the target application.

10. The method according to claim 9, characterized in that The controlling the second application instance to no longer respond to the network request of the target application includes: controlling the release of the second application instance.

11. The method according to any one of claims 1 to 6, characterized in that: The number of the second application instances is 1.

12. A control method for an application instance, applied to a cloud service consumption device, characterized in that: include: In the case where the cloud platform is required to provide services for the target application, generating a network request for the target application; The network request of the target application is sent to the cloud platform, so that the cloud platform controls the automatic expansion and contraction of the first application instance of the target application according to the network request of the target application, determines that all application instances of the target application need to be released, the first application instance of the target application is used to respond to the network request of the target application, controls the creation of a second application instance of the target application and releases the first application instance, so as to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is lower than the resource specification of the first application instance.

13. A control device of an application example, characterized in that: include: A determination module, configured to determine that all application instances of the target application need to be released in a scenario where the first application instance of the target application is automatically expanded or reduced according to a network request of the target application, wherein the first application instance of the target application is used to respond to the network request of the target application; A control module is used to control the creation of a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is lower than the resource specification of the first application instance.

14. A control device of an application example, characterized in that: include: A generating module, used for generating a network request for a target application when a cloud platform is required to provide a service for the target application; A sending module is used to send the network request of the target application to the cloud platform, so that the cloud platform can control the automatic expansion and contraction of the first application instance of the target application according to the network request of the target application, determine that all application instances of the target application need to be released, the first application instance of the target application is used to respond to the network request of the target application, control the creation of the second application instance of the target application and release the first application instance, so as to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is lower than the resource specification of the first application instance.

15. A control device of an application example, characterized in that: include: A memory, a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method as described in any one of claims 1 to 11.

16. A control device of an application example, characterized in that: include: A memory, a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method as claimed in claim 12.

17. A control system of an application example, characterized in that: include: The control device of the application example described in claim 14 and claim 15.

Citation Information

Patent Citations

  • A method and device for updating information

    CN109684043A

  • Configuration modification method and device for container application, computer equipment and storage medium

    CN110262873A

  • Cloud server and method for creating virtual machines

    US20130219390A1