Application expansion method, device, equipment and storage medium

By acquiring expansion configuration information and data tracking methods, the access topology and expansion multiple are determined, solving the problem of low automation in application expansion in existing technologies. This enables more efficient expansion and contraction operations, improving the automation and accuracy of expansion.

CN119759456BActive Publication Date: 2026-04-21SINA TECH (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing application scaling solutions have low automation, cannot effectively assess the objects and quantities to be scaled, cannot scale up as a whole, are complex to operate and prone to errors, have poor maintainability, and cannot perform batch modifications and operations.

Method used

By acquiring expansion configuration information, recording access requests based on data point recording, determining the access topology and expansion multiple, using expansion mapping relationships to perform automated expansion, generating expansion rules, and executing expansion or reduction operations when conditions are met.

Benefits of technology

It enables more efficient application scaling, improves automation, accurately assesses scaling targets, avoids traffic bottlenecks and misoperations, and simplifies the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759456B_ABST
    Figure CN119759456B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and storage medium for expanding the capacity of an application. The method includes: acquiring expansion configuration information of the application; recording multiple access requests to multiple destination applications based on a data logging method to obtain multiple logging logs; determining the access topology between each source application and at least one destination application based on the multiple logging logs; the access topology representing the path and number of accesses from the source application to the at least one destination application; determining the expansion multiple for each source application and the at least one destination application corresponding to each source application based on the access topology corresponding to each source application and a preset expansion mapping relationship; and expanding the capacity of each source application and the at least one destination application corresponding to each source application based on the expansion conditions and the expansion multiple. This application enables effective expansion of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for expanding the capacity of an application program. Background Technology

[0002] Application scaling typically refers to increasing the number of application instances to handle higher loads or requests. Scaling up an application can improve availability, ensuring it remains available under high traffic; and enhance performance by increasing application responsiveness through the addition of instances.

[0003] However, with the development of applications and the increasingly complex relationships between them, how to effectively scale up remains a pressing issue. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for expanding the capacity of an application, so as to achieve more efficient capacity expansion.

[0005] The technical solution of this application is implemented as follows:

[0006] This application provides a method for scaling up an application. The method includes: obtaining scaling up configuration information for the application; the scaling up configuration information is used to indicate data logging methods and scaling up conditions; based on the data logging methods, logging is performed on multiple access requests for multiple target applications to obtain multiple logging logs; each access request corresponds to a logging log, and the logging log is used to record the number of times the target application is accessed and the source application accessing the target application; based on the multiple logging logs, determining the access topology structure between each source application and at least one target application; the access topology structure is used to represent the path and number of times the source application accesses at least one target application; each source application corresponds to one access topology structure; based on the access topology structure corresponding to each source application and a preset scaling up mapping relationship, determining the scaling up multiple of each source application and at least one target application corresponding to each source application; the scaling up mapping relationship is the mapping relationship between the number of times the source application is accessed or the number of times the target application is accessed and the scaling up multiple; and scaling up each source application and at least one target application corresponding to each source application based on the scaling up conditions and the scaling up multiple.

[0007] In some possible implementations, the access topology between each source application and at least one destination application is determined based on multiple log points, including: determining a ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in the multiple log points; the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application; and the at least one ternary relationship corresponding to each source application is visualized to obtain the access topology.

[0008] In some possible implementations, a ternary relationship between each source application and at least one destination application corresponding to each source application is determined based on preset parameters in multiple logs. This includes: for any source application, determining a first log corresponding to at least one destination application in the multiple logs; for at least one destination application, recording the number of times the preset parameter appears in the first log; the number of times the preset parameter appears represents the number of times the source application accesses at least one destination application; and determining the ternary relationship between the source application and at least one destination application based on the number of times the preset parameter appears.

[0009] In some possible implementations, the scaling factor of each source application and at least one destination application corresponding to each source application is determined based on the access topology corresponding to each source application and the preset scaling mapping relationship. This includes: determining all applications in each access topology by traversing each access topology; and calculating the scaling factor of each application in each access topology based on the access count of the source application and the access count of the destination application in each access topology, as well as the scaling mapping relationship.

[0010] In some possible implementations, the method further includes: calculating the scaling factor of each application in each access topology; determining a scaling ratio between the scaling factor of at least one destination application and the scaling factor of the source application based on the scaling factor of each application in each access topology; and generating a scaling rule corresponding to each access topology based on the scaling ratio.

[0011] In some possible implementations, when generating expansion rules for each access topology, expansion is performed on each source application and at least one destination application corresponding to each source application based on expansion conditions and expansion multiples, including: when each source application meets the expansion conditions, expansion is performed on each source application and at least one destination application according to the expansion rules.

[0012] In some possible implementations, the expansion configuration information also includes shrinkage conditions; the above method further includes: after the application expansion in each access topology is completed, determining whether the source application corresponding to each access topology meets the shrinkage conditions; if the source application corresponding to each access topology meets the shrinkage conditions, restoring the expanded application in each access topology to its state before expansion.

[0013] This application provides an application expansion device, comprising: a configuration module for acquiring application expansion configuration information; the expansion configuration information indicating data logging methods and expansion conditions; a logging module for logging multiple access requests to multiple target applications based on the data logging method, obtaining multiple logging logs; each access request corresponds to a logging log, the logging log recording the number of times the target application is accessed and the source application accessing the target application; a topology calculation module for determining the access topology structure between each source application and at least one target application based on the multiple logging logs; the access topology structure representing the path and number of times the source application accesses at least one target application; each source application corresponding to an access topology structure; a data processing module for determining the expansion multiple of each source application and at least one target application corresponding to each source application based on the access topology structure corresponding to each source application and a preset expansion mapping relationship; the expansion mapping relationship being a mapping relationship between the number of accesses corresponding to the source application or the number of times the target application is accessed and the expansion multiple; and an expansion module for expanding each source application and at least one target application corresponding to each source application based on the expansion conditions and the expansion multiple.

[0014] In some possible implementations, the topology calculation module determines a ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in multiple log points; the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application; and the at least one ternary relationship corresponding to each source application is visualized to obtain the access topology structure.

[0015] In some possible implementations, the topology calculation module is used to, for any source application, determine, from multiple logging logs, a first logging log corresponding to at least one destination application corresponding to the source application; for at least one destination application, record the number of times a preset parameter appears in the first logging log; the number of times the preset parameter appears represents the number of times the source application accesses at least one destination application; and based on the number of times the preset parameter appears, determine a ternary relationship between the source application and at least one destination application.

[0016] In some possible implementations, the data processing module is used to determine all applications in each access topology by traversing each access topology; and to calculate the scaling factor of the applications in each access topology based on the number of accesses corresponding to the source application and the number of accesses corresponding to the destination application in each access topology, as well as the scaling mapping relationship.

[0017] In some possible implementations, the data processing module is further configured to calculate the scaling factor of each application in each access topology; determine the scaling ratio between the scaling factor of at least one destination application and the scaling factor of the source application based on the scaling factor of each application in each access topology; and generate a scaling rule corresponding to each access topology based on the scaling ratio.

[0018] In some possible implementations, when generating expansion rules for each access topology, the expansion module is used to expand each source application and at least one destination application according to the expansion rules, provided that each source application meets the expansion conditions.

[0019] In some possible implementations, the expansion configuration information also includes shrinkage conditions; the above apparatus further includes: a shrinkage module, used to determine whether the source application corresponding to each access topology meets the shrinkage conditions after the application expansion in each access topology is completed; and if the source application corresponding to each access topology meets the shrinkage conditions, to restore the expanded application in each access topology to its state before expansion.

[0020] This application provides an electronic device, including: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the method provided in this application.

[0021] This application provides a computer storage medium storing executable instructions, which are executed by a processor to implement the method provided in this application.

[0022] This application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the method provided in this application.

[0023] This application has the following beneficial effects:

[0024] In this application, the access topology between the source application and at least one destination application is determined based on multiple log points. Based on the access topology, a more reasonable scaling combination and scaling factor can be obtained, the scaling object can be evaluated more accurately, and more effective scaling can be achieved.

[0025] Furthermore, the expansion method provided in this application can complete the overall expansion configuration of the expansion chain without performing complex call management between applications, thus improving the automation level of expansion. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0027] Figure 2 This is an optional flowchart illustrating the application expansion method provided in this application embodiment;

