Server architecture-free cloud service flexible capacity expansion method and device, and storage medium

By detecting service traffic metrics in a serverless cloud platform and forwarding them to a pre-created new container instance, the problem of insufficient capacity expansion capabilities of the cloud platform in dealing with burst traffic is solved, and the response and performance are improved, and centralization is avoided. Resource overhead of gateways.

CN119094532AActive Publication Date: 2024-12-06BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411155429.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-06
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

When dealing with unpredictable burst traffic, the existing cloud platform with serverless architecture lacks capacity expansion, high error rate, cannot respond in time, and relies on centralized gateways to lead to resource overhead and performance losses.

Method used

By detecting the service traffic metrics sent by upstream container instances to target downstream container instances in a cloud platform with serverless architecture, if the preset threshold is exceeded, the service traffic will be forwarded to the pre-created and warmed up new container instances to avoid cold start delays and overload protection.

Benefits of technology

It achieves almost zero latency expansion, reduces error rate, improves the response ability to service traffic, and avoids resource overhead and performance losses of centralized gateways.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094532A_ABST
    Figure CN119094532A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an elastic capacity expansion method and device for a cloud service without a server architecture, and a storage medium. Detecting a first index in the process of sending the service flow to the target downstream container instance by the upstream container instance and / or a second index in the process of processing the service flow by the target downstream container instance, and judging whether the first index and / or the second index exceed a corresponding preset threshold value or not; and if so, forwarding a part of the service traffic to a pre-created and preheated new container instance corresponding to the target downstream container instance. In the server-free architecture, the service flow sent by the upstream container instance is controlled to be forwarded to the preheated new container instance of the target downstream container instance by detecting the target downstream container instance and / or the target index of the upstream container instance, delay capacity expansion can be almost zero, and the performance of the server-free architecture in processing a high-concurrency scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer and network communication technology, and more particularly to a method, device and storage medium for elastic expansion of cloud services in a serverless architecture. Background Art

[0002] Serverless architecture is a cloud computing architecture model. In Serverless architecture, developers no longer need to focus on underlying server management, but instead focus on code writing and business logic. Serverless architecture has become an important technology in modern cloud computing in terms of handling burst traffic.

[0003] Some existing serverless cloud platforms usually have automatic scaling capabilities when dealing with traffic bursts. They increase or decrease container instances based on traffic flow to ensure that applications deployed on the cloud platform can maintain high availability and performance when facing traffic bursts.

[0004] However, the existing serverless cloud platform's expansion capabilities rely on centralized gateways, and the operation and maintenance of centralized gateways increases resource overhead and persistent performance loss; users are required to fine-tune expansion strategies, which are relatively complex to configure; for unpredictable burst traffic, the error rate is high and capacity cannot be expanded in time, affecting the response to traffic. Summary of the invention

[0005] The embodiments of the present disclosure provide a method, device and storage medium for elastic capacity expansion of cloud services in a serverless architecture, so as to realize rapid capacity expansion of target downstream container instances in a cloud platform in a serverless architecture, reduce error rate and improve response capability.

[0006] In a first aspect, an embodiment of the present disclosure provides a cloud service elastic expansion method based on a serverless architecture, comprising:

[0007] During the container instance processing process in a serverless cloud platform, a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance is detected, and / or a second indicator in a process in which the target downstream container instance processes the service traffic is detected, and it is determined whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator;

[0008] If it is determined that the target indicator exceeds the corresponding preset threshold, a portion of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, where the new container instance is a container instance that is newly created and preheated for the target downstream container instance.

[0009] In a second aspect, an embodiment of the present disclosure provides a cloud service elastic expansion device based on a serverless architecture, including:

[0010] A detection unit is used to detect a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance, and / or a second indicator in a process in which the target downstream container instance processes service traffic, during a container instance processing flow in a serverless cloud platform, and to determine whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator;

[0011] A forwarding unit is used to forward a portion of the service traffic to a new container instance corresponding to the target downstream container instance if it is determined that the target indicator exceeds the corresponding preset threshold, wherein the new container instance is a container instance newly created and preheated for the target downstream container instance.

[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0013] The memory stores computer-executable instructions;

[0014] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the cloud service elastic expansion method based on a serverless architecture as described in the first aspect and various possible designs of the first aspect above.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the cloud service elastic expansion method based on a serverless architecture as described in the first aspect and various possible designs of the first aspect is implemented.

