Interface performance early warning method based on linear regression model and related equipment
Through the interface performance warning method based on linear regression model, the target linear regression model is constructed to predict the future performance of the interface and early warning, which solves the problem of unpredictable interface performance in the existing technology, and improves the stability and user experience of the interface .
Patent Information
- Application Number
- CN202111432674.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-11-29
AI Technical Summary
The existing monitoring system cannot predict the future performance of the interface, resulting in problems being discovered only when the interface error is reported, affecting the calls of the interface by all parties.
Using an interface performance warning method based on a linear regression model, a target linear regression model is constructed by obtaining interface performance characteristic data, predicting the interface characteristic value of the next time window, and warning is made when the characteristic value exceeds the threshold.
It realizes early warning of potential performance degradation interfaces, reduces problems occurring during the call process, and improves the stability and user experience of the interface.
Smart Images

Figure CN114090407B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to an interface performance early warning method based on a linear regression model and related equipment. Background Art
[0002] Performance testing is an important part of the entire testing life cycle and a very important non-functional feature of software products. It indicates the time, effectiveness and economic requirements of the software system for the resources required by the system. It is also a specific manifestation of software capabilities. For a software system, the faster the execution speed and the fewer system resources it occupies during runtime, the more stable the system will be, the better the user experience will be, and the higher the customer satisfaction will be; such software can put the company in a favorable position in the fierce industry competition.
[0003] Most current monitoring systems can collect and display data such as the interface's QPS (query rate per second), response time, and business volume, but cannot predict performance at a certain point in the future. There are tens of thousands of interfaces in financial systems such as banks, and it is difficult to choose which interfaces to perform performance tests on. Currently, there is no way to provide early warning for interfaces that may have performance problems, resulting in problems being discovered only when the interface reports an error, affecting the calls of all parties to the interface. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose an interface performance warning method, device, computer equipment and storage medium based on a linear regression model, so as to provide early warning for interfaces with potential performance degradation.
[0005] In order to solve the above technical problems, the embodiment of the present application provides an interface performance early warning method based on a linear regression model, which adopts the following technical solution:
[0006] An interface performance early warning method based on a linear regression model comprises the following steps:
[0007] Based on a preset time window, obtain the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system;
[0008] The interface performance characteristic data of each of the API interfaces are counted according to the dimensions of the data, a target characteristic value of each dimension is obtained, and a target linear regression model is constructed based on the target characteristic value;
[0009] Predicting the interface characteristic value of the next time window based on the target linear regression model;
[0010] Determine whether the interface characteristic value exceeds the characteristic threshold. If the interface characteristic value exceeds the characteristic threshold, perform an early warning operation to remind the developer to debug the API interface.
[0011] Furthermore, the step of collecting statistics on the interface performance characteristic data of each of the API interfaces to obtain the target characteristic value includes:
[0012] The mean values of the various dimensions of the interface performance characteristic data in each time window are calculated respectively, and the mean values of the various dimensions are used as the target characteristic values of the corresponding dimensions in the corresponding time window.
[0013] Furthermore, the step of constructing a target linear regression model based on the target feature value includes:
[0014] Calculate a first dimension coefficient and a second dimension coefficient of the dimension based on the target feature value of the dimension;
[0015] Calculate the mean of the first dimension coefficients and the mean of the second dimension coefficients of all dimensions, and use the mean of the first dimension coefficients as the first target parameter value, and use the mean of the second dimension coefficients as the second target parameter value;
[0016] The target linear regression model is generated based on the first target parameter value and the second target parameter value.
[0017] Furthermore, the step of calculating the first dimension coefficient and the second dimension coefficient of the dimension based on the target eigenvalue of the dimension includes:
[0018] The first dimension coefficient and the second dimension coefficient are calculated based on the following formula:
[0019] Among them, a 1 is the first dimension coefficient of the current dimension, b 1 is the second dimension coefficient of the current dimension, t i represents the sequence number of the time window, represents the average sequence number of the time window, y i The target feature value of the current dimension represents the target feature value corresponding to each time window of the current dimension. The average value of the target feature value of the current dimension represents the average value of the target feature values of all time windows of the current dimension, and the sequence numbers of the time windows are incremented from 1 according to the time sequence corresponding to the time windows.
[0020] Furthermore, the step of generating the target linear regression model based on the first target parameter value and the second target parameter value includes:
[0021] The first target parameter value is used as a constant of the target linear regression model, and the second target parameter value is used as a parameter of the independent variable of the target linear regression model to obtain the target linear regression model, wherein the target linear regression model formula is as follows:
[0022] represents the first target parameter value, Represents the second target parameter value.
[0023] Furthermore, the step of predicting the interface characteristic value of the next time window based on the target linear regression model includes:
[0024] Add 1 to the maximum value of the sequence number of the time window to generate the sequence number of the next time window, and use the sequence number of the next time window as the value of the independent variable of the target linear regression model;
[0025] The value of the independent variable of the target linear regression model is input into the target linear regression model to obtain the value of the dependent variable of the target linear regression model as the interface characteristic value.
[0026] Furthermore, after the step of obtaining the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system, the method further includes:
[0027] The interface performance characteristic data is saved in a database, and when a viewing request is received, the interface performance characteristic data is retrieved from the database and displayed on a front-end page.
[0028] In order to solve the above technical problems, the embodiment of the present application further provides an interface performance early warning device based on a linear regression model, which adopts the following technical solution:
[0029] An interface performance early warning device based on a linear regression model, comprising:
[0030] An acquisition module is used to acquire interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system based on a preset time window;
[0031] A statistical module, used to count the interface performance characteristic data of each of the API interfaces according to the dimensions of the data, obtain a target characteristic value of each dimension, and construct a target linear regression model based on the target characteristic value;
[0032] A prediction module, used for predicting the interface characteristic value of the next time window based on the target linear regression model; and
[0033] The early warning module is used to determine whether the interface characteristic value exceeds the characteristic threshold. If the interface characteristic value exceeds the characteristic threshold, an early warning operation is performed to remind the developer to debug the API interface.
[0034] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0035] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the above-mentioned interface performance early warning method based on a linear regression model when executing the computer-readable instructions.
[0036] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0037] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the above-mentioned interface performance early warning method based on a linear regression model.
[0038] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0039] This application does not require training, and only simple calculations are required to build a target linear regression model. It can also be used to predict the interface feature values of the next time window, and to predict the performance of the interface in the future. When the predicted interface feature value exceeds the feature threshold, a prediction operation is performed to remind developers to test and tune in advance, thereby reducing the occurrence of problems during the interface call process. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0042] Figure 2 is a flow chart of an embodiment of an interface performance early warning method based on a linear regression model according to the present application;
[0043] Figure 3 It is a structural schematic diagram of an embodiment of an interface performance early warning device based on a linear regression model according to the present application;
[0044] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application.
[0045] Attached figure numbers: 200, computer equipment; 201, memory; 202, processor; 203, network interface; 300, interface performance early warning device based on linear regression model; 301, acquisition module; 302, statistical module; 303, prediction module; 304, early warning module. DETAILED DESCRIPTION
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0049] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0050] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0051] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0052] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0053] It should be noted that the interface performance warning method based on the linear regression model provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the interface performance warning device based on the linear regression model is generally set in the server / terminal device.
[0054] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0055] Continue to refer Figure 2 , shows a flow chart of an embodiment of an interface performance early warning method based on a linear regression model according to the present application. The interface performance early warning method based on a linear regression model comprises the following steps:
[0056] S1: Based on a preset time window, obtain the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system.
[0057] In this embodiment, a distributed monitoring system (CAT system) is deployed on each server of the application system, and each distributed monitoring system (CAT system) has multiple agent nodes (cat agent nodes). The interface feature data of the API interface corresponding to each agent node is obtained for subsequent model training. Among them, the interface feature data of the present application is multi-dimensional data, and its dimensions include API daily transaction volume, average response time, and QPS (query rate per second) of the interface. The acquisition of interface performance feature data based on the time window is used for subsequent performance prediction of the API interface.
[0058] Specifically, in step S1, that is, the step of obtaining the interface characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system based on the preset time window includes:
[0059] The interface characteristic data within the time period is cyclically acquired based on a preset time period, wherein the time period includes a plurality of the time windows.
[0060] In this embodiment, the sequence number of the time window in each time period increases in sequence from 1 according to the time sequence. This application sets the time period to be seven weeks, and obtains the interface feature data within these seven weeks for subsequent processing every seven weeks. Each week is a time window, and the sequence number corresponding to the time window of the first week is 1, the sequence number corresponding to the time window of the second week is 2, and so on. The sequence number corresponding to the time window of the seventh week is 7.
[0061] S2: Counting the interface performance characteristic data of each of the API interfaces according to the dimensions of the data, obtaining the target characteristic value of each dimension, and constructing a target linear regression model based on the target characteristic value.
[0062] In this embodiment, in statistics, linear regression is a regression analysis that uses a least square function called a linear regression equation to model the relationship between one or more independent variables and a dependent variable. Linear regression is a statistical analysis method that uses regression analysis in mathematical statistics to determine the quantitative relationship between two or more variables that are interdependent, and is widely used. The present application calculates the parameters of the target linear regression model based on the target eigenvalues, thereby realizing the construction of the target linear regression model.
[0063] Specifically, in step S2, the step of collecting statistics on the interface performance characteristic data of each of the API interfaces to obtain the target characteristic value includes:
[0064] The mean values of the various dimensions of the interface performance characteristic data in each time window are calculated respectively, and the mean values of the various dimensions are used as the target characteristic values of the corresponding dimensions in the corresponding time window.
[0065] In this embodiment, the time window is a different time period, for example, one week is used as a time window. The dimensions of the interface feature data include the daily transaction volume of the API, the average response time, and the QPS (query rate per second) of the interface. Take the response time of the API as an example: the response time of the API of the CAT system is sorted out, and the average response time of an interface per week in the last seven weeks (i.e., the last seven time windows) is obtained, as shown in Table 1:
[0066] Table 1
[0067] 1 2 3 4 5 6 7 122 129 148 171 184 209 220
[0068] In addition, in step S2, the step of constructing a target linear regression model based on the target feature value includes:
[0069] Calculate a first dimension coefficient and a second dimension coefficient of the dimension based on the target feature value of the dimension;
[0070] Calculate the mean of the first dimension coefficients and the mean of the second dimension coefficients of all dimensions, and use the mean of the first dimension coefficients as the first target parameter value, and use the mean of the second dimension coefficients as the second target parameter value;
[0071] The target linear regression model is generated based on the first target parameter value and the second target parameter value.
[0072] In this embodiment, the corresponding first dimension coefficients and second dimension coefficients are calculated based on the target characteristic values of dimensions such as API daily transaction volume, average response time, and QPS (query rate per second) of the interface. The first target parameter value is obtained by calculating the mean of all first dimension coefficients. The second target parameter value is obtained by calculating the mean of all second dimension coefficients. In addition, the present application can also obtain the preset dimension weights of each dimension, and perform a weighted sum operation on all first dimension coefficients based on the dimension weights to obtain the first target parameter value. The second target parameter value is obtained by performing a weighted sum operation on all second dimension coefficients based on the dimension weights, wherein the sum of all dimension weights is a value of 1.
[0073] The step of calculating the first dimension coefficient and the second dimension coefficient of the dimension based on the target feature value of the dimension comprises:
[0074] The first dimension coefficient and the second dimension coefficient are calculated based on the following formula:
[0075] Among them, a 1 is the first dimension coefficient of the current dimension, b 1 is the second dimension coefficient of the current dimension, t i represents the sequence number of the time window, represents the average sequence number of the time window, y i The target feature value of the current dimension represents the target feature value corresponding to each time window of the current dimension. The average value of the target feature value of the current dimension represents the average value of the target feature values of all time windows of the current dimension, and the sequence numbers of the time windows are incremented from 1 according to the time sequence corresponding to the time windows.
[0076] In this embodiment, taking the API response time as an example, according to the formula:
[0077] Where yi represents the response time (i.e., target characteristic value) of the current interface within a preset time period per week (one week is a time window), represents the average response time of the current interface in all weeks (all time windows) within a preset time period, ti represents the sequence number of the time window, Represents the mean of the sequence number of the time window. According to the formula and the data in Table 1, we can calculate: y=17.5t+99, and then, when predicting the API interface performance in the eighth week, that is, when t=8, we can estimate the specific value of the interface characteristic value y of the next time window.
[0078] Furthermore, the step of generating the target linear regression model based on the first target parameter value and the second target parameter value includes:
[0079] The first target parameter value is used as a constant of the target linear regression model, and the second target parameter value is used as a parameter of the independent variable of the target linear regression model to obtain the target linear regression model, wherein the target linear regression model formula is as follows:
[0080] represents the first target parameter value, Represents the second target parameter value.
[0081] In this embodiment, in this application, the target linear regression model is generated by obtaining the first target parameter value and the second target parameter value. The target linear regression model is in, represents the first target parameter value, The present application uses the calculated first target parameter value as a constant of the target linear regression model and uses the calculated second target parameter value as a parameter of the independent variable of the target linear regression model to finally obtain the target linear regression model.
[0082] S3: Predicting the interface characteristic value of the next time window based on the target linear regression model.
[0083] In this embodiment, the sequence number of the next time window is input into the target linear regression model, and the output interface characteristic value is obtained.
[0084] Specifically, the step of predicting the interface characteristic value of the next time window based on the target linear regression model includes:
[0085] Add 1 to the maximum value of the sequence number of the time window to generate the sequence number of the next time window, and use the sequence number of the next time window as the value of the independent variable of the target linear regression model;
[0086] The value of the independent variable of the target linear regression model is input into the target linear regression model to obtain the value of the dependent variable of the target linear regression model as the interface characteristic value.
[0087] In this embodiment, the sequence number of the next time window is the sequence number of the last time window for generating the target linear regression model plus 1. For example, the sequence number of the last time window for generating the target linear regression model is 7. Then the sequence number of the next time window here is 8. The rapid generation of the sequence number of the time window is realized, which is used to quickly predict the interface characteristic value corresponding to the time window.
[0088] S4: Determine whether the interface characteristic value exceeds the characteristic threshold. If the interface characteristic value exceeds the characteristic threshold, perform an early warning operation to remind the developer to debug the API interface.
[0089] In this embodiment, if the interface characteristic value corresponding to the predicted next time window is greater than the set warning threshold, it means that the performance of the interface in the time window may be abnormal, and a warning operation is performed, specifically by sending an email to notify the person in charge of the application system, that is, the developer, to remind the developer to conduct performance testing.
[0090] Specifically, if the interface characteristic value exceeds the characteristic threshold, the step of performing the early warning operation includes:
[0091] If the interface characteristic value exceeds the characteristic threshold, a warning notification is sent to the user end of the developer, wherein the warning notification carries the interface name of the API interface.
[0092] In this embodiment, the early warning notification carries the interface name of the API interface, which is convenient for developers to quickly locate the corresponding API interface by the interface name. This application makes effective predictions for risky interfaces, and testers and developers can intervene in advance to perform performance testing and optimization, reducing the occurrence of online problems.
[0093] In this embodiment, the interface performance early warning method based on the linear regression model is run on the electronic device (for example Figure 1The server / terminal device shown in the figure can send an early warning notification to the developer's user terminal through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0094] As another embodiment of the present application, after step S1, that is, after the step of obtaining the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system, it also includes:
[0095] The interface performance characteristic data is saved in a database, and when a viewing request is received, the interface performance characteristic data is retrieved from the database and displayed on a front-end page.
[0096] In this embodiment, the collected interface feature data of the API interface of the CAT system server is stored in the database, and the user can see the daily API transaction volume and average response time.
[0097] This application does not require training, and only simple calculations are required to build a target linear regression model. It can also be used to predict the interface feature values of the next time window, and to predict the performance of the interface in the future. When the predicted interface feature value exceeds the feature threshold, a prediction operation is performed to remind developers to test and tune in advance, thereby reducing the occurrence of problems during the interface call process.
[0098] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target linear regression model, the above-mentioned target linear regression model can also be stored in a node of a blockchain.
[0099] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0100] This application can be applied in the field of smart government affairs, thereby promoting the construction of smart cities.
[0101] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0102] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0103] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of an interface performance early warning device based on a linear regression model. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0104] like Figure 3 As shown, the interface performance warning device 300 based on the linear regression model described in this embodiment includes: an acquisition module 301, a statistics module 302, a prediction module 303 and an early warning module 304. Among them: the acquisition module 301 is used to obtain the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system based on a preset time window; the statistics module 302 is used to count the interface performance characteristic data of each API interface according to the dimension of the data, obtain the target characteristic value of each dimension, and build a target linear regression model based on the target characteristic value; the prediction module 303 is used to predict the interface characteristic value of the next time window based on the target linear regression model; and the early warning module 304 is used to determine whether the interface characteristic value exceeds the characteristic threshold. If the interface characteristic value exceeds the characteristic threshold, a warning operation is performed to remind the developer to debug the API interface.
[0105] In this embodiment, the application does not require training, and only simple calculations are required to construct a target linear regression model, and can be used to predict the interface characteristic value of the next time window, to predict the performance of the interface in the future. When the predicted interface characteristic value exceeds the characteristic threshold, a prediction operation is performed, so as to remind the developer to test and tune in advance, and reduce the occurrence of problems in the interface during the calling process.
[0106] In some optional implementations of this embodiment, the acquisition module 301 is further used to: cyclically acquire interface feature data within a preset time period based on the preset time period, wherein the time period includes a plurality of the time windows.
[0107] In some optional implementations of this embodiment, the above-mentioned statistical module 302 is further used to: respectively calculate the mean of each dimension of the interface performance characteristic data of each time window, and use the mean of each dimension as the target characteristic value of the corresponding dimension in the corresponding time window.
[0108] The statistical module 302 includes a first calculation submodule, a second calculation submodule and a linear model generation submodule, wherein the first calculation submodule is used to calculate the first dimension coefficient and the second dimension coefficient of the dimension based on the target feature value of the dimension; the second calculation submodule is used to calculate the mean of the first dimension coefficient and the mean of the second dimension coefficient of all dimensions, and use the mean of the first dimension coefficient as the first target parameter value and the mean of the second dimension coefficient as the second target parameter value; the linear model generation submodule is used to generate the target linear regression model based on the first target parameter value and the second target parameter value.
[0109] In some optional implementations of this embodiment, the first calculation submodule is further used to calculate the first dimension coefficient and the second dimension coefficient based on the following formula:
[0110] Among them, a 1 is the first dimension coefficient of the current dimension, b 1 is the second dimension coefficient of the current dimension, t i represents the sequence number of the time window, represents the average sequence number of the time window, y i The target feature value of the current dimension represents the target feature value corresponding to each time window of the current dimension. The average value of the target feature value of the current dimension represents the average value of the target feature values of all time windows of the current dimension, and the sequence numbers of the time windows are incremented from 1 according to the time sequence corresponding to the time windows.
[0111] In some optional implementations of this embodiment, the generating submodule is further used to: use the first target parameter value as a constant of the target linear regression model, and use the second target parameter value as a parameter of an independent variable of the target linear regression model to obtain the target linear regression model, wherein the target linear regression model formula is as follows:
[0112] represents the first target parameter value, Represents the second target parameter value.
[0113] The prediction module 303 includes a sequence number generation submodule and an acquisition submodule, wherein the sequence number generation submodule is used to add 1 to the maximum value of the sequence number of the time window, generate the sequence number of the next time window, and use the sequence number of the next time window as the value of the independent variable of the target linear regression model; the acquisition submodule is used to input the value of the independent variable of the target linear regression model into the target linear regression model, obtain the value of the dependent variable of the target linear regression model as the interface characteristic value.
[0114] In some optional implementations of this embodiment, the above-mentioned warning module 304 is further used to: if the interface characteristic value exceeds the characteristic threshold, send a warning notification to the user end of the developer, wherein the warning notification carries the interface name of the API interface.
[0115] In some optional implementations of this embodiment, the above-mentioned device 300 also includes: a display module, which is used to save the interface performance characteristic data in a database, and when a viewing request is received, retrieve the interface performance characteristic data from the database and display it on the front-end page.
[0116] This application does not require training, and only simple calculations are required to build a target linear regression model. It can also be used to predict the interface feature values of the next time window, and to predict the performance of the interface in the future. When the predicted interface feature value exceeds the feature threshold, a prediction operation is performed to remind developers to test and tune in advance, thereby reducing the occurrence of problems during the interface call process.
[0117] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0118] The computer device 200 includes a memory 201, a processor 202, and a network interface 203 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 200 having components 201-203, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0119] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0120] The memory 201 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 201 can be an internal storage unit of the computer device 200, such as a hard disk or memory of the computer device 200. In other embodiments, the memory 201 can also be an external storage device of the computer device 200, such as a plug-in hard disk equipped on the computer device 200, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 201 can also include both the internal storage unit of the computer device 200 and its external storage device. In this embodiment, the memory 201 is generally used to store the operating system and various application software installed on the computer device 200, such as computer-readable instructions of the interface performance early warning method based on the linear regression model. In addition, the memory 201 can also be used to temporarily store various data that have been output or are to be output.
[0121] The processor 202 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 202 is generally used to control the overall operation of the computer device 200. In this embodiment, the processor 202 is used to run the computer-readable instructions stored in the memory 201 or process data, such as computer-readable instructions for running the interface performance early warning method based on the linear regression model.
[0122] The network interface 203 may include a wireless network interface or a wired network interface. The network interface 203 is generally used to establish a communication connection between the computer device 200 and other electronic devices.
[0123] In this embodiment, the application can be used to predict the interface characteristic value of the next time window, and to predict the performance of the interface in the future. When the predicted interface characteristic value exceeds the characteristic threshold, a prediction operation is performed to remind the developer to test and tune in advance, thereby reducing the occurrence of problems during the interface calling process.
[0124] The present application also provides another implementation, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the interface performance warning method based on the linear regression model as described above.
[0125] In this embodiment, the application can be used to predict the interface characteristic value of the next time window, and to predict the performance of the interface in the future. When the predicted interface characteristic value exceeds the characteristic threshold, a prediction operation is performed to remind the developer to test and tune in advance, thereby reducing the occurrence of problems during the interface calling process.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0127] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. An interface performance early warning method based on a linear regression model, characterized in that: The steps include: Based on a preset time window, obtain the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system; The interface performance characteristic data of each of the API interfaces are counted according to the dimensions of the data, a target characteristic value of each dimension is obtained, and a target linear regression model is constructed based on the target characteristic value; Predicting the interface characteristic value of the next time window based on the target linear regression model; Determine whether the interface characteristic value exceeds the characteristic threshold, and if the interface characteristic value exceeds the characteristic threshold, perform an early warning operation to remind the developer to debug the API interface; The step of collecting statistics on the interface performance characteristic data of each API interface according to the dimensions of the data to obtain the target characteristic value of each dimension includes: Calculating the mean of each dimension of the interface performance characteristic data in each time window respectively, and taking the mean of each dimension as the target characteristic value of the corresponding dimension in the corresponding time window; The step of constructing a target linear regression model based on the target feature value includes: Calculate a first dimension coefficient and a second dimension coefficient of the dimension based on the target feature value of the dimension; Calculate the mean of the first dimension coefficients and the mean of the second dimension coefficients of all dimensions, and use the mean of the first dimension coefficients as the first target parameter value, and use the mean of the second dimension coefficients as the second target parameter value; The target linear regression model is generated based on the first target parameter value and the second target parameter value.
2. The interface performance early warning method based on the linear regression model according to claim 1 is characterized in that: The step of calculating the first dimension coefficient and the second dimension coefficient of the dimension based on the target feature value of the dimension comprises: The first dimension coefficient and the second dimension coefficient are calculated based on the following formula: , ,in, is the first dimension coefficient of the current dimension, is the second dimension coefficient of the current dimension, represents the sequence number of the time window, represents the average sequence number of the time window, Indicates the target feature value corresponding to each time window of the current dimension, Represents the average value of the target feature values of all time windows of the current dimension, and the sequence numbers of the time windows are incremented from 1 according to the time sequence corresponding to the time windows.
3. The interface performance early warning method based on linear regression model according to claim 1 is characterized in that: The step of generating the target linear regression model based on the first target parameter value and the second target parameter value comprises: The first target parameter value is used as a constant of the target linear regression model, and the second target parameter value is used as a parameter of the independent variable of the target linear regression model to obtain the target linear regression model, wherein the target linear regression model formula is as follows: , represents the first target parameter value, Represents the second target parameter value.
4. The interface performance early warning method based on the linear regression model according to claim 1 is characterized in that: The step of predicting the interface characteristic value of the next time window based on the target linear regression model comprises: Add 1 to the maximum value of the sequence number of the time window to generate the sequence number of the next time window, and use the sequence number of the next time window as the value of the independent variable of the target linear regression model; The value of the independent variable of the target linear regression model is input into the target linear regression model to obtain the value of the dependent variable of the target linear regression model as the interface characteristic value.
5. The interface performance early warning method based on linear regression model according to claim 1 is characterized in that: After the step of obtaining the interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system, the method further includes: The interface performance characteristic data is saved in a database, and when a viewing request is received, the interface performance characteristic data is retrieved from the database and displayed on a front-end page.
6. An interface performance early warning device based on a linear regression model, characterized in that: include: An acquisition module is used to acquire interface performance characteristic data of the API interface corresponding to each proxy node of each distributed monitoring system based on a preset time window; A statistical module, used to count the interface performance characteristic data of each of the API interfaces according to the dimensions of the data, obtain the target characteristic value of each dimension, and construct a target linear regression model based on the target characteristic value; A prediction module, used for predicting the interface characteristic value of the next time window based on the target linear regression model; as well as An early warning module is used to determine whether the interface characteristic value exceeds the characteristic threshold. If the interface characteristic value exceeds the characteristic threshold, an early warning operation is performed to remind the developer to debug the API interface; The statistical module is further used to: respectively calculate the mean of each dimension of the interface performance characteristic data in each time window, and use the mean of each dimension as the target characteristic value of the corresponding dimension in the corresponding time window; The statistical module includes a first calculation submodule, a second calculation submodule and a linear model generation submodule, wherein the first calculation submodule is used to calculate the first dimension coefficient and the second dimension coefficient of the dimension based on the target feature value of the dimension; the second calculation submodule is used to calculate the mean of the first dimension coefficient and the mean of the second dimension coefficient of all dimensions, and use the mean of the first dimension coefficient as the first target parameter value and the mean of the second dimension coefficient as the second target parameter value; the linear model generation submodule is used to generate the target linear regression model based on the first target parameter value and the second target parameter value.
7. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the interface performance early warning method based on the linear regression model as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the interface performance early warning method based on the linear regression model as described in any one of claims 1 to 5 are implemented.