[0028] Figure 3 This is an optional structural diagram of the access topology provided in the embodiments of this application;

[0029] Figure 4 This is an optional flowchart illustrating the application expansion method provided in this application embodiment. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0032] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0034] As applications evolve, more and more applications are deployed on container orchestration engines (such as Kubernetes and K8s) clusters. Service functions are becoming increasingly granular, the number of service deployments is growing, and the relationships between applications are becoming more complex. When faced with sudden increases in traffic requiring scaling, situations arise where it's difficult to know where to start, quantify the impact, and quickly scale up a large number of applications. K8s clusters, an open-source tool for managing containerized applications across multiple hosts in a cloud platform, aims to simplify and expedite the deployment of containerized applications. K8s clusters provide a mechanism for application deployment, planning, updating, and maintenance. Scaling up refers to increasing the data on the currently deployed replicas to meet greater request demands.

[0035] However, current scaling solutions have the following drawbacks: 1. Low automation: They cannot assess the scaling targets and quantities, cannot automatically detect applications that need scaling, and lack effective methods for evaluating statistics; 2. Poor overall integration: They cannot scale across the entire traffic path, easily leading to traffic bottlenecks and affecting overall service quality; 3. Complex operation: They involve multiple clusters and multiple applications, and setting up automatic scaling for each application individually is complex and cumbersome, and prone to omissions and errors; 4. Poor maintainability: They can only be configured individually, lack a unified configuration entry point, and cannot be modified or operated in batches.

[0036] The aforementioned problems prevent current expansion solutions from effectively scaling applications.

[0037] To address the aforementioned issues, this application provides a method for expanding the capacity of an application, thereby achieving more efficient capacity expansion.

[0038] See Figure 1 , Figure 1 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Figure 1 The illustrated electronic device 100 can be a terminal and / or a server. Electronic device 100 includes at least one processor 110, memory 150, at least one network interface 120, and a user interface 130. The various components in electronic device 100 are coupled together via a bus system 140. It is understood that the bus system 140 is used to implement communication between these components. In addition to a data bus, the bus system 140 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 1 The general labeled all buses as Bus System 140.