[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including computer execution instructions. When a processor executes the computer execution instructions, it implements the cloud service elastic expansion method based on a serverless architecture as described in the first aspect and various possible designs of the first aspect.

[0017] The cloud service elastic expansion method, device and storage medium based on serverless architecture provided by the embodiments of the present disclosure detect the first indicator of the process of the upstream container instance sending service traffic to the target downstream container instance and / or the second indicator of the process of the target downstream container instance processing service traffic during the container instance processing flow in the serverless architecture cloud platform, and judge whether the target indicator exceeds the corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator; if it is determined that the target indicator exceeds the corresponding preset threshold, a part of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, and the new container instance is a container instance newly created and preheated for the target downstream container instance in advance. In the embodiment of the present disclosure, in the serverless architecture, the target indicators of the target downstream container instance and / or the upstream container instance are detected to control the forwarding of the service traffic sent by the upstream container instance to the new container instance of the target downstream container instance to carry the service traffic. The new container instance is preheated in advance, and the capacity expansion can be achieved with almost zero delay, avoiding the creation of a new container instance after the capacity expansion is triggered, causing delays in the cold start of the new container instance, affecting the response to the service traffic, and avoiding overloading of the target downstream container instance, thereby avoiding the increase in error rate caused by overload protection, thereby improving the performance of the serverless architecture in handling high-concurrency scenarios, and eliminating the need to rely on a centralized gateway, avoiding the resource overhead and performance loss caused by the operation and maintenance of the centralized gateway. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 A schematic diagram of a scenario of a cloud service elastic expansion method based on a serverless architecture provided in an embodiment of the present disclosure;

[0020] Figure 2 A schematic diagram of a process flow of a cloud service elastic capacity expansion method based on a serverless architecture provided in an embodiment of the present disclosure;

[0021] Figure 3 A schematic diagram of downstream forwarding of a cloud service elastic capacity expansion method based on a serverless architecture provided in an embodiment of the present disclosure;

[0022] Figure 4 A schematic diagram of upstream forwarding of a cloud service elastic capacity expansion method based on a serverless architecture provided in an embodiment of the present disclosure;

[0023] Figure 5 A structural block diagram of a cloud service elastic expansion device based on a serverless architecture provided in an embodiment of the present disclosure;

[0024] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0026] Some existing serverless cloud platforms usually have automatic scaling capabilities when dealing with traffic bursts. They increase or decrease container instances based on traffic flow to ensure that applications deployed on the cloud platform can maintain high availability and performance when facing traffic bursts.

[0027] For example, in a server-based cloud platform, the number of execution environments is automatically expanded to respond to increased requests until the account's concurrency limit is reached. To prevent over-scaling due to sudden traffic, there is a limit on the speed of expansion. In addition, reserved concurrency and configured concurrency options are provided, allowing a certain number of execution environments to be reserved or pre-initialized for critical functions, thereby reducing cold start delays and improving response speed.

[0028] In another server-based cloud platform, automatic expansion is also provided without manual intervention, ensuring that the application can handle any amount of traffic. And charges are only made when the function is executed, so there is no charge for idle resources. In addition, when processing requests, functions can be automatically replicated to multiple availability zones to ensure that the application is still available even if a certain area fails.

[0029] In a cloud platform with another server architecture, container technology is used in a serverless environment to provide the ability to automatically increase or decrease container instances based on traffic. It can respond to traffic changes within a few milliseconds to achieve efficient use of resources, and charges are only made when the container processes a request.

[0030] However, the existing serverless cloud platform's expansion capability relies on centralized gateways, and the operation and maintenance of centralized gateways (especially in microservice scenarios) increases resource overhead and persistent performance loss. Automatic expansion can provide the necessary computing resources to cope with predictable burst traffic, but it may lead to unpredictable cost increases, so users are usually required to fine-tune the expansion strategy to optimize the cost-effectiveness ratio. However, its configuration is relatively complex, which brings difficulties to users. For unpredictable burst traffic, the error rate is high and it is impossible to expand in time. Most of the expansion is completed asynchronously and cannot solve the instantaneous traffic problem, which affects the response to traffic.

[0031] In order to solve at least one of the above technical problems, the embodiment of the present disclosure provides a cloud service elastic expansion method based on a serverless architecture, by detecting a first indicator in the process of an upstream container instance sending service traffic to a target downstream container instance, and / or a second indicator in the process of the target downstream container instance processing service traffic during the container instance processing process in a cloud platform with a serverless architecture, and judging whether the target indicator exceeds the corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator; if it is determined that the target indicator exceeds the corresponding preset threshold, a part of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, and the new container instance is a container instance newly created and preheated for the target downstream container instance. In the embodiment of the present disclosure, in the serverless architecture, the target indicators of the target downstream container instance and / or the upstream container instance are detected to control the forwarding of the service traffic sent by the upstream container instance to the new container instance of the target downstream container instance to carry the service traffic. The new container instance is preheated in advance, and the capacity expansion can be achieved with almost zero delay, thereby improving the response to the service traffic, avoiding the creation of a new container instance after the capacity expansion is triggered, causing delays in the cold start of the new container instance, and avoiding overloading of the target downstream container instance, thereby avoiding the increase in error rate caused by overload protection, thereby improving the performance of the serverless architecture in handling high-concurrency scenarios, and eliminating the need to rely on a centralized gateway, thus avoiding the resource overhead and performance loss caused by the operation and maintenance of the centralized gateway.

[0032] The cloud service elastic expansion method based on serverless architecture provided in the embodiment of the present disclosure can be applied to Figure 1 In the serverless architecture cloud platform shown, which includes a target downstream container instance and one or more upstream container instances that send service traffic to the target downstream container instance, when it is detected that the target indicator of the target downstream container instance and / or one or more upstream container instances exceeds a preset threshold, a portion of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance to achieve capacity expansion, wherein the new container instance is a container instance that is newly created and preheated for the target downstream container instance.

[0033] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0034] The following will introduce in detail the cloud service elastic expansion method based on serverless architecture disclosed in the present invention in conjunction with specific embodiments.

