Method and device for realizing elastic processing and method for realizing elastic preprocessing

By analyzing the access logs in the service processing link, determining the degree of correlation between the request and the application, and performing parallel elastic processing, the problem of low request processing efficiency in multiple application scenarios is solved, and more efficient service request processing is achieved.

CN113296901BActive Publication Date: 2025-02-18ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010255090.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-02
Publication Date
2025-02-18
Estimated Expiration
2040-04-02

AI Technical Summary

Technical Problem

In multiple application scenarios, it is difficult for the prior art to effectively carry out elastic processing of requests, resulting in reduced service request processing efficiency and inability to meet business needs.

Method used

By obtaining the access logs in the service processing link, determine the degree of correlation between the request and the application, and when elastic processing is required, expand or reduce the capacity of applications with high correlation.

Benefits of technology

It realizes parallel elastic processing of multiple application scenarios, improves the processing efficiency of service requests, and can better meet the needs of service requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113296901B_ABST
    Figure CN113296901B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for realizing elastic processing and a method for realizing elastic preprocessing. When expansion is needed, the application with high correlation is expanded at the same time according to the correlation between the request and the application. The processing efficiency of the business request is improved, thereby meeting the business request requirements well.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to computer network technology, and in particular to a method and device for implementing elastic processing and a method for implementing elastic preprocessing. Background Art

[0002] In a specific business scenario, each request may pass through multiple applications to be completed. Connecting the multiple applications that each request passes through in the order of the requests should form a directed acyclic graph (DAG). This DAG is the full link of the request. In this link, each application is called a node. The first application passed through can be called the root node, and the other applications in the link can be called leaf nodes.

[0003] At present, the serverless of business is still focused on the single application level. For example, Knative, kubeless, etc. are all serverless orchestrations at the single application level, that is, they are elastic (expansion or reduction) methods for single applications. Among them, the latest definition of serverless is described as follows: "Serverless architecture is an Internet-based system. Application development does not use conventional service processes, but only relies on a combination of third-party services, client logic and service-hosted remote procedure calls. Serverless orchestration means that the serverless processing of applications has the characteristics of on-demand use and pay-as-you-go (also known as elasticity), and there must be business-based serverless strategies (such as traffic or events, etc.), and closed grayscale capabilities. For example, business traffic can be split based on traffic percentage, and then the split traffic is sent to different grayscale versions, and each grayscale version can be elastically scaled according to real-time traffic.

[0004] For a business, it is often not completed by just one application, and generally requires the support of multiple applications. In scenarios where multiple applications support the business, scaling one application often means that other dependent applications also need to be scaled up. Business-based serverless still focuses on the single application level. When multiple applications that pass through the request need to be elastically processed, they can only be expanded or reduced one by one. This serial elastic processing method will undoubtedly reduce the processing efficiency of business requests, and thus cannot meet the needs of business requests. Summary of the invention

[0005] The present application provides a method and device for implementing elastic processing and a method for implementing elastic preprocessing, which can meet business request requirements.

[0006] An embodiment of the present invention provides a method for implementing elastic processing, including:

[0007] Obtain access logs requested in the business processing link;

[0008] For different requests, determine the relevance of the request to the application based on the obtained access logs;

[0009] When flexible processing is required, flexible processing is performed on applications that are highly relevant to the current request according to the determined relevance between the request and the application.

[0010] In an exemplary embodiment, determining the relevance between the request and the application respectively according to the obtained access logs includes:

[0011] Count the number of requests received and output by the application within a preset time period based on the obtained access logs;

[0012] For each received request, the probability of the received request and each output request appearing simultaneously within the preset time period is calculated, and the probability represents the degree of correlation between the output request and the called application.

[0013] In an exemplary embodiment, the elastic processing of the application with a high degree of relevance to the current request according to the determined degree of relevance between the request and the application includes:

[0014] Pre-set relevance threshold and flexible processing range;

[0015] When elastic processing is required, within the elastic processing range, parallel elastic processing is performed on applications whose relevance to the current request is higher than a relevance threshold.

[0016] In an exemplary embodiment, the elastic processing includes: capacity expansion and / or capacity reduction.

[0017] In an exemplary embodiment, the elastic processing scope includes: the entire link through which the request passes, or the partial link through which the request passes, or the application in the link that has a significant impact on the duration of the elastic processing.

[0018] In an exemplary embodiment, the link is a continuous link or a non-continuous link.