[0039] The processor 110 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0040] User interface 130 includes one or more output devices 131 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 130 also includes one or more input devices 132, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0041] The memory 150 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 150 may optionally include one or more storage devices physically located away from the processor 110.

[0042] The memory 150 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 150 described in this application embodiment is intended to include any suitable type of memory.

[0043] In some embodiments, memory 150 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0044] Operating system 151 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0045] The network communication module 152 is used to reach other computing devices via one or more (wired or wireless) network interfaces 120, exemplary network interfaces 120 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0046] Presentation module 153 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 131 (e.g., a display screen, a speaker, etc.) associated with user interface 130;

[0047] The input processing module 154 is used to detect and translate one or more user inputs or interactions from one or more input devices 132.

[0048] In some embodiments, the application expansion device provided in this application can be implemented in software. Figure 1 An expansion device 155 for an application stored in memory 150 is shown. The application can be software in the form of programs and plug-ins. The expansion device 155 for the application includes the following software modules: configuration module 1551, dot module 1552, topology calculation module 1553, data processing module 1554, and expansion module 1555.

[0049] These modules are logically structured, and therefore can be combined or further broken down arbitrarily according to their implemented functions. The functions of each module will be explained below.

[0050] In other embodiments, the application expansion device provided in this application embodiment can be implemented in hardware. As an example, the device provided in this application embodiment can be a processor in the form of a hardware decoding processor, which is programmed to execute the application expansion method provided in this application embodiment. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0051] The following will describe the application expansion method provided in this application embodiment, in conjunction with exemplary applications and implementations of the electronic devices provided in the embodiments of this application.

[0052] It should be noted that, for ease of description, the application's expansion device will be referred to as the expansion device below.

[0053] See Figure 2 , Figure 2This is an optional flowchart illustrating the application expansion method provided in this application embodiment. The following will be combined with... Figure 2 The steps shown illustrate the application scaling method.

[0054] S201, Obtain the application's expansion configuration information. This expansion configuration information indicates the data logging method and expansion conditions.

[0055] Understandably, before scaling up an application, the expansion device can retrieve the expansion configuration information for that application from the database. This expansion configuration information consists of a series of parameters configured for the expansion.

[0056] In some embodiments, the expansion configuration information can be used to indicate cluster-related parameters, which represent information such as the cluster name, the cluster's application programming interface (API) address, the account used to log in to the cluster, and the password used to log in to the cluster. For example, the cluster-related parameters for cluster A and cluster B can be represented as: cluster: {cluster name: cluster A; API: API address of cluster A; account: account used to log in to cluster A; password: password used to log in to cluster A} {cluster name: cluster B; API: API address of cluster B; account: account used to log in to cluster B; password: password used to log in to cluster B}.

[0057] In some embodiments, the scaling configuration information can be used to indicate the data logging method, which refers to the way monitoring and logging are performed in the application's runtime environment, i.e., the way monitoring data and log information of the cluster are collected. For example, the data logging method can be represented as: longing:[args|header], where "args" are parameter markers (such as HTTP parameters) inserted into the request body for logging, and "args" are used for response processing in each application; "header" are parameter markers (such as HTTP headers) inserted into the request header information for logging, and "header" is used for processing in each response.

[0058] In some embodiments, the expansion configuration information can be used to indicate the data collection method, which represents the method of collecting data points and the location information of the logs collected during the data point collection process; for example, the data collection method can be represented as: collection: [{log name: BMC log, log location: / var / log / bmc / bmc.log, collection method: rsyslog}, {log name: dmesg log, log location: / var / log / dmesg, collection method: filebeat}...].

[0059] In some embodiments, expansion configuration information can be used to indicate expansion and contraction conditions. When an application meets the expansion conditions, it will be expanded; when the expanded application meets the contraction conditions, it will be contracted. In one example, expansion and contraction conditions can be combined. For example, expansion / contraction conditions can be represented as: rule: {period:1min, frequency:3, high:120%, low:110%, gain:150%}, where period represents the observation period for periodic expansion / contraction conditions. When period is 1min, it means that the application's traffic is observed every minute; frequency represents the number of consecutive observations. When frequency is 3, it means that the application is observed every minute for 3 consecutive times. This section describes the application's traffic status. "High" indicates a high water level; a high of 120% means that if the current traffic is 120% higher than the normal level and meets the specified cycle and frequency, automatic scaling up of the application will be triggered. "Low" indicates a low water level; a low of 110% means that if the current traffic is 110% lower than the normal level and meets the specified cycle and frequency, automatic scaling down of the application will be triggered. "Gain" represents the scaling ratio. For example, if the current traffic is twice the normal level and the scaling gain is 150%, then the scaling ratio is 2 × 150% = 3, meaning the application should be scaled up by 3 times.

[0060] In some embodiments, the expansion configuration information can be predefined by the administrator and stored in the configuration module of the expansion device.