[0035] refer to Figure 2 , Figure 2 A schematic diagram of a process flow of a cloud service elastic expansion method based on a serverless architecture provided in an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or a server. The cloud service elastic expansion method based on a serverless architecture includes:

[0036] S201. During the container instance processing process in a serverless cloud platform, detect a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance, and / or a second indicator in a process in which the target downstream container instance processes service traffic, and determine whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator.

[0037] In this embodiment, in a cloud platform with a serverless architecture, an upstream container instance (Pod) can send service traffic, such as service requests, call requests, file or data transmission, etc., to a downstream container instance. Any target downstream container instance can process the service traffic after receiving the service traffic sent by one or more upstream container instances. However, the computing resources of the target downstream container instance are limited, and the service traffic that can be processed is limited. When a burst of service traffic occurs in the upstream container instance, the service traffic received by the target downstream container instance exceeds its processing capacity, and the target downstream container instance needs to be expanded.

[0038] In order to accurately determine the timing of expanding the capacity of the target downstream container instance, in this embodiment, during the process of the target downstream container instance receiving the service traffic sent by one or more upstream container instances, it can be detected whether the target index of the target downstream container instance and / or one or more upstream container instances exceeds the corresponding preset threshold. The target index can be different for the upstream container instance and the target downstream container instance, wherein the target index includes a first index generated in the process of the upstream container instance forwarding the service traffic to the target downstream container instance, and / or a second index generated in the process of the target downstream container instance processing the service traffic.

[0039] Optionally, for the target downstream container instance, the target indicator, that is, the second indicator, may be a target performance indicator of the target downstream container instance, including but not limited to one or more performance indicators such as CPU usage, memory usage, or request delay time. Each target performance indicator may be pre-configured with a corresponding preset threshold. When at least one of the one or more target performance indicators of the target downstream container instance exceeds the corresponding preset threshold, the expansion of the target downstream container instance will be triggered, thereby avoiding overloading of the target downstream container instance and affecting performance, especially avoiding triggering overload protection of the target downstream container instance, thereby avoiding an increase in error rate due to the target downstream container instance rejecting service traffic that cannot be processed due to triggering overload protection.

[0040] Optionally, for the target downstream container instance, the second indicator may also be the data volume of the service traffic received by the target downstream container instance, and a preset traffic threshold corresponding to the service traffic received by the target downstream container instance may be configured. When the service traffic received by the target downstream container instance exceeds the corresponding preset traffic threshold, the expansion of the target downstream container instance is triggered.

[0041] Optionally, for the upstream container instance, the target indicator, that is, the first indicator, can be the data volume of the service traffic sent by any target upstream container instance to the target downstream container instance, and a preset traffic threshold corresponding to the data volume of the service traffic sent by any target upstream container instance to the target downstream container instance can be configured; and when the service traffic sent by any target upstream container instance to the target downstream container instance exceeds the corresponding preset traffic threshold, the expansion of the target downstream container instance is triggered.

[0042] Optionally, the above target indicators may be combined with each other; in addition, the target indicators are not limited to the above examples, and may also be other indicators, which are not described here one by one.

[0043] S202: If it is determined that the target indicator exceeds the corresponding preset threshold, a portion of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, where the new container instance is a container instance that is newly created and preheated for the target downstream container instance.

[0044] In this embodiment, when it is determined that the first indicator and / or the second indicator exceeds the corresponding preset threshold, the expansion of the target downstream container instance is triggered, and a part of the service traffic can be forwarded to a new container instance corresponding to the target downstream container instance, wherein the new container instance can be a container instance newly created and preheated for the target downstream container instance in advance, that is, when the expansion is triggered, the new container instance can start running directly, or it can start running in a very short time, without going through time-consuming processes such as creation and startup. In this way, when it is determined that the target indicator exceeds the corresponding preset threshold, the expansion can be achieved with almost zero delay, avoiding the delay caused by creating a new container instance after the expansion is triggered and requiring the new container instance to be cold-started, thereby affecting the response to the service traffic.

[0045] Among them, optionally, the new container instance corresponding to the target downstream container instance can be a new container instance newly created and preheated for the target downstream container instance before the target indicator exceeds the corresponding preset threshold, wherein the preheating process is to preload the service in the target downstream container instance (or preload the image of the target downstream container instance) into the new container instance and complete the cold start in advance, which can be any start-up method such as a complete cold start or a fast cold start of the new container instance in advance, as long as the preheating is completed before the target indicator exceeds the corresponding preset threshold, of course, it can also be completed within a preset time (a very short time) after exceeding the preset threshold. Optionally, a new container instance newly created and preheated for the target downstream container instance can be preheated at any time before the target indicator is about to reach the corresponding preset threshold (for example, reaching a preset proportion of the preset threshold). In addition, the new container instance corresponding to the target downstream container instance may not be limited to one, but may be multiple.

[0046] Optionally, a new container instance that has been newly created and preheated for the target downstream container instance may not be activated before the target indicator exceeds the corresponding preset threshold. In the case of non-activation, no fee is incurred, and resources are merely pre-allocated but not actually used. After the target indicator exceeds the corresponding preset threshold, the new container instance is activated. At this time, the new container instance can operate normally, and after forwarding part of the service traffic to the new container instance, the new container instance can process the part of the service traffic.

