Capacity expansion method and device of application program, equipment and storage medium
By obtaining the application's expansion configuration information and recording access requests, determining the access topology between applications and calculating the expansion multiple, the problem of low degree of application expansion automation in the prior art is solved, and a more efficient and automated expansion process is achieved.
Patent Information
- Application Number
- CN202411593988.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-08
AI Technical Summary
The existing technology has low automation when expanding the application capacity, and cannot evaluate the expansion objects and the expansion number, resulting in poor overall traffic links, complex operations and poor maintenance, and inability to achieve effective expansion.
By obtaining the application's expansion configuration information, recording access requests based on data management methods, determining the access topology between the source application and the destination application, and calculating the expansion multiple based on the topology structure and the preset expansion mapping relationship, realizing automatic expansion of the application.
It realizes more efficient application capacity expansion, improves the degree of automation of capacity expansion, can more accurately evaluate the expansion objects and combinations, and reduces operational complexity and maintenance costs.
Smart Images

Figure CN119759456A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for expanding an application program. Background Art
[0002] Application scaling usually refers to increasing the number of application instances to handle higher loads or requests. Scaling applications can improve availability, ensuring that the application remains available under high traffic, and enhance performance, increasing the responsiveness of the application by adding instances.
[0003] However, with the development of applications and the increasingly complex relationships between applications, how to effectively expand capacity remains a problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method, apparatus, device and storage medium for expanding the capacity of an application program to achieve more effective expansion.
[0005] The technical solution of this application is implemented as follows:
[0006] The present application provides a method for expanding an application, the method comprising: obtaining expansion configuration information of the application; the expansion configuration information is used to indicate a data dotting method and expansion conditions; based on the data dotting method, multiple access requests for multiple target applications are dotting and recorded to obtain multiple dotting logs; each access request corresponds to a dotting log, and the dotting log is used to record the number of accesses corresponding to the target application and the source application that accesses the target application; based on the multiple dotting logs, an access topology structure between each source application and at least one target application is determined; the access topology structure is used to represent the path and the number of accesses of the source application to access at least one target application; each source application corresponds to an access topology structure; according to the access topology structure corresponding to each source application and a preset expansion mapping relationship, the expansion multiple of each source application and at least one target application corresponding to each source application is determined; the expansion mapping relationship is a mapping relationship between the number of accesses corresponding to the source application or the number of accesses corresponding to the target application and the expansion multiple; and, based on the expansion condition and the expansion multiple, each source application and at least one target application corresponding to each source application are expanded.
[0007] In some possible implementations, based on multiple dot logs, determining an access topology structure between each source application and at least one destination application, 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 dot logs; the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application; and visualizing at least one ternary relationship corresponding to each source application to obtain an access topology structure.
[0008] In some possible implementations, based on preset parameters in multiple dot logs, a ternary relationship between each source application and at least one destination application corresponding to each source application is determined, including: for any source application, in multiple dot logs, determining a first dot log corresponding to at least one destination application corresponding to the source application; for at least one destination application, recording the number of times the preset parameter appears in the first dot log; the number of times the preset parameter appears indicates the number of times the source application visits the at least one destination application; based on the number of times the preset parameter appears, determining the ternary relationship between the source application and the at least one destination application.
[0009] In some possible implementations, based on the access topology corresponding to each source application and a preset expansion mapping relationship, the expansion multiples of each source application and at least one destination application corresponding to each source application are determined, including: determining all applications in each access topology by traversing each access topology; calculating the expansion multiples of the applications in each access topology based on the number of accesses corresponding to the source applications and the number of visits corresponding to the destination applications in each access topology, as well as the expansion mapping relationship.
[0010] In some possible implementations, the above method also includes: calculating the expansion multiple of each application in each access topology structure; based on the expansion multiple of each application in each access topology structure, determining the expansion ratio between the expansion multiple of at least one destination application and the expansion multiple of the source application; based on the expansion ratio, generating expansion rules corresponding to each access topology structure.
[0011] In some possible implementations, when expansion rules corresponding to each access topology structure are generated, each source application and at least one destination application corresponding to each source application are expanded based on expansion conditions and expansion multiples, including: when each source application meets the expansion conditions, each source application and at least one destination application are expanded according to the expansion rules.
[0012] In some possible implementations, the expansion configuration information also includes a reduction condition; the above method also includes: after the expansion of the application in each access topology structure is completed, determining whether the source application corresponding to each access topology structure meets the reduction condition; when the source application corresponding to each access topology structure meets the reduction condition, restoring the expanded application in each access topology structure to the state before the expansion.
[0013] The present application provides an expansion device for an application, the device comprising: a configuration module, used to obtain expansion configuration information of the application; the expansion configuration information is used to indicate a data dotting method and expansion conditions; a dotting module, used to dotting and recording multiple access requests for multiple target applications based on the data dotting method, to obtain multiple dotting logs; each access request corresponds to a dotting log, and the dotting log is used to record the number of accesses corresponding to the target application and the source application that accesses the target application; a topology calculation module, used to determine an access topology structure between each source application and at least one target application based on the multiple dotting logs; the access topology structure is used to represent the path and the number of accesses of the source application to access at least one target application; each source application corresponds to an access topology structure; a data processing module, used to determine the expansion multiple of each source application and at least one target application corresponding to each source application according to the access topology structure corresponding to each source application and a preset expansion mapping relationship; the expansion mapping relationship is a mapping relationship between the number of accesses corresponding to the source application or the number of accesses corresponding to the target application and the expansion multiple; the expansion module, used to expand 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, a 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 a plurality of dot logs; the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application; and at least one ternary relationship corresponding to each source application is visualized to obtain an access topology structure.
[0015] In some possible implementations, a topology calculation module is used to determine, for any source application, from multiple dot logs, a first dot 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 dot log; the number of times the preset parameter appears indicates the number of times the source application visits the 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 the at least one destination application.
[0016] In some possible implementations, the data processing module is used to determine all applications in each access topology structure by traversing each access topology structure; based on the number of accesses corresponding to the source application in each access topology structure and the number of accesses corresponding to the destination application, as well as the expansion mapping relationship, calculate the expansion multiples of the applications in each access topology structure.
[0017] In some possible implementations, the data processing module is also used to calculate the expansion multiple of each application in each access topology structure; based on the expansion multiple of each application in each access topology structure, determine the expansion ratio between the expansion multiple of at least one destination application and the expansion multiple of the source application; based on the expansion ratio, generate expansion rules corresponding to each access topology structure.
[0018] In some possible implementations, when expansion rules corresponding to each access topology are generated, the expansion module is used to expand each source application and at least one destination application according to the expansion rules when each source application meets the expansion conditions.
[0019] In some possible implementations, the expansion configuration information also includes a reduction condition; the above-mentioned device also includes: a reduction module, which is used to determine whether the source application corresponding to each access topology structure meets the reduction condition after the expansion of the application in each access topology structure is completed; when the source application corresponding to each access topology structure meets the reduction condition, the expanded application in each access topology structure is restored to the state before the expansion.
[0020] The present application provides an electronic device, comprising: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the method provided by the present application.
[0021] The present application provides a computer storage medium storing executable instructions for implementing the method provided by the present application when the executable instructions are executed by a processor.
[0022] The present application provides a computer program product, including a computer program or instructions, for implementing the method provided by the present application when the computer program or instructions are executed by a processor.
[0023] This application has the following beneficial effects:
[0024] In this application, based on multiple dot logs, the access topology between the source application and at least one destination application is determined; based on the access topology, a more reasonable expansion combination and expansion multiple can be obtained, the expansion object can be evaluated more accurately, and more effective expansion can be achieved.
[0025] Furthermore, the capacity expansion method provided in the present application can complete the overall capacity expansion configuration of the capacity expansion link without the need for complex call management and other operations between application programs, thereby improving the degree of automation of capacity expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0027] Figure 2 This is an optional flowchart of the method for expanding the capacity of an application program provided in an embodiment of the present application;
[0028] Figure 3 It is an optional structural diagram of the access topology structure provided in the embodiment of the present application;
[0029] Figure 4 It is an optional flow chart of the method for expanding the application program provided in the embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0031] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be 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 similar descriptions of "first / second" appear in the application documents, the following explanation is added. In the following description, the terms "first / second / third" involved are merely to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first / second / third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present 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 those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0034] With the development of applications, more and more applications are deployed on container orchestration engines (such as kubernetes, K8s) clusters, and service functions are becoming more and more detailed, the number of service deployments is becoming more and more numerous, and the relationship between applications is becoming more and more complex. When faced with sudden increases in traffic and the need to expand capacity, there will be situations where it is difficult to start, quantify, and quickly complete the expansion of a large number of applications. Among them, the K8s cluster is an open source cluster used to manage containerized applications on multiple hosts in the cloud platform. The goal of the K8s cluster is to make the deployment of containerized applications simple and efficient. The K8s cluster provides a mechanism for application deployment, planning, updating, and maintenance. Expansion refers to the action of increasing the data of the currently deployed replica in order to meet the demand for a larger number of requests.
[0035] However, the current expansion scheme has the following shortcomings: 1. The degree of automation is low, and it is impossible to evaluate the expansion object and expansion amount, and it is impossible to automatically perceive the applications that need to be expanded, and there is no effective method to evaluate statistics; 2. There is a problem of poor integrity, and the entire traffic link cannot be expanded, which is prone to traffic bottlenecks and affects the overall service quality; 3. The operation is complicated, involving multiple clusters and multiple applications. The automatic expansion operation for each application is complicated and cumbersome, and it is easy to omission and misoperation; 4. The maintainability is poor, and it can only be configured individually. There is no unified configuration entry, and batch modification and operation cannot be performed.
[0036] The above problems make it impossible for the current expansion plan to effectively expand the capacity of applications.
[0037] In view of the above problems, an embodiment of the present application provides a method for expanding the capacity of an application program to achieve more effective expansion.
[0038] See also Figure 1 , Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 1 The electronic device 100 shown can be a terminal and / or a server. The electronic device 100 includes: at least one processor 110, a memory 150, at least one network interface 120 and a user interface 130. The various components in the electronic device 100 are coupled together via a bus system 140. It is understood that the bus system 140 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 140 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 140 is not shown in FIG. Figure 1 Various buses are labeled 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., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0040] The user interface 130 includes one or more output devices 131 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The 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 memory, hard disk drives, optical disk drives, etc. The memory 150 may optionally include one or more storage devices that are physically remote from the processor 110.
[0042] The memory 150 includes a volatile memory or a nonvolatile memory, and may also include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 150 described in the embodiments of the present application is intended to include any suitable type of memory.
[0043] In some embodiments, the memory 150 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0044] Operating system 151, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0045] A network communication module 152, for reaching other computing devices via one or more (wired or wireless) network interfaces 120, exemplary network interfaces 120 include: Bluetooth, wireless compatibility certification (WiFi), and universal serial bus (USB), etc.;
[0046] a presentation module 153 for enabling presentation of information via one or more output devices 131 (e.g., display screen, speaker, etc.) associated with the user interface 130 (e.g., a user interface for operating peripherals and displaying content and information);
[0047] The input processing module 154 is configured to detect one or more user inputs or interactions from one of the one or more input devices 132 and to translate the detected inputs or interactions.
[0048] In some embodiments, the application expansion device provided in the embodiments of the present application can be implemented in a software manner. Figure 1 An expansion device 155 for an application stored in the memory 150 is shown, which may be software in the form of a program or plug-in. The expansion device 155 for an application includes the following software modules: a configuration module 1551, a dot module 1552, a topology calculation module 1553, a data processing module 1554, and an expansion module 1555.
[0049] These modules are logical, so they can be arbitrarily combined or further divided according to the functions to be implemented. The functions of each module will be explained below.
[0050] In other embodiments, the expansion device of the application provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the expansion method of the application provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA) or other electronic components.
[0051] The following will describe the method for expanding the application program provided in the embodiment of the present application in combination with the exemplary application and implementation of the electronic device provided in the embodiment of the present application.
[0052] It should be noted that, for the convenience of description, the capacity expansion device of the application program is referred to as the capacity expansion device below.
[0053] See also Figure 2 , Figure 2This is an optional flow chart of the method for expanding the capacity of an application provided in the embodiment of the present application. Figure 2 The steps shown explain how to expand the capacity of an application.
[0054] S201, obtaining expansion configuration information of an application program, wherein the expansion configuration information is used to indicate a data management method and expansion conditions.
[0055] It is understandable that before the expansion device expands the application, it can obtain the expansion configuration information for the application from the database. The expansion configuration information is 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 are used to indicate information such as the cluster name, the cluster's application programming interface (API) address, the account number for logging into the cluster, and the password for logging into the cluster. For example, the cluster-related parameters of cluster A and cluster B can be expressed as: cluster: {cluster name: cluster A; API: API address of cluster A; account number: account number for logging into cluster A; password: password for logging into cluster A} {cluster name: cluster B; API: API address of cluster B; account number: account number for logging into cluster B; password: password for logging into cluster B}].
[0057] In some embodiments, the expansion configuration information can be used to indicate a data dotting method, which refers to a method for monitoring and recording in the running environment of an application, that is, a method for collecting monitoring data and log information of a cluster. For example, the data dotting method can be expressed as: longing: [args|header], where "args" is a parameter marker for logging inserted into the request body (such as an http parameter), and "args" is used for response processing in each application; "header" inserts a parameter marker for logging (such as an http header) into the header information of the request, 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 is used to indicate the method of collecting dotting data and the location information of the logs collected during the dotting process; for example, the data collection method can be expressed 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, the expansion configuration information can be used to indicate expansion conditions and contraction conditions. When the application meets the expansion conditions, the application will be expanded. When the expanded application meets the contraction conditions, the application will be contracted. In one example, the expansion conditions and contraction conditions can be combined together. For example, the expansion / contraction conditions can be expressed as: rule: {period: 1min, frequency: 3, high: 120%, low: 110%, gain: 150%}, where period represents the observation period of the periodic expansion and contraction conditions. When period is 1min, it means observing the traffic of the application every 1 minute; frequency represents the number of consecutive times. When frequency is 3, it means observing every 1 minute for 3 consecutive times. The traffic situation of an application at a time; high represents the high water level. If high is 120%, it means that when the current traffic is 120% higher than the normal level and meets the period and frequency, automatic expansion of the application will be triggered; low represents the low water level. If low is 110%, it means that when the current traffic is 110% lower than the normal level and meets the period and frequency, automatic reduction of the application will be triggered; gain represents the gain, that is, the ratio of expansion. For example, if the current traffic is twice the normal level and the expansion gain is 150%, then the expansion ratio is: 2×150%=3, which means the capacity should be expanded by 3 times.
[0060] In some embodiments, the capacity expansion configuration information may be pre-defined by an administrator and stored in a configuration module of the capacity expansion device.
[0061] S202, based on the data dotting method, dotting and recording multiple access requests for multiple target applications to obtain multiple dotting logs, wherein each access request corresponds to a dotting log, and the dotting log is used to record the number of accesses corresponding to the target application and the source application that accesses the target application.
[0062] It is understandable that a source application may initiate one or more access requests when accessing a target application. When the number of target applications is M, M target applications may correspond to N access requests, where N ≥ M. When a target application is accessed several times, several dot logs will be recorded, that is, the number of dot logs corresponding to each target application is equal to the number of access requests corresponding to each target application.
[0063] In some embodiments, the expansion device can record the access request received by each destination application according to the data recording method in the expansion configuration information, and collect information related to the access request. In one example, taking the recording sampling ratio of 1% and the args parameter method as an example, 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). At this time, the recording of application 3 can be expressed as start=APP1&forward=APP2¤t=APP3; in another example, taking the recording sampling ratio of 1% and the header parameter method as an example, the recording of application 3 can be expressed as: start:APP1forward:APP2 current:APP3.
[0064] It should be noted that downstream applications record dot logs. For example, in the above example, application 3 is the downstream program of application 2 and application 1. Application 3 records dot records accessed by application 2 and application 1. Dot tracking quantifies the request status on the access link.
[0065] S203, based on the multiple dot logs, determine the access topology structure between each source application and at least one destination application, wherein the access topology structure is used to represent the path and access times of the source application to access at least one destination application, and each source application corresponds to an access topology structure.
[0066] It is understandable that 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 can form multiple access topologies with corresponding destination applications. It should be noted that the access topology may include more than just the source application and the destination application. Since the initial access request comes from the user, the user's downstream program is the source application. The same user can correspond to multiple downstream source applications, and each of the multiple downstream source applications corresponding to the user 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, the above S203 may include: determining, based on preset parameters in the multiple dot logs, a ternary relationship between each source application and at least one destination application corresponding to each source application, wherein the ternary relationship is used to characterize the number of times the source application accesses the corresponding destination application; and visualizing at least one ternary relationship corresponding to each source application to obtain an access topology.
[0068] It is understandable that by analyzing the dot log and extracting the preset parameters in the dot log, the relay application that the source application passes through in the process of accessing each destination application (i.e., the path of the source application to access each destination application) and the number of times the source application accesses each destination application can be determined according to the preset parameters; then, based on the path of the source application to access each destination application and the number of times the source application accesses each destination application, the ternary relationship between the source application and each destination application can be determined. By using a visualization tool to visualize the ternary relationship, the access topology between the source application and multiple destination applications can be obtained.
[0069] In some embodiments, the ternary relationship may be expressed as: [original application, source application, destination application, statistics], where statistics = sum (preset parameter), and the statistics represent the number of access requests received by the application program. Figure 3 This is an optional structural diagram of the access topology provided in the embodiment of the present application, see Figure 3 As shown, the access topology includes 11 links (i.e., L1 to L11), the source applications are APP0 and APP1, and 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 purpose 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 purpose application level of APP0 is a multiple of m. Based on the visualization tool, the following three-way relationship between APP0 and APP1 can be constructed: Figure 3 The access topology.
[0070] In some embodiments, the visualization tool used to visualize multiple ternary relationships corresponding to the source application may be Gephi, or other visualization tools may be selected according to actual needs, which is not specifically limited in the embodiments of the present application.
[0071] In some embodiments, the preset parameter may select the forward field, or may select other fields according to actual needs, which is not specifically limited in the embodiments of the present application.
[0072] In some possible implementations, the above-mentioned 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 dot logs includes: for any source application, determining a first dot log corresponding to at least one destination application corresponding to the source application in multiple dot logs; for at least one destination application, recording the number of times the preset parameter appears in the first dot log; the number of times the preset parameter appears indicates the number of times the source application visits the at least one destination application; based on the number of times the preset parameter appears, determining the ternary relationship between the source application and the at least one destination application.
[0073] It can be understood that the number of times the preset parameter appears in the dot log is a statistic in the ternary relationship, that is, the number of times the source application accesses the target application. Based on the number of times the preset parameter appears in the dot log, the source application and the target application, the ternary relationship between the source application and the target application can be determined. There is a ternary relationship between the source application and each target application, for example, see Figure 3 As shown, APP0, as a source application, corresponds to multiple destination applications, and 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 in the figure, the access topology divides the application into multiple links, with APP0 and APP1 as the starting points of the links. Figure 3 There are 5 links in total, 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 structure serves as a destination application or a relay application, the upstream may include more than one application. Therefore, the total amount of statistics for each application can be calculated based on the access topology structure. Figure 3 The total statistics of applications in the access topology shown can be expressed 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, determining the expansion multiple of each source application and at least one destination application corresponding to each source application according to the access topology corresponding to each source application and the preset expansion mapping relationship, wherein the expansion mapping relationship is a 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.
[0077] It can be understood that, taking an access topology structure as an example, based on the 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 of the expansion multiples corresponding to the applications in other access topology structures is the same as the above method.
[0078] In some embodiments, the access topology may include multiple links, see Figure 3 As shown in the figure, when APP0 is the source application and APP5 is the destination application, there are two links, namely [Link 5: APP0: APP5 = 2m∶2m】and【Link 4:APP0∶APP3∶APP5 = In the above link 4, in addition to the source application and the destination application, a relay application (i.e., APP3) is also included, and link 5 only includes the source application and the destination application. Therefore, the application in the access topology structure includes not only the source application and multiple destination applications, but also the relay application between the source application and the destination application.
[0079] In some possible implementations, the above S204 may include: determining the applications in each access topology structure by traversing each access topology structure; calculating the expansion multiples of the applications in each access topology structure based on the number of accesses corresponding to the source application in each access topology structure and the number of accesses corresponding to the destination application in each access topology structure, as well as the expansion mapping relationship.
[0080] It can be understood that the expansion device can traverse the access topology structure, determine the source application in the access topology structure and the relay application and destination application corresponding to the source application (that is, determine all applications in the access topology structure), and calculate the expansion multiple corresponding to each application based on the preset expansion mapping relationship.
[0081] In some embodiments, the application scenario of the expansion mapping relationship is: when the expansion multiple of the source application is 1, multiple downstream applications corresponding to the source application should be expanded to a certain number of times the expansion multiple of the source application.
[0082] In some embodiments, the expression (1) of the expansion mapping relationship is as follows:
[0083]
[0084] In the formula, Q is the expansion multiple corresponding to application x, weight x is the statistic from the source application to application x, C x is the total amount of statistics for application x.
[0085] In some possible implementations, after obtaining the expansion multiple of at least one application in the access topology structure, the expansion method of the above application may also include: calculating the expansion multiple of each application in the access topology structure; based on the expansion multiple of each application in the access topology structure, determining the expansion ratio between the expansion multiple of each application and the expansion multiple of the source application; based on the expansion ratio, generating expansion rules corresponding to the access topology structure.
[0086] As you can understand, one source application corresponds to one expansion rule, see Figure 3 As shown, the access topology includes two source applications, namely APP0 and APP1, then, Figure 3 The access topology shown has two expansion rules corresponding to it.
[0087] In one example, see Figure 3As shown, taking APP0 as the source application, the expansion rules of APP0 and the destination application corresponding to APP0 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)], wherein R0 represents the expansion rule corresponding to the source application APP0. The above expansion rule R0 indicates that when the expansion multiple of APP0 is 1, the expansion multiple of APP3 is m / (2n+m), and the expansion multiple of APP5 is m / (m+n).
[0088] S205: Expand each source application and at least one destination application corresponding to each source application based on the expansion condition and the expansion multiple.
[0089] It can be understood that after determining the expansion multiples of the applications in the access topology structure, and if the source applications corresponding to the access topology structure meet the expansion conditions, each application in the access topology structure can be expanded to the corresponding expansion multiple.
[0090] In some possible implementations, when determining the expansion rules, the above S205 may include: when each source application meets the expansion conditions, expanding each source application and at least one application corresponding to each source application according to the expansion rules.
[0091] It can be understood that after the expansion rules are generated and when the source application meets the expansion conditions, the application in the access topology structure can be expanded according to the expansion rules.
[0092] In some embodiments, the expansion device may sample the traffic of the application (i.e., the statistics of the number of accesses) to obtain multiple sampling values; sort the multiple sampling values, and determine a reference value among the multiple sampling values based on the sorting results. The reference value corresponding to the application is a statistic used to determine whether the application meets the expansion condition or the reduction condition.
[0093] In some embodiments, the capacity expansion device may use P90 of the sampled value as a reference value for determining whether the application meets the capacity expansion condition. The multiple sampled values are sorted from small to large, and the value at the 90% position is the reference value.
[0094] In one example, see Figure 3The access topology shown in FIG. 1 is taken as an example, and n=1, m=2, the reference value corresponding to APP0 is 1000 (i.e., APP0 [P90]=1000), and the current values sampled for APP0 for three consecutive minutes are 1300, 1350, and 1400, respectively. If the change of the current sampling value meets the expansion condition, 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 multiple of the xth APP, gain is the gain in the expansion condition, and APP x [now] indicates the current sampling value of the xth APP. x [P90] represents the baseline value of the x-th APP.
[0097] Then, based on the above expression (2), the expansion multiple of APP0 is calculated: That is, APP0 needs to be expanded by 2.1 times. At the same time, all links with APP0 as the source application need to be expanded by 2.1 times. According to the above expansion rule R0, as well as the values of n and m, the expression for calculating the expansion multiples of other applications with 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 is expanded by 2.1 times, APP3 is expanded by 1.05 times, and APP5 is expanded by 1.4 times.
[0098] In an embodiment of the present application, after calculating the expansion multiple corresponding to each application, the K8s API can be used to expand the application on the expansion line according to the corresponding multiple.
[0099] In some possible implementations, when the expansion configuration information is also used to indicate the shrinkage conditions; the above-mentioned application expansion method may also include: after the expansion of the application in each access topology structure is completed, determining whether the source application corresponding to each access topology structure meets the shrinkage conditions; when the source application corresponding to each access topology structure meets the shrinkage conditions, restoring the expanded application in each access topology structure to the state before the expansion.
[0100] It can be understood that by sampling the application logs, the current traffic usage of the application (i.e., the statistics of the number of accesses) is analyzed to see whether it meets the shrinking conditions. If so, the expanded application is shrunk in the opposite direction.
[0101] In some embodiments, after performing the expansion operation on each application in the access topology structure, the expansion device can sample the traffic situation of the application (i.e., the statistics of the number of accesses) to obtain multiple sampling values; sort the multiple sampling values, and determine a reference value from the multiple sampling values based on the sorting results. The reference value corresponding to the application is a statistic used to determine whether the application meets the expansion condition or the reduction condition.
[0102] In one example, see Figure 3 The access topology shown in the figure is taken as follows: n=1, m=2, the benchmark value corresponding to APP0 is 1000 (i.e., APP0 [P90]=1000), and the current values sampled for APP0 for three consecutive minutes are 1000, 1050, and 1060, respectively. The expansion device determines that APP0 meets the reduction condition based on the above-mentioned pre-configured reduction condition, and performs reverse reduction according to the expansion multiple during the previous expansion, i.e., APP0 is reduced by 2.1 times, APP3 is reduced by 1.05 times, and APP5 is reduced by 1.4 times.
[0103] In an embodiment of the present application, the K8s API can also scale down the application programs on the expansion line by a corresponding multiple.
[0104] In some possible implementations, after executing S202 and before executing S203, the method for expanding the application may further include: collecting dot data according to the data collection method in the configuration information, and storing the collected data in a database.
[0105] In some possible implementations, after executing the above expansion or reduction processing, the expansion method of the above application may further include: performing a task report on the expansion processing data and / or the reduction processing data, and storing the report in a database. The expansion processing data includes: execution action (i.e., expansion action), execution time, execution expansion multiple and execution link, etc. The reduction processing data includes: execution action (i.e., reduction action), execution time, execution reduction multiple and execution link, etc.
[0106] Figure 4 This is an optional flow chart of the method for expanding the capacity of an application provided in the embodiment of the present application. Figure 4 The steps shown are explained.
[0107] S401, the capacity expansion device obtains capacity expansion configuration information of the application program.
[0108] S402: The capacity expansion device performs dotting and recording of multiple access requests for multiple target applications based on the data dotting method in the capacity expansion configuration information.
[0109] S403 , the capacity expansion device collects dot data based on the data collection method in the capacity expansion configuration information, and stores the collected data in the database 41 .
[0110] S404, the capacity expansion device obtains dot data in 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 dot data (ie, dot log).
[0111] S405 , the expansion device determines the expansion rules of the application programs in each access topology structure based on each access topology structure and a 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 structure meets the expansion condition in the expansion configuration information; if so, execute S407; if not, execute S410.
[0113] S407, the capacity expansion device performs capacity expansion processing on the application program according to the capacity expansion rule.
[0114] S408, the expansion device determines whether the application in the access topology structure meets the shrinking condition in the expansion configuration information. If so, S409 is executed; if not, S410 is executed.
[0115] S409, the expansion device performs a reduction process on the application program according to the reduction rule.
[0116] S410 , the capacity expansion device makes a task report on the capacity expansion processing data and / or the capacity reduction processing data; and stores the report in the database 41 .
[0117] At this point, the capacity expansion device has completed the capacity expansion method of the above application program.
[0118] In an embodiment of the present application, based on multiple dot logs, the access topology between the source application and at least one destination application is determined; based on the access topology, a more reasonable expansion combination and expansion multiple can be obtained, and the expansion object can be evaluated more accurately to achieve more effective expansion.
[0119] Furthermore, the capacity expansion method provided in the embodiment of the present application can complete the overall capacity expansion configuration of the capacity expansion link without performing complex call management operations between application programs, thereby improving the degree of automation of capacity expansion.
[0120] Furthermore, by determining the expansion multiple of the source application, the expansion multiple of the destination application corresponding to the source application can be further determined, thereby achieving overall expansion of the expansion link and reducing potential bottleneck risks during the expansion process.
[0121] Furthermore, the capacity expansion method provided in the embodiment of the present application does not require the administrator to perform complex dependency analysis and statistical analysis. It only needs to specify the capacity expansion threshold percentage and the capacity expansion percentage, which reduces the professional quality requirements for operators and greatly reduces the difficulty of capacity expansion operations.
[0122] Furthermore, in the capacity expansion method provided in the embodiment of the present application, the administrator only needs to perform simple configuration in the configuration center to obtain the capacity expansion configuration information, and then complete the automatic capacity expansion configuration of multiple applications in multiple clusters, effectively reducing the maintenance cost of the capacity expansion rules.
[0123] The following is a description of an exemplary structure of an application expansion device 155 provided in an embodiment of the present application implemented as a software module. In some embodiments, Figure 1 As shown, the software modules in the expansion device 155 of the application stored in the memory 150 may include: a configuration module 1551, which is used to obtain the expansion configuration information of the application; the expansion configuration information is used to indicate the data dotting method and the expansion condition; a dotting module 1552, which is used to dotting and record multiple access requests for multiple target applications based on the data dotting method to obtain multiple dotting logs; each access request corresponds to a dotting log, and the dotting log is used to record the number of accesses corresponding to the target application and the source application that accesses the target application; a topology calculation module 1553, which is used to determine the access topology structure between each source application and at least one target application based on the multiple dotting logs. structure; the access topology structure is used to represent the path and number of visits of the source application to at least one destination application; each source application corresponds to an access topology structure; a data processing module 1554 is used to determine the expansion multiples of each source application and at least one destination application corresponding to each source application according to the access topology structure corresponding to each source application and a preset expansion mapping relationship; the expansion mapping relationship is a mapping relationship between the number of visits corresponding to the source application or the number of visits corresponding to the destination application and the expansion multiple; an 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 condition and the expansion multiple.
[0124] In some possible implementations, the topology calculation module 1553 is used to determine the ternary relationship between each source application and at least one destination application corresponding to each source application based on preset parameters in multiple dot logs; 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 an access topology structure.
[0125] In some possible implementations, the topology calculation module 1553 is used to determine, for any source application, from multiple dot logs, a first dot 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 dot log; the number of times the preset parameter appears indicates the number of times the source application visits the at least one destination application; and based on the number of times the preset parameter appears, determine the ternary relationship between the source application and the 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 structure by traversing each access topology structure; based on the number of accesses corresponding to the source application in each access topology structure and the number of accesses corresponding to the destination application, as well as the expansion mapping relationship, calculate the expansion multiples of the applications in each access topology structure.
[0127] In some possible implementations, the data processing module 1554 is also used to calculate the expansion multiple of each application in each access topology structure; based on the expansion multiple of each application in each access topology structure, determine the expansion ratio between the expansion multiple of at least one destination application and the expansion multiple of the source application; based on the expansion ratio, generate expansion rules corresponding to each access topology structure.
[0128] In some possible implementations, when generating expansion rules corresponding to each access topology structure, the expansion module 1555 is used to expand each source application and at least one destination application according to the expansion rules when each source application meets the expansion conditions.
[0129] In some possible implementations, the expansion configuration information also includes a reduction condition; the above-mentioned device also includes: a reduction module, which is used to determine whether the source application corresponding to each access topology structure meets the reduction condition after the expansion of the application in each access topology structure is completed; when the source application corresponding to each access topology structure meets the reduction condition, the expanded application in each access topology structure is restored to the state before the expansion.
[0130] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer storage medium. The processor of the computer device reads the computer instructions from the computer storage medium, and the processor executes the computer instructions, so that the computer device executes the expansion method of the application program described above in the embodiment of the present application.
[0131] The embodiment of the present application provides a computer storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the expansion method of the application provided in the embodiment of the present application, for example Figure 2 The following is a method for expanding the capacity of an application.
[0132] In some embodiments, the computer storage medium may be a memory such as FRAM, ROM, PROM, EPRO M, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
[0133] In some embodiments, executable instructions may be in 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 stand-alone 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 need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as 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 coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0135] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0136] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for expanding the capacity of an application, characterized in that: The method comprises: Acquire expansion configuration information of the application; the expansion configuration information is used to indicate the data management method and expansion conditions; Based on the data dotting method, multiple access requests for multiple target applications are dotted and recorded to obtain multiple dot logs; each access request corresponds to a dot log, and the dot 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 dot logs, determine the access topology structure between each source application and at least one destination application; the access topology structure is used to represent the path and access times of the source application to access at least one destination application; each source application corresponds to an access topology structure; Determine the expansion multiple of each source application and at least one destination application corresponding to each source application according to the access topology structure corresponding to each source application and the preset expansion mapping relationship; the expansion mapping relationship is a 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; and Based on the expansion condition and the expansion multiple, each source application and at least one destination application corresponding to each source application are expanded.
2. The method according to claim 1, characterized in that The step of determining the access topology between each source application and at least one destination application based on the multiple dot logs includes: Based on preset parameters in the plurality of dot logs, determining a ternary relationship 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; Visualization processing is performed on at least one ternary relationship corresponding to each source application to obtain the access topology structure.
3. The method according to claim 2, characterized in that The determining, based on preset parameters in the plurality of dot logs, a ternary relationship between each source application and at least one destination application corresponding to each source application comprises: For any source application, determining, from the plurality of dot logs, a first dot log corresponding to at least one destination application corresponding to the source application; For the at least one target application, record the number of times the preset parameter appears in the first dot log; the number of times the preset parameter appears indicates the number of times the source application accesses the at least one target application; Based on the number of occurrences of the preset parameter, a ternary relationship between the source application and the at least one destination application is determined.
4. The method according to claim 1, characterized in that: The determining, according to the access topology corresponding to each source application and the preset expansion mapping relationship, the expansion multiples of each source application and at least one destination application corresponding to each source application comprises: By traversing each access topology structure, determining all applications in each access topology structure; Based on the number of accesses corresponding to the source application in each access topology structure, the number of accesses corresponding to the destination application, and the expansion mapping relationship, the expansion multiple of the application in each access topology structure is calculated.
5. The method according to claim 4, characterized in that The method further comprises: Calculating the expansion multiple of each application in each access topology structure; Based on the expansion multiple of each application in each access topology structure, determining an expansion ratio between the expansion multiple of the at least one destination application and the expansion multiple of the source application; Based on the expansion ratio, an expansion rule corresponding to each access topology structure is generated.
6. The method according to claim 5, characterized in that In the case of generating the expansion rule corresponding to each access topology structure, the expansion of each source application and at least one destination application corresponding to each source application based on the expansion condition and the expansion multiple includes: When each source application meets the expansion condition, each source application and the at least one destination application are expanded according to the expansion rule.
7. The method according to claim 1, characterized in that The expansion configuration information is also used to indicate the reduction condition; The method further comprises: After the expansion of the application in each access topology structure is completed, determining whether the source application corresponding to each access topology structure meets the reduction condition; When the source application corresponding to each access topology structure meets the shrinking condition, the expanded application in each access topology structure is restored to a state before the expansion.
8. A device for expanding the capacity of an application, characterized in that: The device comprises: A configuration module, used to obtain expansion configuration information of the application; the expansion configuration information is used to indicate the data management method and expansion conditions; A dotting module, used to dotting and recording multiple access requests for multiple target applications based on the data dotting method, and obtain multiple dotting logs; each access request corresponds to a dotting log, and the dotting log is used to record the number of accesses corresponding to the target application and the source application that accesses the target application; A topology calculation module, used to determine an access topology structure between each source application and at least one destination application based on the multiple dot logs; the access topology structure is used to represent a path and a number of accesses of the source application to at least one destination application; each source application corresponds to an access topology structure; A data processing module, used to determine the expansion multiples of each source application and at least one destination application corresponding to each source application according to the access topology corresponding to each source application and a preset expansion mapping relationship; the expansion mapping relationship is a 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; An 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 condition and the expansion multiple.
9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor, configured to implement the method according to any one of claims 1 to 7 when executing the executable instructions or computer programs stored in the memory.
10. A computer-readable storage medium storing executable instructions or a computer program, characterized in that: When the executable instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Expansion method and expansion device
CN108366082A
Cloud computing capacity expansion method and device based on service call link
CN112346872A
Method and device for expanding and shrinking capacity of application
CN114385308A
Dynamic token bucket capacity adjustment method, storage medium and electronic device
CN115460153A
Data processing system for application pod control
CN115617517A