[0061] S202, based on data logging, records multiple access requests to multiple target applications, resulting in multiple logging logs. Each access request corresponds to one logging log, which records the number of times the target application is accessed and the source application that accessed the target application.

[0062] Understandably, a source application can initiate one or more access requests when accessing a destination application. When the number of destination applications is M, M destination applications can correspond to N access requests, where N ≥ M. The number of times a destination application is accessed will result in the number of log entries recorded; that is, the number of log entries corresponding to each destination application is equal to the number of access requests corresponding to each destination application.

[0063] In some embodiments, the expansion device can record access requests received by each target application according to the data recording method in the expansion configuration information, and collect information related to the access requests. In one example, taking a recording sampling ratio of 1% and using the args parameter method, when application 2 receives an access request from application 1 (i.e., APP1), and then application 2 (i.e., APP2) needs to access application 3 (i.e., APP3), the recording of application 3 can be represented as start = APP1 & forward = APP2 & t = APP3. In another example, taking a recording sampling ratio of 1% and using the header parameter method, the recording of application 3 can be represented as: start: APP1 forward: APP2 current: APP3.

[0064] It should be noted that downstream applications record event logs. In the example above, application 3 is a downstream application of application 2 and application 1. Application 3 records event records accessed by application 2 and application 1. Event tracking quantifies the request situation on the access chain.

[0065] S203, based on multiple log points, determine the access topology between each source application and at least one destination application. The access topology represents the path and number of times a source application accesses at least one destination application; each source application corresponds to one access topology.

[0066] Understandably, a source application can access at least one destination application, and a source application and at least one destination application can form an access topology. Multiple source applications and their corresponding destination applications can each form multiple access topologies. It should be noted that an access topology can include more than just source and destination applications. Since the initial access request originates from a user, and the user's downstream application is the source application, the same user can correspond to multiple downstream source applications. Each of these downstream source applications has a corresponding destination application. Therefore, multiple access topologies can be formed based on multiple access requests initiated by a user to multiple source applications.

[0067] In some possible implementations, S203 may include: determining a ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in the plurality of log entries. The ternary relationship is used to characterize the number of times a source application accesses its corresponding destination application; and visualizing the at least one ternary relationship corresponding to each source application to obtain the access topology.

[0068] Understandably, by analyzing the logging data and extracting preset parameters, we can determine the relay applications (i.e., the paths the source application takes to each destination application) and the number of times the source application accesses each destination application, based on these parameters. Then, based on these paths and access counts, we can determine the ternary relationships between the source application and each destination application. Visualizing these ternary relationships using visualization tools reveals the access topology between the source application and multiple destination applications.

[0069] In some embodiments, the ternary relation can be represented as: [Original Application, Source Application, Destination Application, Statistics], where Statistics = sum(preset parameter), and Statistics represents the number of access requests received by the application. Figure 3 This is an optional structural diagram of the access topology provided in the embodiments of this application. See also... Figure 3 As shown, the access topology includes 11 links (i.e., L1 to L11). The source applications are APP0 and APP1. The ternary relationship based on APP0 and APP1 is as follows: {[APP1, user, APP1, n], [APP1, APP1, APP2, 2n], [APP1, APP1, APP3, 4n], [APP1, APP2, APP4, 6n], [APP1, APP3, APP4, 8n], [APP1, APP3, APP5, 4n], [APP0, user, APP0, 2m], [APP0, APP0, APP3, 2m], [APP0, APP0, APP5, 2m], [APP0, APP3, APP4, 4m], [APP0, APP3, APP5, 2m]}. Where n represents the cardinality of the number of access requests based on APP1, that is, the number of access requests corresponding to the intended application level of APP1 is a multiple of n; m represents the cardinality of the number of access requests based on APP0, that is, the number of access requests corresponding to the intended application level of APP0 is a multiple of m. Based on visualization tools, a ternary relationship between APP0 and APP1 can be constructed as follows: Figure 3 The access topology.

[0070] In some embodiments, the visualization tool used to visualize multiple ternary relationships corresponding to the source application can be Gephi, or other visualization tools can be selected according to actual needs. This application embodiment does not specifically limit this.

[0071] In some embodiments, the preset parameter can be the forecast field, or other fields can be selected according to actual needs. This application embodiment does not make specific limitations in this regard.

[0072] In some possible implementations, the above-described determination of the ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in multiple logs includes: for any source application, determining a first log corresponding to at least one destination application in the multiple logs; for at least one destination application, recording the number of times the preset parameter appears in the first log; the number of times the preset parameter appears represents the number of times the source application accesses at least one destination application; and determining the ternary relationship between the source application and at least one destination application based on the number of times the preset parameter appears.

[0073] Understandably, the frequency of the preset parameter in the log is a statistic in the ternary relation, representing the number of times the source application accesses the destination application. Based on the frequency of the preset parameter in the log, the source application, and the destination application, the ternary relation between the source application and the destination application can be determined. Specifically, there is a ternary relation between the source application and each destination application; for example, see [link to relevant documentation]. Figure 3 As shown, APP0 is the source application, corresponding to multiple destination applications. The ternary relationships between APP0 and the multiple destination applications include: [APP0, APP0, APP3, 2m], [APP0, APP0, APP5, 2m], [APP0, APP3, APP4, 4m], [APP0, APP3, APP5, 2m].