[0047] Optionally, when forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, any feasible method can be used to determine how much service traffic to forward and which service traffic to forward, as long as it is ensured that the target indicators of the target downstream container instance and / or the upstream container instance no longer exceed a preset threshold.

[0048] The cloud service elastic expansion method based on serverless architecture provided in this embodiment detects the first indicator of the process of the upstream container instance sending service traffic to the target downstream container instance and / or the second indicator of the process of the target downstream container instance processing service traffic during the container instance processing process in the serverless architecture cloud platform, and determines whether the target indicator exceeds the corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator; if it is determined that the target indicator exceeds the corresponding preset threshold, a part of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, and the new container instance is a container instance newly created and preheated for the target downstream container instance. In this embodiment, in the serverless architecture, the target indicators of the target downstream container instance and / or the upstream container instance are detected to control the forwarding of the service traffic sent by the upstream container instance to the new container instance of the target downstream container instance to carry the service traffic. The new container instance is preheated in advance, and the capacity expansion can be achieved with almost zero delay, avoiding the creation of a new container instance after the expansion is triggered, causing delays in the cold start of the new container instance, affecting the response to the service traffic, and avoiding overloading of the target downstream container instance, thereby avoiding the increase in error rate caused by overload protection, thereby improving the performance of the serverless architecture in handling high-concurrency scenarios, and eliminating the need to rely on a centralized gateway, avoiding the resource overhead and performance loss caused by the operation and maintenance of the centralized gateway.

[0049] In an optional embodiment, based on any of the above embodiments, Figure 3As shown, a forwarding component can be preset in the target downstream container instance, and the forwarding component can detect the target performance indicator (i.e., the second indicator) of the target downstream container instance in real time, including but not limited to one or more performance indicators such as CPU usage, memory usage, or request delay time. If it is detected that at least one target performance indicator of the target downstream container instance exceeds the corresponding preset threshold, the forwarding component can forward a portion of the service traffic received by the target downstream container instance from one or more upstream container instances to a new container instance corresponding to the target downstream container instance. By presetting the forwarding component to detect the target performance indicator and forward the service traffic, the target downstream container instance can be prevented from triggering overload protection, thereby preventing the target downstream container instance from rejecting service traffic that cannot be processed due to triggering overload protection, resulting in an increase in the error rate; in addition, the end-to-end time of upstream service discovery can be reduced, that is, the upstream service is prevented from discovering the route of the new container instance corresponding to the target downstream container instance through Faas (Function as a Service), thereby reducing this end-to-end time; in addition, since the service traffic is forwarded when the target performance indicator of the target downstream container instance exceeds the corresponding preset threshold, the target downstream container instance runs under a certain resource utilization rate, thereby preventing the target performance indicator of the target downstream container instance from soaring and triggering overload protection.

[0050] Optionally, if multiple new container instances are created for the target downstream container instance in advance, when the forwarding component detects that at least one target performance indicator of the target downstream container instance exceeds the corresponding preset threshold, a list of new container instances that can forward service traffic can be obtained from the multiple new container instances, and a portion of the service traffic can be forwarded to one or more new container instances in the list of new container instances that can forward service traffic.

[0051] Optionally, the target performance indicator of the new container instance corresponding to the target downstream container instance can be detected. If the target performance indicator of the new container instance reaches the corresponding threshold, a portion of the service traffic received by the target downstream container instance from one or more upstream container instances can continue to be forwarded to another new container instance corresponding to the target downstream container instance. The other new container instance is also created and preheated before the target performance indicator of the previous new container instance reaches the corresponding threshold. For example, the next new container instance can be created after the previous new container instance is activated, or the next new container instance can be created when the target performance indicator of the previous new container instance reaches a preset proportion of a preset threshold. Optionally, the detection of the target performance indicator of the previous new container instance can be detected by a forwarding component preset on the previous new container instance, and sent to the forwarding component of the target downstream container instance. When it is determined that the target performance indicator of the previous new container instance reaches the corresponding threshold, the forwarding component of the target downstream container instance controls the forwarding of the service traffic to the next new container instance, and so on. In other words, the forwarding component of the target downstream container instance uniformly controls the forwarding of the service traffic; or, the detection of the target performance indicator of the previous new container instance can be detected by a forwarding component preset on the previous new container instance. When it is determined that the target performance indicator of the previous new container instance reaches the corresponding threshold, the forwarding component of the previous new container instance forwards a part of the service traffic received from the target downstream container instance to the next new container instance, and so on. In other words, the forwarding component of the previous container instance controls the forwarding of the service traffic to the next container instance.

[0052] Optionally, in any of the above embodiments, when creating a corresponding new container instance for the target downstream container instance, or when forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, it is possible to check whether the corresponding new container instance exists for the target downstream container instance. If not, a corresponding new container instance is created for the target downstream container instance and preheated or started.

[0053] In addition, after forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, if the target performance indicator of the target downstream container instance no longer exceeds the preset threshold, the new container instance can be stopped and all the service traffic can be sent to the target downstream container instance for processing. Optionally, the stopped new container instance can be reactivated and reused the next time the target performance indicator of the target downstream container instance exceeds the preset threshold, or the resources of the new container instance can be recycled.