[0019] In an exemplary embodiment, the method further comprises:

[0020] The proportion of elastic processing for applications is determined based on the proportion of requests received and output by each application in the link.

[0021] In an exemplary embodiment, determining the proportion of elastic processing for the application includes:

[0022] Based on the probability of association between different applications calculated from historical data, determine the applications that need to be expanded or reduced, the applications that should not be expanded or reduced, and the number of instances to be expanded or reduced for the applications that need to be expanded or reduced;

[0023] The application that needs to be expanded or reduced is expanded or reduced in capacity according to the number of instances.

[0024] The present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned methods for implementing elastic processing.

[0025] The present application further provides a device for implementing elastic processing, including a memory and a processor, wherein the memory stores the following instructions executable by the processor: for executing the steps of any of the above-mentioned methods for implementing elastic processing.

[0026] The present application also provides a method for implementing elastic preprocessing, including:

[0027] Obtain access logs requested in the business processing link;

[0028] For different requests, determine the relevance of the request to the application based on the obtained access logs;

[0029] According to the determined relevance between the request and the application, an application with a high relevance to the current request is regarded as an application that needs to be flexibly processed.

[0030] In an exemplary embodiment, determining the relevance between the request and the application respectively according to the obtained access logs includes:

[0031] Count the number of requests received and output by the application within a preset time period based on the obtained access logs;

[0032] For each received request, the probability of the received request and each output request appearing simultaneously within the preset time period is calculated, and the probability represents the degree of correlation between the output request and the called application.

[0033] In an exemplary embodiment, the method further comprises:

[0034] The proportion of the elastic processing to be performed on the application is determined according to the proportion of the requests received and the requests output by each application in the link.

[0035] In an exemplary embodiment, determining the proportion of elastic processing for the application includes:

[0036] Based on the probability of association between different applications calculated from historical data, determine the applications that need to be expanded or reduced, the applications that should not be expanded or reduced, and the number of instances to be expanded or reduced for the applications that need to be expanded or reduced.

[0037] When capacity expansion is required, the embodiment of the present application simultaneously expands the capacity of the applications with high degree of correlation according to the degree of correlation between the request and the application, thereby improving the processing efficiency of the service request and thus meeting the service request requirements well.

[0038] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0040] Figure 1 A flowchart of a method for implementing elastic processing for this application;

[0041] Figure 2 A schematic diagram of an embodiment of a request of the present application being processed by multiple applications;

[0042] Figure 3 A schematic diagram of a comparative embodiment of realizing capacity expansion by the present application and realizing capacity expansion by adopting related technologies. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

[0044] In a typical configuration of the present application, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory.

[0045] 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.

[0046] 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 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 non-transitory media such as modulated data signals and carrier waves.

[0047] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.

[0048] Figure 1 A flowchart of a method for implementing elastic processing for this application is shown in FIG. Figure 1 As shown, including:

[0049] Step 100: Obtain access logs requested in the business processing link.

[0050] In an exemplary embodiment, taking the process of Knative user container as an example, all requests are forwarded through the query proxy (Queue-Proxy), so the access logs of all requests in the business processing link will be recorded in the Queue-Proxy. In other words, the access logs of requests in the business processing link can be collected and obtained through the Queue-Proxy.

[0051] Among them, Knative is a Kubernetes-based platform for building, deploying and managing modern serverless applications. Kubernetes originated from Greek, which means "helmsman" or "navigator", and is the root of "manager" and "control theory". Kubernetes is an open source containerized application for managing multiple hosts in a cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and powerful. Kubernetes provides a mechanism for application deployment, planning, updating and maintenance. Kubeless is a serverless framework based on Kubernetes that allows the deployment of small amounts of code without worrying about the underlying infrastructure pipeline.

[0052] It should be noted that the access logs requested in the business processing link can be obtained through the component that stores the access logs. For example, the same is true for the ServiceMesh solution that replaces the Queue-Proxy component with Istio's Envoy. Among them, Istio is a service mesh framework jointly open sourced by Google, IBM, Lyft, etc.

[0053] In an exemplary embodiment, the access log includes at least: the time when a certain application receives a request (ie, the request start time) and the end time, the request identifier, etc.

[0054] In an exemplary embodiment, the access log may also include: the startup time of the application instance, the CPU usage, memory usage, disk input and output (IO), the number of requests processed per second (RPS), and the response time (RT) of each application instance.