[0074] In some embodiments, see Figure 3 As shown, the access topology divides the application into multiple links, with APP0 and APP1 as the starting points of the links. Figure 3 The CCP includes 5 links, namely: [Link 1: APP1: APP2: APP4 = 1n: 2n: 6n]; [Link 2: APP1: APP3: APP4 = 1n: 4n: 8n]; [Link 3: APP0: APP3: APP4 = 2m: 2m: 4m]; [Link 4: APP0: APP3: APP5 = 2m: 2m: 2m]; [Link 5: APP0: APP5 = 2m: 2m].

[0075] In some embodiments, see Figure 3As shown, when an application in the access topology is used as a destination application or a relay application, the upstream may include more than one application. Therefore, the total statistics of each application can be calculated based on the access topology. Figure 3 The total statistics of the applications in the access topology shown can be represented as: [APP0: 2m, APP1: 1n, APP2: 2n, APP3: 4n+2m, APP4: 14n+4m, APP5: 4m+4n], that is, the total statistics of APP0 is 2m, the total statistics of APP1 is 1n, the total statistics of APP2 is 2n, the total statistics of APP3 is 4n+2m, the total statistics of APP4 is 14n+4m, and the total statistics of APP5 is 4m+4n.

[0076] S204, based on the access topology corresponding to each source application and the preset expansion mapping relationship, determine the expansion multiple of each source application and at least one destination application corresponding to each source application. The expansion mapping relationship is the mapping relationship between the number of accesses to the source application or the number of accesses to the destination application and the expansion multiple.

[0077] Understandably, taking an access topology as an example, based on a preset expansion mapping relationship, the expansion multiple of the source application and the expansion multiple of at least one destination application corresponding to the source application can be calculated; the calculation method for the expansion multiple of applications in other access topologies is the same as the above method.

[0078] In some embodiments, the access topology may include multiple links, see [link to relevant documentation]. Figure 3 As shown, with APP0 as the source application and APP5 as the destination application, there are two links, namely [Link 5: APP0: APP5]. = [2m∶2m] and [Link 4: APP0∶APP3∶APP5] = [2m∶2m∶2m]. In the above link 4, in addition to the source application and the destination application, it also includes a relay application (i.e., APP3). Link 5 only includes the source application and the destination application. Therefore, the applications accessing the topology include not only the source application and multiple destination applications, but also the relay applications between the source application and the destination application.

[0079] In some possible implementations, S204 may include: determining the application in each access topology by traversing each access topology; and calculating the expansion factor of the application in each access topology based on the number of accesses corresponding to the source application and the number of accesses corresponding to the destination application in each access topology, as well as the expansion mapping relationship.

[0080] Understandably, the expansion device can traverse the access topology to determine the source application, the relay application, and the destination application (i.e., determine all applications in the access topology), and calculate the expansion multiple for each application based on a preset expansion mapping relationship.

[0081] In some embodiments, the application scenario of the expansion mapping relationship is: when the expansion factor of the source application is 1, the multiple downstream applications corresponding to the source application should be expanded to a certain multiple of the expansion factor of the source application.

[0082] In some embodiments, the expression (1) for the expansion mapping relationship is as follows:

[0083]

[0084] In the formula, Q is the scaling factor corresponding to application x, and weight x C represents the statistics from the source application to application x. x This represents the total statistics for application x.

[0085] In some possible implementations, after obtaining the expansion factor of at least one application in the access topology, the above application expansion method may further include: calculating the expansion factor of each application in the access topology; determining the expansion ratio between the expansion factor of each application and the expansion factor of the source application based on the expansion factor of each application in the access topology; and generating expansion rules corresponding to the access topology based on the expansion ratio.

[0086] Understandably, one source application corresponds to one scaling rule; see [link / reference]. Figure 3 As shown, the access topology includes two source applications, APP0 and APP1. Therefore, Figure 3 The access topology shown corresponds to two expansion rules.

[0087] See one example. Figure 3As shown, taking APP0 as the source application, the expansion rules for APP0 and the corresponding destination application can be expressed as: R0: [APP0: 2m / 2m, APP3: 2m / (4n+2m), APP5: 4m / (4m+4n)] = [APP0: 1, APP3: m / (2n+m), APP5: m / (m+n)], where R0 represents the expansion rule corresponding to the source application APP0. The above expansion rule R0 means that when the expansion factor of APP0 is 1, the expansion factor of APP3 is m / (2n+m), and the expansion factor of APP5 is m / (m+n).

[0088] S205, based on the expansion conditions and expansion multiple, expand the capacity of each source application and at least one destination application corresponding to each source application.

[0089] Understandably, once the scaling factor of the applications in the access topology is determined, and the source applications corresponding to the access topology meet the scaling conditions, each application in the access topology can be scaled up to the corresponding scaling factor.

[0090] In some possible implementations, when expansion rules are determined, S205 may include: expanding the capacity of each source application and at least one application corresponding to each source application in accordance with the expansion rules, provided that each source application meets the expansion conditions.

[0091] Understandably, after generating expansion rules, and provided that the source application meets the expansion conditions, the applications in the access topology can be expanded according to the expansion rules.