[0054] In another optional embodiment, based on any of the above embodiments, Figure 4As shown, a gateway component can be preset in any target upstream container instance among one or more upstream container instances, and the gateway component can detect the service traffic (i.e., the first indicator) sent by the target upstream container instance to the target downstream container instance in real time. If the gateway component detects that the service traffic sent by the target upstream container instance to the target downstream container instance exceeds the preset traffic threshold (i.e., the preset threshold corresponding to the first indicator), the gateway component can forward the service traffic that exceeds the preset traffic threshold to be sent by the target upstream container instance to the target downstream container instance to the new container instance corresponding to the target downstream container instance. By controlling the forwarding of service traffic through the gateway component of the upstream container instance, the problem of insufficient forwarding performance of the target downstream container instance can be solved. In addition, forwarding upstream can reduce the overhead of one link transmission.

[0055] Optionally, in this embodiment, the preset flow threshold can be set to a fixed value, or can also be changed dynamically. Specifically, the preset flow threshold can be dynamically changed according to the number of downstream container instances, the downstream single container instance flow limit value, and the number of upstream container instances.

[0056] Among them, the number of downstream container instances, the flow limit value of a single downstream container instance, and the number of upstream container instances can be obtained first, and then the product of the number of downstream container instances and the upper limit value of the downstream single container instance receiving flow is obtained as the upper limit value of the total flow received by the downstream container instance, and then the ratio of the upper limit value of the total flow received by the downstream container instance to the number of upstream container instances is obtained as the upper limit value of the flow sent by the upstream single container instance, and the upper limit value of the flow sent by the upstream single container instance is determined as the preset flow threshold, that is: preset flow threshold = number of downstream container instances * upper limit value of the flow received by the downstream single container instance / number of upstream container instances. The process of calculating the preset flow threshold can be calculated by the target upstream container instance itself, or it can also be calculated by a centralized computing node and sent to each target upstream container instance as a judgment basis for forwarding service flow at the target upstream container instance level.

[0057] Optionally, in any of the above embodiments, when forwarding service traffic to a new container instance corresponding to a target downstream container instance, it may be possible to check whether a corresponding new container instance exists for the target downstream container instance. If not, a corresponding new container instance is created for the target downstream container instance and preheated or started.

[0058] In addition, after forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, if the target indicator no longer exceeds the corresponding preset threshold, the new container instance can be stopped and all the service traffic can be sent to the target downstream container instance for processing. Optionally, the stopped new container instance can be reactivated and reused the next time the target indicator exceeds the corresponding preset threshold, or the resources of the new container instance can be recycled.

[0059] Of course, the above-mentioned container instances can be combined with each other, that is, when the gateway component of any target upstream container instance detects that the service traffic sent by the target upstream container instance to the target downstream container instance exceeds the preset traffic threshold, the gateway component can forward the service traffic that exceeds the preset traffic threshold to be sent by the target upstream container instance to the target downstream container instance to the new container instance corresponding to the target downstream container instance; and when the forwarding component of the target downstream container instance detects that at least one target performance indicator of the target downstream container instance exceeds the corresponding preset threshold, the forwarding component can also forward a part of the service traffic received by the target downstream container instance from one or more upstream container instances to the new container instance corresponding to the target downstream container instance.

[0060] Corresponding to the cloud service elastic expansion method based on serverless architecture in the above embodiment, Figure 5 A structural block diagram of a cloud service elastic expansion device based on a serverless architecture provided in an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 5 The cloud service elastic expansion device 500 based on serverless architecture includes: a detection unit 501 and a forwarding unit 502.

[0061] Among them, the detection unit 501 is used to detect a first indicator in the process of an upstream container instance sending service traffic to a target downstream container instance, and / or a second indicator in the process of the target downstream container instance processing service traffic during the container instance processing process in a serverless architecture cloud platform, and determine whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator;

[0062] The forwarding unit 502 is used to forward a portion of the service traffic to a new container instance corresponding to the target downstream container instance if it is determined that the target indicator exceeds the corresponding preset threshold, wherein the new container instance is a container instance newly created and preheated for the target downstream container instance.

[0063] In one or more embodiments of the present disclosure, when the detection unit 501 detects the second indicator in the process of the target downstream container instance processing the service traffic and determines whether the target indicator exceeds the corresponding preset threshold, it is used to:

[0064] By means of a forwarding component preset in the target downstream container instance, a second indicator in a process of processing service traffic by the target downstream container instance is detected, and it is determined whether the second indicator exceeds a corresponding preset threshold, wherein the second indicator is a target performance indicator of the target downstream container instance;

[0065] When forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit 502 is configured to:

[0066] A portion of the service traffic received by the target downstream container instance from the one or more upstream container instances is forwarded to a new container instance corresponding to the target downstream container instance by the forwarding component.

[0067] In one or more embodiments of the present disclosure,

[0068] The target performance indicator includes at least one of the following: CPU usage, memory usage, or request delay time.

[0069] In one or more embodiments of the present disclosure, when the detection unit 501 detects a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance and determines whether the target indicator exceeds a corresponding preset threshold, it is configured to:

[0070] For any target upstream container instance, a gateway component preset in the target upstream container instance is used to detect a first indicator in the process of the upstream container instance sending service traffic to the target downstream container instance, and determine whether the first indicator exceeds a corresponding preset threshold; wherein the first indicator is the service traffic sent by the target upstream container instance to the target downstream container instance;