[0055] In an exemplary embodiment, if the user's application has enabled the call chain function, that is, predictions can be made based on the call chain data, then the access log may also include: trend predictions based on historical data, etc.

[0056] In an exemplary embodiment, in the Istio mode, it may also include: the data of the received request and the data of the issued request, to which application the issued request is sent, etc.

[0057] Step 101: for different requests, determine the relevance between the request and the application according to the obtained access logs.

[0058] Each request may go through multiple applications to complete, such as Figure 2As shown, the access log obtained includes request 1 flowing into application B. In some cases (such as satisfying certain query conditions), application C will continue to be called, that is, request 2-1 flowing into application C will be included in the access log obtained, and then application F will be called, that is, request 3 flowing into application F will be included in the access log obtained; in some cases (such as satisfying other query conditions), application C will continue to be called, that is, request 2-2 flowing into application E will be included in the access log obtained. In an exemplary embodiment, step 101 is to find out the application that the request may pass through, and by analyzing the access log, calculate the correlation between the request and each application, such as the probability of request accessing the application.

[0059] In an exemplary embodiment, step 101 may include:

[0060] Count the number of requests received and output by an application within a preset time period based on the obtained access logs;

[0061] For each received request, the probability that the received request and each output request appear simultaneously within the preset time period is calculated.

[0062] The calculated probability reflects the correlation between the output request and the called application, that is, the probability that the second application is called by the first application, wherein the second application is the application into which the output request flows, and the first application is the application into which the received request flows.

[0063] Still Figure 2 For example, suppose that for application B, according to the obtained access log, we know that the request flowing into application B is request 1, and the requests flowing out of application B are request 2-1 and request 2-1; and, according to the obtained access log, we know that the request flowing into application C is request 2-1, and the request flowing into application E is request 2-2. Moreover, according to the source IP address of the request, we can also determine that request 2-1 and request 2-2 come from application B. Then, assuming that within a preset time period, request 1 includes 1000 times and request 2-1 includes 500 times, then it is easy to calculate that the correlation between application C and request 2-1 is 50%; assuming that within a preset time period, request 1 includes 1000 times and request 2-2 includes 200 times, then it is easy to calculate that the correlation between application E and request 2-2 is 20%. By analogy, the correlation between each application and the received request can be calculated, and the possibility of association between each request and each application during the request processing process can be constructed. For example, the following can be obtained: Figure 2 In the relationship shown, request 2-2 is represented by a dotted line for illustration only. According to the calculation results, the correlation between the initiated request 1 and application E is not as high as that between the initiated request 1 and application C.

[0064] In an exemplary embodiment, the correlation between the determined request and each application through which the request passes can be stored in a corresponding relationship for subsequent search and use.

[0065] Step 102: When flexible processing is required, flexible processing is performed on the application with a high degree of relevance to the current request according to the determined degree of relevance between the request and the application.

[0066] In an exemplary embodiment, this step may specifically include:

[0067] Pre-set relevance threshold and flexible processing range;

[0068] When elastic processing is required, within the elastic processing range, parallel elastic processing is performed on applications whose relevance to the current request is higher than a relevance threshold.

[0069] In an exemplary embodiment, the relevance threshold can be set according to different application scenarios. For example, for daily environments, the relevance threshold can be set higher to save computing resources as much as possible; for online environments, the relevance threshold can be set lower to ensure that online services run quickly; for time-sensitive services, the relevance threshold can be set lower; and for offline services, the relevance threshold can be set higher.

[0070] In an exemplary embodiment, the elastic processing scope may include, but is not limited to: the entire link that the request passes through, or the partial link that the request passes through, or an application in the link that has a significant impact on the duration of the elastic processing.

[0071] In an exemplary embodiment, the link may be a continuous link or a non-continuous link.

[0072] In an exemplary embodiment, for a business, in order to ensure that the entire link of a request is smooth and elastic, full-link elastic processing is required, that is, when the root node in the dag needs to be expanded, all leaf nodes should also be expanded. The elastic processing method of the present application may also include:

[0073] The ratio of elastic processing such as expansion and / or reduction for different applications is determined according to the ratio of inbound and outbound requests of each application in the link, that is, the ratio of received requests to output requests.

[0074] In an exemplary embodiment, determining the proportion of elastic processing such as expansion and / or reduction for different applications according to the proportion of inbound and outbound requests of each application in the link may include:

[0075] According to the probability of association between different applications calculated from historical data, determine the applications that need to be expanded or reduced, the applications that do not need to be expanded or reduced, and the number of instances of expansion or reduction of applications that need to be expanded or reduced; expand or reduce the applications that need to be expanded or reduced according to the number of instances. For example: expand the applications with a correlation probability greater than 10; another example: divide the correlation probability value by 10 and round up to an integer as the multiple of expansion or reduction, and then multiply this multiple by the number of applications that need to be expanded or reduced as the number of other associated applications that need to be expanded or reduced, and so on.

[0076] For example, when the number of requests increases or decreases, the probability distribution of requests between applications is calculated to evaluate: the number of instances to expand or shrink for different applications, decide which applications to expand or shrink, which applications not to process, etc., determine which applications may experience traffic peaks based on historical trends, etc.; determine which applications to perform early expansion operations based on the startup time of the applications, etc.

[0077] In an exemplary embodiment, it is determined which applications may experience a traffic peak based on historical trends, including: predicting the trend of the current number of instances based on the historical trend of the number of instances of the current application. Here, the prediction algorithms that can be used may include but are not limited to: for example, using yesterday's trend of the number of instances as today's trend; for another example, using the average of the historical trend of the number of instances in the past three days as today's trend; for another example, taking into account holidays, assuming that today is Saturday, then following the average of the trend of the number of instances in the past three Saturdays as the trend of today's Saturday; for another example, the number of instances in the next 5 minutes or 10 minutes can be estimated using a linear regression method based on the trend of the number of instances in the recent period (such as 30 minutes), thereby predicting how many instances need to be expanded or reduced, and thus predicting the traffic peak in advance. It should be noted that there are many algorithms based on probability and combing statistics that can be used to predict the situation in the future based on historical data. After predicting that an application needs to be expanded or reduced, other related applications can be predicted to be expanded or reduced based on the probability of the associated applications.

[0078] In an exemplary embodiment, based on the startup time of the application, it is determined which applications to perform the early expansion operation on, including: the time it takes for the application to trigger the expansion until the expanded instance can provide services. As described above, historical data can be used to predict a period of time in the future. Assuming that it is predicted at 13:10 that the number of instances at 13:20 needs to be increased by 50, and the startup time of the application is 2 minutes, then the expansion can be triggered before 12:18 to ensure that there are enough ready instances to provide services at 13:20.

[0079] The method for implementing elastic processing provided in the present application converts the elastic processing of applications in the link into parallel processing, which reduces the time consumption of sequential application startup as a whole, improves the processing efficiency of business requests, and thus satisfies business request requirements well.

[0080] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above methods for implementing elastic processing.

[0081] The present application further provides a device for implementing elastic processing, including a memory and a processor, wherein the memory stores the following instructions executable by the processor: for executing the steps of any of the above methods for implementing elastic processing.

[0082] The present application also provides a method for implementing elastic preprocessing, comprising:

[0083] Obtain access logs requested in the business processing link;

[0084] For different requests, determine the relevance of the request to the application based on the obtained access logs;

[0085] According to the determined relevance between the request and the application, an application with a high relevance to the current request is regarded as an application that needs to be flexibly processed.