[0092] In some embodiments, the expansion device can sample the application's traffic (i.e., statistics on access counts) to obtain multiple sample values; sort the multiple sample values; and determine a baseline value based on the sorting result. The baseline value corresponding to the application is a statistic used to determine whether the application meets the conditions for expansion or reduction.

[0093] In some embodiments, the expansion device can use the P90 of the sampled value as a benchmark value to determine whether the application meets the expansion conditions. Multiple sampled values ​​are sorted from smallest to largest, and the value at the 90th percentile is the benchmark value.

[0094] See one example. Figure 3The access topology shown is illustrated with n=1, m=2, and the base value of APP0 is 1000 (i.e., APP0[P90]=1000). The current values ​​of APP0 sampled for three consecutive minutes are 1300, 1350 and 1400, respectively. If the change of the current sampled value meets the expansion conditions, the expansion multiple calculation expression (2) is used to calculate how many times APP0 should be expanded to. The expansion multiple calculation expression (2) is as follows:

[0095]

[0096] In the formula, beta is the expansion factor of the x-th APP, gain is the gain in the expansion condition, and APP x [now] represents the current sample value of the x-th APP. x [P90] represents the baseline value of the xth APP.

[0097] Therefore, the expansion factor of APP0 is calculated based on the above expression (2). This means APP0 needs to be expanded by 2.1 times. Simultaneously, all links using APP0 as the source application need to be expanded by 2.1 times the capacity of APP0. Based on the expansion rule R0 and the values ​​of n and m, the expression for calculating the expansion multiples of other applications using APP0 as the source application is as follows: 2.1 × [APP0:1, APP3:m / (2n+m), APP5:m / (m+n)] = [APP0:2.1, APP3:1.05, APP5:1.4], that is, APP0 expands by 2.1 times, APP3 expands by 1.05 times, and APP5 expands by 1.4 times.

[0098] In this embodiment of the application, after calculating the scaling factor corresponding to each application, the K8s API can be used to scale up the applications on the scaling line according to the corresponding factor.

[0099] In some possible implementations, where the expansion configuration information is also used to indicate the shrinkage conditions, the above application expansion method may further include: after the application expansion in each access topology is completed, determining whether the source application corresponding to each access topology meets the shrinkage conditions; if the source application corresponding to each access topology meets the shrinkage conditions, restoring the expanded application in each access topology to its state before expansion.

[0100] Understandably, by sampling the application's logs and analyzing whether the application's current traffic usage (i.e., the number of accesses) meets the scaling-down conditions, the expanded application is then scaled down in reverse.

[0101] In some embodiments, after performing a scaling operation on each application in the access topology, the scaling device can sample the application's traffic (i.e., the statistics of access counts) to obtain multiple sample values; sort the multiple sample values; and determine a baseline value among the multiple sample values ​​based on the sorting result. The baseline value corresponding to the application is a statistic used to determine whether the application meets the scaling up or scaling down conditions.

[0102] See one example. Figure 3 The access topology shown is illustrated with n=1, m=2, and the base value corresponding to APP0 is 1000 (i.e., APP0[P90]=1000). The current values ​​of APP0 sampled for three consecutive minutes are 1000, 1050, and 1060, respectively. Based on the pre-configured shrinkage conditions, the expansion device determines that APP0 meets the shrinkage conditions and performs reverse shrinkage according to the previous expansion multiple, i.e., APP0 shrinks by 2.1 times, APP3 shrinks by 1.05 times, and APP5 shrinks by 1.4 times.

[0103] In this embodiment of the application, the K8s API can also scale down applications on the expansion line by a corresponding multiple.

[0104] In some possible implementations, after executing S202 and before executing S203, the above application expansion method may further include: collecting point data according to the data collection method in the configuration information, and storing the collected data in the database.

[0105] In some possible implementations, after performing the above-described expansion or contraction processes, the expansion method of the application may further include: generating a task report on the expansion processing data and / or contraction processing data, and storing the report in a database. The expansion processing data includes: the execution action (i.e., the expansion action), execution time, the expansion multiplier, and the execution chain, etc. The contraction processing data includes: the execution action (i.e., the contraction action), execution time, the contraction multiplier, and the execution chain, etc.

[0106] Figure 4 This is an optional flowchart illustrating the application expansion method provided in this application embodiment. The following is a detailed explanation of the process. Figure 4 The steps shown are explained.

[0107] S401, the expansion device obtains the expansion configuration information of the application.

[0108] S402, the expansion device records multiple access requests for multiple target applications based on the data logging method in the expansion configuration information.

[0109] S403, the expansion device collects point data based on the data collection method in the expansion configuration information and stores the collected data in the database 41.

[0110] S404, the expansion device obtains the logging data from the database and determines the access topology between each source application and at least one destination application corresponding to each source application based on the logging data (i.e., logging log).

[0111] S405, the expansion device determines the expansion rules of the application in each access topology based on each access topology and the preset expansion mapping relationship, and stores the expansion rules in the database 41.

[0112] S406, the expansion device determines whether the application in the access topology meets the expansion conditions in the expansion configuration information; if it does, then execute S407; if it does not, then execute S410.