[0071] When forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit 502 is configured to:

[0072] The service traffic to be sent by the target upstream container instance to the target downstream container instance and exceeding the preset traffic threshold is forwarded to a new container instance corresponding to the target downstream container instance through the gateway component.

[0073] In one or more embodiments of the present disclosure, the detection unit 501 is further configured to:

[0074] Get the number of downstream container instances, the downstream single container instance current limit value, and the number of upstream container instances;

[0075] The product of the number of downstream container instances and the upper limit of the traffic received by the downstream single container instance is obtained as the upper limit of the total traffic received by the downstream container instance, and the ratio of the upper limit of the total traffic received by the downstream container instance to the number of upstream container instances is obtained as the upper limit of the traffic sent by the upstream single container instance, and the upper limit of the traffic sent by the upstream single container instance is determined as the preset threshold corresponding to the first indicator.

[0076] In one or more embodiments of the present disclosure, the device further includes a creating unit 503, configured to create a corresponding new container instance for the target downstream container instance and preheat the new container instance before forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance;

[0077] When forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit 502 is configured to:

[0078] The new container instance is activated, and a portion of the service traffic is forwarded to the new container instance corresponding to the target downstream container instance.

[0079] In one or more embodiments of the present disclosure, when creating a corresponding new container instance for the target downstream container instance, the creating unit 503 is used to:

[0080] Find out whether there is a corresponding new container instance for the target downstream container instance. If not, create a corresponding new container instance for the target downstream container instance.

[0081] In one or more embodiments of the present disclosure, when creating a corresponding new container instance for the target downstream container instance, the creating unit 503 is used to:

[0082] At any time before the target indicator exceeds the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

[0083] In one or more embodiments of the present disclosure, when the creation unit 503 creates a corresponding new container instance for the target downstream container instance at any time before the target indicator exceeds the corresponding preset threshold, it is used to:

[0084] When the target indicator reaches a preset ratio of the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

[0085] In one or more embodiments of the present disclosure, after forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit 502 is further configured to:

[0086] If the target indicator no longer exceeds the corresponding preset threshold, the new container instance is stopped, and the service traffic is sent to the target downstream container instance.

[0087] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0088] refer to Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure, and the electronic device 600 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. 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.

[0089] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 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 device 608 to a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0090] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0091] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart 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 medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0092] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. 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, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0093] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0094] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0095] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0096] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart 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.

[0097] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0098] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] In a first aspect, according to one or more embodiments of the present disclosure, a method for elastically expanding cloud services based on a serverless architecture is provided, comprising:

[0101] During the container instance processing process in a serverless cloud platform, a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance is detected, and / or a second indicator in a process in which the target downstream container instance processes the service traffic is detected, and it is determined whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator;

[0102] If it is determined that the target indicator exceeds the corresponding preset threshold, a portion of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, where the new container instance is a container instance that is newly created and preheated for the target downstream container instance.

[0103] According to one or more embodiments of the present disclosure, detecting a second indicator in a process in which the target downstream container instance processes service traffic, and determining whether the target indicator exceeds a corresponding preset threshold, includes:

[0104] By means of a forwarding component preset in the target downstream container instance, a second indicator in a process of processing service traffic by the target downstream container instance is detected, and it is determined whether the second indicator exceeds a corresponding preset threshold, wherein the second indicator is a target performance indicator of the target downstream container instance;

[0105] The forwarding of a portion of the service traffic to a new container instance corresponding to the target downstream container instance includes:

[0106] A portion of the service traffic received by the target downstream container instance from the one or more upstream container instances is forwarded to a new container instance corresponding to the target downstream container instance by the forwarding component.

[0107] According to one or more embodiments of the present disclosure, the target performance indicator includes at least one of the following: CPU usage, memory usage, or request delay time.

[0108] According to one or more embodiments of the present disclosure, detecting a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance, and determining whether the target indicator exceeds a corresponding preset threshold, includes:

[0109] For any target upstream container instance, a gateway component preset in the target upstream container instance is used to detect a first indicator in the process of the upstream container instance sending service traffic to the target downstream container instance, and determine whether the first indicator exceeds a corresponding preset threshold; wherein the first indicator is the service traffic sent by the target upstream container instance to the target downstream container instance;

[0110] The forwarding of a portion of the service traffic to a new container instance corresponding to the target downstream container instance includes:

[0111] The service traffic to be sent by the target upstream container instance to the target downstream container instance and exceeding a preset threshold corresponding to the first indicator is forwarded to a new container instance corresponding to the target downstream container instance through the gateway component.

[0112] According to one or more embodiments of the present disclosure, the method further includes:

[0113] Get the number of downstream container instances, the downstream single container instance current limit value, and the number of upstream container instances;

[0114] The product of the number of downstream container instances and the upper limit of the traffic received by the downstream single container instance is obtained as the upper limit of the total traffic received by the downstream container instance, and the ratio of the upper limit of the total traffic received by the downstream container instance to the number of upstream container instances is obtained as the upper limit of the traffic sent by the upstream single container instance, and the upper limit of the traffic sent by the upstream single container instance is determined as the preset threshold corresponding to the first indicator.

[0115] According to one or more embodiments of the present disclosure, before forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the method further includes:

[0116] Creating a corresponding new container instance for the target downstream container instance, and preheating the new container instance;

[0117] The forwarding of a portion of the service traffic to a new container instance corresponding to the target downstream container instance includes:

[0118] The new container instance is activated, and a portion of the service traffic is forwarded to the new container instance corresponding to the target downstream container instance.

[0119] According to one or more embodiments of the present disclosure, the creating a corresponding new container instance for the target downstream container instance includes:

[0120] Find out whether there is a corresponding new container instance for the target downstream container instance. If not, create a corresponding new container instance for the target downstream container instance.

[0121] According to one or more embodiments of the present disclosure, the creating a corresponding new container instance for the target downstream container instance includes:

[0122] At any time before the target indicator exceeds the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

[0123] According to one or more embodiments of the present disclosure, at any time before the target indicator exceeds the corresponding preset threshold, creating a corresponding new container instance for the target downstream container instance includes:

[0124] When the target indicator reaches a preset ratio of the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

[0125] According to one or more embodiments of the present disclosure, after forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the method further includes:

[0126] If the target indicator no longer exceeds the corresponding preset threshold, the new container instance is stopped, and the service traffic is sent to the target downstream container instance.

[0127] In a second aspect, according to one or more embodiments of the present disclosure, a cloud service elastic expansion device based on a serverless architecture is provided, comprising:

[0128] A detection unit is used to detect a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance, and / or a second indicator in a process in which the target downstream container instance processes service traffic, during a container instance processing flow in a serverless cloud platform, and to determine whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator;

[0129] A forwarding unit is used to forward a portion of the service traffic to a new container instance corresponding to the target downstream container instance if it is determined that the target indicator exceeds the corresponding preset threshold, wherein the new container instance is a container instance newly created and preheated for the target downstream container instance.

[0130] According to one or more embodiments of the present disclosure, when the detection unit detects the second indicator in the process of the target downstream container instance processing the service traffic and determines whether the target indicator exceeds the corresponding preset threshold, it is used to:

[0131] By means of a forwarding component preset in the target downstream container instance, a second indicator in a process of processing service traffic by the target downstream container instance is detected, and it is determined whether the second indicator exceeds a corresponding preset threshold, wherein the second indicator is a target performance indicator of the target downstream container instance;

[0132] When forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit is configured to:

[0133] A portion of the service traffic received by the target downstream container instance from the one or more upstream container instances is forwarded to a new container instance corresponding to the target downstream container instance by the forwarding component.

[0134] According to one or more embodiments of the present disclosure, the

[0135] The target performance indicator includes at least one of the following: CPU usage, memory usage, or request delay time.

[0136] According to one or more embodiments of the present disclosure, when the detection unit detects a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance and determines whether the target indicator exceeds a corresponding preset threshold, it is configured to:

[0137] For any target upstream container instance, a gateway component preset in the target upstream container instance is used to detect a first indicator in the process of the upstream container instance sending service traffic to the target downstream container instance, and determine whether the first indicator exceeds a corresponding preset threshold; wherein the first indicator is the service traffic sent by the target upstream container instance to the target downstream container instance;

[0138] When forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit is configured to:

[0139] The service traffic to be sent by the target upstream container instance to the target downstream container instance and exceeding a preset threshold corresponding to the first indicator is forwarded to a new container instance corresponding to the target downstream container instance through the gateway component.

[0140] According to one or more embodiments of the present disclosure, the detection unit is further used for:

[0141] Get the number of downstream container instances, the downstream single container instance current limit value, and the number of upstream container instances;

[0142] The product of the number of downstream container instances and the upper limit of the traffic received by the downstream single container instance is obtained as the upper limit of the total traffic received by the downstream container instance, and the ratio of the upper limit of the total traffic received by the downstream container instance to the number of upstream container instances is obtained as the upper limit of the traffic sent by the upstream single container instance, and the upper limit of the traffic sent by the upstream single container instance is determined as the preset threshold corresponding to the first indicator.

[0143] According to one or more embodiments of the present disclosure, the device further includes a creation unit, configured to create a corresponding new container instance for the target downstream container instance and preheat the new container instance before forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance;

[0144] When forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit is configured to:

[0145] The new container instance is activated, and a portion of the service traffic is forwarded to the new container instance corresponding to the target downstream container instance.

[0146] According to one or more embodiments of the present disclosure, when creating a corresponding new container instance for the target downstream container instance, the creation unit is used to:

[0147] Find out whether there is a corresponding new container instance for the target downstream container instance. If not, create a corresponding new container instance for the target downstream container instance.

[0148] According to one or more embodiments of the present disclosure, when creating a corresponding new container instance for the target downstream container instance, the creation unit is used to:

[0149] At any time before the target indicator exceeds the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

[0150] According to one or more embodiments of the present disclosure, when the creation unit creates a corresponding new container instance for the target downstream container instance at any time before the target indicator exceeds the corresponding preset threshold, it is used to:

[0151] When the target indicator reaches a preset ratio of the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

[0152] According to one or more embodiments of the present disclosure, after forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the forwarding unit is further configured to:

[0153] If the target indicator no longer exceeds the corresponding preset threshold, the new container instance is stopped, and the service traffic is sent to the target downstream container instance.