[0086] The following is a comparison of the advantages of elastic processing achieved by this application through actual examples. Figure 3 FIG. 1 is a schematic diagram of a comparative embodiment of realizing capacity expansion by the present application and realizing capacity expansion by using related technologies. In this embodiment, it is assumed that there are three applications ( Figure 3 Application 1, Application 2, and Application 3 in the example need to be expanded, and assuming that the resource application + application startup time of each application is 1 second, if the elastic processing mode of the relevant technology is adopted, when expansion is needed, the serial expansion of one application after another will be carried out. In this way, when a traffic peak comes, it will trigger the expansion of the three applications, namely Application 1, Application 2, and Application 3. Assuming that the calling relationship of the three applications is Application 1->Application 2->Application 3, Figure 3 As shown in the upper part, therefore, the order of expansion is to expand application 1 first, then expand the called application 2, and finally expand the called application 3. In this embodiment, the elastic processing mode of the relevant technology is adopted, and it takes at least 3 seconds to complete the expansion of the three applications.

[0087] If the elastic processing method of the present application is adopted, then when capacity expansion is required, according to the relevance between the request and the application, it is determined that application 1, application 2, and application 3 are applications with a high degree of relevance to the current request. Figure 3As shown in the lower part, the capacity of the three determined applications, namely application 1, application 2 and application 3, will be expanded in parallel. In other words, the capacity expansion of highly related applications can be completed in 1 second. Compared with the expansion achieved by using related technologies, 2 seconds (66.66%) of time is saved. If there are 10 applications, 9 seconds (90%) of time can be saved. The processing efficiency of business requests is improved, thereby meeting the business request needs well.

[0088] like Figure 3 In the example shown, if the resource application + application startup time for each new application instance takes 3 seconds, then the time saved is 6 seconds. The longer the application startup time, the greater the advantage of elastic processing achieved by this application, that is, the processing efficiency of business requests is greatly improved, thereby better meeting business request needs.

[0089] Although the embodiments disclosed in this application are as above, the contents described are only embodiments adopted to facilitate understanding of this application and are not intended to limit this application. Any technician in the field to which this application belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be based on the scope defined in the attached claims.

Claims

1. A method for implementing elastic processing, comprising: Obtain access logs requested in the business processing link; For different requests, the relevance between the request and the application is determined according to the obtained access logs, wherein the relevance between the request and the application is represented by the probability that the request received by the application and each output request appear simultaneously within a preset time period; When elastic processing is required, elastic processing is performed on applications whose relevance to the current request is higher than a relevance threshold according to the determined relevance between the request and the application, and the elastic processing includes: expansion and / or reduction.

2. The method according to claim 1, wherein: Determining the relevance between the request and the application according to the obtained access logs includes: Count the number of requests received and output by the application within a preset time period based on the obtained access logs; For each received request, the probability of the received request and each output request appearing simultaneously within the preset time period is calculated, and the probability represents the degree of correlation between the output request and the called application.

3. The method according to claim 2, wherein: The step of flexibly processing the application with a high degree of relevance to the current request according to the determined degree of relevance between the request and the application includes: Pre-set relevance threshold and flexible processing range; When elastic processing is required, within the elastic processing range, parallel elastic processing is performed on applications whose relevance to the current request is higher than a relevance threshold.

4. The method according to claim 3, wherein: The elastic processing scope includes: the entire link through which the request passes, or a partial link through which the request passes, or an application in a link that has a significant impact on the duration of the elastic processing.

5. The method according to claim 4, wherein: The link is a continuous link or a discontinuous link.

6. The method according to claim 2, further comprising: The proportion of elastic processing for applications is determined based on the proportion of requests received and output by each application in the link.

7. The method according to claim 6, wherein: The determining of the proportion of elastic processing for the application includes: Based on the probability of association between different applications calculated from historical data, determine the applications that need to be expanded or reduced, the applications that should not be expanded or reduced, and the number of instances to be expanded or reduced for the applications that need to be expanded or reduced; The application that needs to be expanded or reduced is expanded or reduced in capacity according to the number of instances.

8. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method for implementing elastic processing as described in any one of claims 1 to claim 7.

9. A device for implementing elastic processing, comprising a memory and a processor, wherein: The memory stores the following instructions executable by the processor: used to execute the steps of the method for implementing elastic processing as described in any one of claims 1 to claim 7.

10. A method for implementing elastic preprocessing, comprising: Obtain access logs requested in the business processing link; For different requests, the relevance between the request and the application is determined according to the obtained access logs, wherein the relevance between the request and the application is represented by the probability that the request received by the application and each output request appear simultaneously within a preset time period; According to the determined relevance between the request and the application, an application whose relevance to the current request is higher than a relevance threshold is regarded as an application requiring elastic processing, wherein the elastic processing includes: expansion and / or reduction.

11. The method according to claim 10, wherein: Determining the relevance between the request and the application according to the obtained access logs includes: Count the number of requests received and output by the application within a preset time period based on the obtained access logs; For each received request, the probability of the received request and each output request appearing simultaneously within the preset time period is calculated, and the probability represents the degree of correlation between the output request and the called application.

12. The method according to claim 11, further comprising: The proportion of the elastic processing to be performed on the application is determined according to the proportion of the requests received and the requests output by each application in the link.

13. The method according to claim 12, wherein: Determine the proportion of elasticity processing for the application, including: Based on the probability of association between different applications calculated from historical data, determine the applications that need to be expanded or reduced, the applications that should not be expanded or reduced, and the number of instances to be expanded or reduced for the applications that need to be expanded or reduced.

Citation Information

Patent Citations

  • Cloud platform scheduling method and system

    CN103023969A

  • Software performance testing method and device

    CN106095688A