[0113] S407, The expansion device performs expansion processing on the application according to the expansion rules.

[0114] S408, the expansion device determines whether the application in the access topology meets the shrinkage conditions in the expansion configuration information. If it does, then execute S409; otherwise, execute S410.

[0115] S409, the expansion device performs the reduction processing of the application according to the reduction rules.

[0116] S410, the expansion device generates a task report on the expansion processing data and / or reduction processing data; and stores the report in the database 41.

[0117] At this point, the expansion device has completed the expansion method for the aforementioned application.

[0118] In this embodiment of the application, the access topology between the source application and at least one destination application is determined based on multiple log points. Based on the access topology, a more reasonable scaling combination and scaling factor can be obtained, the scaling object can be evaluated more accurately, and more effective scaling can be achieved.

[0119] Furthermore, the expansion method provided in this application embodiment can complete the overall expansion configuration of the expansion chain without performing complex call management between applications, thus improving the automation level of expansion.

[0120] Furthermore, by determining the scaling factor of the source application, the scaling factor of the corresponding destination application can be determined, thereby achieving overall scaling of the scaling chain and reducing potential bottleneck risks during the scaling process.

[0121] Furthermore, the expansion method provided in this application embodiment does not require administrators to perform complex dependency analysis and statistical analysis. They only need to specify the expansion threshold percentage and expansion percentage, which reduces the professional quality requirements of operators and greatly reduces the difficulty of expansion operations.

[0122] Furthermore, the scaling method provided in this application embodiment allows administrators to obtain scaling configuration information by performing simple configuration in the configuration center, thereby completing the automatic scaling configuration of multiple applications in multiple clusters, effectively reducing the maintenance cost of scaling rules.

[0123] The following continues to describe an exemplary structure of the application expansion device 155 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 1 As shown, the software modules in the application expansion device 155 stored in the memory 150 may include: a configuration module 1551, used to obtain expansion configuration information of the application; the expansion configuration information is used to indicate the data logging method and expansion conditions; a logging module 1552, used to log multiple access requests for multiple target applications based on the data logging method, and obtain multiple logging logs; each access request corresponds to a logging log, and the logging log is used to record the number of times the target application is accessed and the source application accessing the target application; and a topology calculation module 1553, used to determine the access topology between each source application and at least one target application based on the multiple logging logs. The access topology structure represents the path and number of times a source application accesses at least one destination application; each source application corresponds to one access topology structure; the data processing module 1554 is used to determine the expansion multiple of each source application and at least one destination application corresponding to each source application based on the access topology structure corresponding to each source application and the preset expansion mapping relationship; the expansion mapping relationship is the mapping relationship between the number of accesses corresponding to the source application or the number of accesses corresponding to the destination application and the expansion multiple; the expansion module 1555 is used to expand each source application and at least one destination application corresponding to each source application based on the expansion conditions and the expansion multiple.

[0124] In some possible implementations, the topology calculation module 1553 is used to determine a ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in multiple log points; the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application; and the at least one ternary relationship corresponding to each source application is visualized to obtain the access topology structure.

[0125] In some possible implementations, the topology calculation module 1553 is used to, for any source application, determine, from multiple logging logs, a first logging log corresponding to at least one destination application corresponding to the source application; for at least one destination application, record the number of times a preset parameter appears in the first logging log; the number of times the preset parameter appears represents the number of times the source application accesses at least one destination application; and based on the number of times the preset parameter appears, determine a ternary relationship between the source application and at least one destination application.

[0126] In some possible implementations, the data processing module 1554 is used to determine all applications in each access topology by traversing each access topology; and to calculate the expansion factor of the applications in each access topology based on the number of accesses corresponding to the source application and the number of accesses corresponding to the destination application in each access topology, as well as the expansion mapping relationship.

[0127] In some possible implementations, the data processing module 1554 is further configured to calculate the scaling factor of each application in each access topology; determine the scaling ratio between the scaling factor of at least one destination application and the scaling factor of the source application based on the scaling factor of each application in each access topology; and generate a scaling rule corresponding to each access topology based on the scaling ratio.

[0128] In some possible implementations, when generating expansion rules for each access topology, the expansion module 1555 is used to expand each source application and at least one destination application according to the expansion rules, provided that each source application meets the expansion conditions.

[0129] In some possible implementations, the expansion configuration information also includes shrinkage conditions; the above apparatus further includes: a shrinkage module, used to determine whether the source application corresponding to each access topology meets the shrinkage conditions after the application expansion in each access topology is completed; and if the source application corresponding to each access topology meets the shrinkage conditions, to restore the expanded application in each access topology to its state before expansion.

[0130] This application provides a computer program product or computer program that includes computer instructions stored in a computer storage medium. A processor of a computer device reads the computer instructions from the computer storage medium and executes the computer instructions, causing the computer device to perform the application expansion method described in this application embodiment.

[0131] This application provides a computer storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the application expansion method provided in this application embodiment, for example... Figure 2 The application's expansion method is shown.