[0154] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0155] The memory stores computer-executable instructions;

[0156] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the cloud service elastic expansion method based on a serverless architecture as described in the first aspect and various possible designs of the first aspect above.

[0157] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the cloud service elastic expansion method based on a serverless architecture as described in the first aspect and various possible designs of the first aspect is implemented.

[0158] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer execution instructions. When a processor executes the computer execution instructions, the method for elastic expansion of cloud services based on a serverless architecture as described in the first aspect and various possible designs of the first aspect is implemented.

[0159] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0160] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0161] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A cloud service elastic expansion method based on serverless architecture, characterized in that: include: During the container instance processing process in a serverless cloud platform, a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance is detected, and / or a second indicator in a process in which the target downstream container instance processes the service traffic is detected, and it is determined whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator; If it is determined that the target indicator exceeds the corresponding preset threshold, a portion of the service traffic is forwarded to a new container instance corresponding to the target downstream container instance, where the new container instance is a container instance newly created and preheated for the target downstream container instance.

2. The method according to claim 1, characterized in that The detecting a second indicator in the process of the target downstream container instance processing the service traffic and determining whether the target indicator exceeds a corresponding preset threshold value includes: By means of a forwarding component preset in the target downstream container instance, a second indicator in a process of processing service traffic by the target downstream container instance is detected, and it is determined whether the second indicator exceeds a corresponding preset threshold, wherein the second indicator is a target performance indicator of the target downstream container instance; The forwarding of a portion of the service traffic to a new container instance corresponding to the target downstream container instance includes: A portion of the service traffic received by the target downstream container instance from one or more upstream container instances is forwarded to a new container instance corresponding to the target downstream container instance by the forwarding component.

3. The method according to claim 2, characterized in that The target performance indicator includes at least one of the following: CPU usage, memory usage, or request delay time.

4. The method according to claim 1, characterized in that: The detecting a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance, and determining whether the target indicator exceeds a corresponding preset threshold, includes: For any target upstream container instance, a gateway component preset in the target upstream container instance is used to detect a first indicator in the process of the upstream container instance sending service traffic to the target downstream container instance, and determine whether the first indicator exceeds a corresponding preset threshold; wherein the first indicator is the service traffic sent by the target upstream container instance to the target downstream container instance; The forwarding of a portion of the service traffic to a new container instance corresponding to the target downstream container instance includes: The service traffic to be sent by the target upstream container instance to the target downstream container instance and exceeding a preset threshold corresponding to the first indicator is forwarded to a new container instance corresponding to the target downstream container instance through the gateway component.

5. The method according to claim 4, characterized in that The method further comprises: Get the number of downstream container instances, the downstream single container instance current limit value, and the number of upstream container instances; The product of the number of downstream container instances and the upper limit of the traffic received by the downstream single container instance is obtained as the upper limit of the total traffic received by the downstream container instance, and the ratio of the upper limit of the total traffic received by the downstream container instance to the number of upstream container instances is obtained as the upper limit of the traffic sent by the upstream single container instance, and the upper limit of the traffic sent by the upstream single container instance is determined as the preset threshold corresponding to the first indicator.

6. The method according to claim 1, characterized in that Before forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the method further includes: Creating a corresponding new container instance for the target downstream container instance, and preheating the new container instance; The forwarding of a portion of the service traffic to a new container instance corresponding to the target downstream container instance includes: The new container instance is activated, and a portion of the service traffic is forwarded to the new container instance corresponding to the target downstream container instance.

7. The method according to claim 6, characterized in that The creating a corresponding new container instance for the target downstream container instance includes: At any time before the target indicator exceeds the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

8. The method according to claim 7, characterized in that The creating a corresponding new container instance for the target downstream container instance at any time before the target indicator exceeds the corresponding preset threshold includes: When the target indicator reaches a preset ratio of the corresponding preset threshold, a corresponding new container instance is created for the target downstream container instance.

9. The method according to claim 1, characterized in that: After forwarding a portion of the service traffic to the new container instance corresponding to the target downstream container instance, the method further includes: If the target indicator no longer exceeds the corresponding preset threshold, the new container instance is stopped, and the service traffic is sent to the target downstream container instance.

10. A cloud service elastic expansion device based on serverless architecture, characterized in that: include: A detection unit is used to detect a first indicator in a process in which an upstream container instance sends service traffic to a target downstream container instance, and / or a second indicator in a process in which the target downstream container instance processes service traffic, during a container instance processing flow in a serverless cloud platform, and to determine whether the target indicator exceeds a corresponding preset threshold; the target indicator includes the first indicator and / or the second indicator; A forwarding unit is used to forward a portion of the service traffic to a new container instance corresponding to the target downstream container instance if it is determined that the target indicator exceeds the corresponding preset threshold, wherein the new container instance is a container instance newly created and preheated for the target downstream container instance.

11. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that The method comprises computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN116414524A

  • Cold start optimization method, system and equipment for non-inductive framework of server and medium

    CN117931316A

  • Server-free resource scaling system, method, equipment and medium

    CN118331723A

  • Serverless call distribution to implement spillover while avoiding cold starts

    US20210157645A1

  • Proactively accomodating predicted future serverless workloads using a machine learning prediction model and a feedback control system

    US20210184941A1