[0132] In some embodiments, the computer storage medium may be a memory such as FRAM, ROM, PROM, EEPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0133] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0134] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0135] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0136] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for expanding the capacity of an application, characterized in that, The method includes: Obtain the application's expansion configuration information; the expansion configuration information is used to indicate the data logging method and expansion conditions; Based on the data logging method, multiple access requests to multiple target applications are logged to obtain multiple logging logs; each access request corresponds to a logging log, and the logging log is used to record the number of times the target application is accessed and the source application that accesses the target application. Based on the multiple logging points, an access topology is determined between each source application and at least one destination application; the access topology represents the path and number of times a source application accesses at least one destination application; each source application corresponds to one access topology. Based on the access topology corresponding to each source application and a preset scaling mapping relationship, the scaling factor of each source application and the scaling factor of at least one destination application corresponding to each source application are determined; the scaling factor of each source application is calculated based on the ratio between the sampled value and the baseline value of the current traffic and a preset gain; the scaling factor of at least one destination application corresponding to each source application is calculated based on the scaling factor of the source applications in the access topology corresponding to each source application and the scaling mapping relationship; the scaling mapping relationship is used to represent the scaling ratio of each application in the access topology relative to the source application; and, Based on the expansion conditions and the expansion factor, the capacity of each source application and at least one destination application corresponding to each source application is expanded.

2. The method according to claim 1, characterized in that, The step of determining the access topology from each source application to at least one destination application based on the multiple logging points includes: Based on preset parameters in the multiple log points, a ternary relationship is determined between each source application and at least one destination application corresponding to each source application; the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application. The access topology is obtained by visualizing at least one ternary relationship corresponding to each source application.

3. The method according to claim 2, characterized in that, The step of determining a ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in the multiple log points includes: For any source application, among the plurality of logging logs, determine the first logging log corresponding to at least one destination application that corresponds to the source application; For the at least one target application, record the number of times the preset parameter appears in the first logging log; the number of times the preset parameter appears represents the number of times the source application accesses the at least one target application; Based on the number of times the preset parameters appear, a ternary relationship is determined between the source application and the at least one destination application.

4. The method according to claim 1, characterized in that, The step of determining the scaling factor of each source application and at least one destination application corresponding to each source application based on the access topology corresponding to each source application and the preset scaling mapping relationship includes: By traversing each access topology, all applications in each access topology are identified; Based on the number of accesses to the source application and the number of accesses to the destination application in each access topology, as well as the expansion mapping relationship, the expansion factor of the application in each access topology is calculated; the expansion mapping relationship is the ratio between the statistics from the source application to the destination application in the access topology and the total statistics of the destination application; the statistics are the number of access requests received by the application.

5. The method according to claim 4, characterized in that, The method further includes: Calculate the scaling factor for each application in each access topology; Based on the scaling factor of each application in each access topology, determine the scaling ratio between the scaling factor of the at least one destination application and the scaling factor of the source application; Based on the expansion ratio, expansion rules are generated for each access topology.

6. The method according to claim 5, characterized in that, In generating expansion rules corresponding to each access topology, the expansion of each source application and at least one destination application corresponding to each source application, based on the expansion conditions and the expansion factor, includes: If each source application meets the expansion conditions, the expansion is performed on each source application and the at least one destination application in accordance with the expansion rules.

7. The method according to claim 1, characterized in that, The expansion configuration information is also used to indicate the reduction conditions; The method further includes: After the application scaling in each access topology is completed, it is determined whether the source application corresponding to each access topology meets the scaling down condition. If the source application corresponding to each access topology meets the scaling-down condition, the expanded application in each access topology will be restored to its state before scaling-up.

8. An application expansion device, characterized in that, The device includes: The configuration module is used to obtain the expansion configuration information of the application; the expansion configuration information is used to indicate the data logging method and expansion conditions. The data logging module is used to log multiple access requests to multiple target applications based on the data logging method, and obtain multiple logging logs; each access request corresponds to a logging log, and the logging log is used to record the number of times the target application is accessed and the source application that accesses the target application; The topology calculation module is used to determine the access topology structure between each source application and at least one destination application based on the multiple logging points; the access topology structure is used to represent the path and number of times the source application accesses at least one destination application; each source application corresponds to one access topology structure. The data processing module is used to determine the expansion multiple of each source application and the expansion multiple of at least one destination application corresponding to each source application based on the access topology corresponding to each source application and a preset expansion mapping relationship. The expansion multiple of each source application is calculated based on the ratio between the sampled value and the baseline value of the current traffic and a preset gain. The expansion multiple of at least one destination application corresponding to each source application is calculated based on the expansion multiple of the source applications in the access topology corresponding to each source application and the expansion mapping relationship. The expansion mapping relationship is used to represent the expansion ratio of each application in the access topology relative to the source application. The expansion module is used to expand the capacity of each source application and at least one destination application corresponding to each source application based on the expansion conditions and the expansion factor.

9. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; A processor, when executing executable instructions or computer programs stored in the memory, implements the method of any one of claims 1 to 7.

10. A computer-readable storage medium storing executable instructions or a computer program, characterized in that, When the executable instructions are executed by the processor, they implement the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Dynamic token bucket capacity adjustment method, storage medium and electronic device

    CN115460153A

  • Proactive auto-scaling

    US20230318988A1