Method and apparatus for determining access traffic threshold of interface, and electronic device
By determining the access traffic threshold separately based on the interface weight value in the application system, the problem of low accuracy in threshold determination in the existing technology is solved, and precise control of the interface access traffic threshold is achieved, meeting the business service needs of different interfaces.
Patent Information
- Application Number
- CN202310644872.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-06-01
AI Technical Summary
In existing technologies, the access traffic thresholds for different interfaces are determined in the same way, resulting in low accuracy in threshold determination and failing to meet the business service requirements of different interfaces.
By obtaining the weight value of each interface in the application system, interfaces with expected access traffic thresholds lower than the current threshold are filtered out, and the target access traffic thresholds are determined in descending order of weight value until the expected remaining resource volume meets the requirements, thus realizing the individual threshold determination for each interface.
It improved the accuracy of interface access traffic thresholds, ensured the priority allocation of resources to important interfaces, and met the business service needs of different interfaces.
Smart Images

Figure CN116684352B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, in particular to a method and device for determining access flow threshold of an interface and electronic equipment. BACKGROUND
[0002] In the running process of an application system, if the access requests processed by the application system are too many, the system load will be too high, and even the system will crash. Therefore, in order to ensure the normal operation of the application system, it is necessary to limit the access flow received by the application system.
[0003] In the process of flow limiting, the access frequency is usually calculated according to the total number of users accessing the application system and the cumulative access amount of the application system, and then the expected access amount of the application system is calculated according to the cumulative access amount and the access frequency, so that when the expected access amount approaches the system bottleneck, the threshold of all interfaces in the application system is uniformly adjusted, and a part of new user access is rejected, so as to ensure the normal operation of the system. However, when the same degree of access control is performed on different interfaces, the influence degree on business services is not the same, which can easily cause the phenomenon that part of the important business services are difficult to respond, and further has the problem of low threshold determination accuracy.
[0004] At present, no effective solution has been proposed for the above problems. SUMMARY
[0005] The embodiments of the present application provide a method and device for determining access flow threshold of an interface and electronic equipment, so as to at least solve the technical problem that the same method is used to determine the access flow threshold of different interfaces in the application system in the prior art, thereby the threshold determination accuracy is low.
[0006] According to an aspect of an embodiment of the present application, a method for determining an access traffic threshold of an interface is provided, comprising: obtaining a weight value matched by each of M interfaces in an application system, and determining an expected access traffic threshold of N interfaces of the M interfaces, wherein M and N are positive integers, and M is greater than or equal to N; selecting an interface with an expected access traffic threshold less than a current access traffic threshold from the M interfaces to obtain a first interface, and determining a first target access traffic threshold of the first interface, wherein the first target access traffic threshold is the expected access traffic threshold of the first interface or the current access traffic threshold of the first interface, and the current access traffic threshold is a traffic threshold used for access control of the interface at a current time point; determining a second target access traffic threshold of a second interface from the M interfaces except the first interface in a descending order of the weight values, until an expected remaining available resource amount of the application system is less than or equal to a target resource amount, wherein the second target access traffic threshold is determined by the expected access traffic threshold of the second interface or the current access traffic threshold of the second interface, and the expected remaining available resource amount is a resource amount allowed to be used when the interface processes access; updating the current access traffic threshold of the first interface to the first target access traffic threshold, and updating the current access traffic threshold of the second interface to the second target access traffic threshold.
[0007] Further, the method for determining the access traffic threshold of the interface further comprises: obtaining access information of the interface for each of the N interfaces; and determining the expected access traffic threshold of the interface according to the access information of the interface.
[0008] Further, the access information comprises access concurrency information of the interface, and the method for determining the access traffic threshold of the interface further comprises: determining an access concurrency matched at a start time point and an end time point of a first historical time range of the interface respectively; determining a change degree value of the access concurrency according to the access concurrency matched at the start time point and the access concurrency matched at the end time point; determining a processable access amount of the interface in a preset time range according to the access concurrency matched at a target historical time point and the average response time; and calculating a product of the change degree value and the processable access amount to obtain the expected access traffic threshold.
[0009] Further, the method for determining the access traffic threshold of the interface further comprises: obtaining access information of the first interface in a second historical time range, and determining a maximum change amplitude value of an access amount of the first interface in the second historical time range according to the access information; in a case where the maximum change amplitude value is less than an amplitude threshold, determining the expected access traffic threshold of the first interface as the first target access traffic threshold; and in a case where the maximum change amplitude value is greater than or equal to the amplitude threshold, determining the current access traffic threshold of the first interface as the first target access traffic threshold.
[0010] Further, the method for determining the access traffic threshold of the interface further comprises: determining whether the second interface has an expected access traffic threshold; in the case that the second interface has the expected access traffic threshold, determining the second target access traffic threshold according to the expected remaining available resource amount; in the case that the second interface does not have the expected access traffic threshold, determining the current access traffic threshold of the second interface as the second target access traffic threshold.
[0011] Further, the method for determining the access traffic threshold of the interface further comprises: determining a first resource amount matched by a threshold difference between the current access traffic threshold of the second interface and the expected access traffic threshold of the second interface; determining a first resource amount difference between the expected remaining available resource amount and the target resource amount; if the first resource amount difference is greater than or equal to the first resource amount, determining the expected access traffic threshold of the second interface as the second target access traffic threshold; if the first resource amount difference is less than the first resource amount, determining whether there is a target interface, wherein the target interface is an interface whose current access traffic threshold is greater than a preset threshold and whose weight value is less than the weight value of the second interface; in the case that there is the target interface, determining a target access traffic threshold of the target interface and updating the expected remaining available resource amount by adjusting the target access traffic threshold of the target interface until the second resource amount difference is greater than or equal to the first resource amount or until the target access traffic threshold of the target interface is equal to the preset threshold, wherein the second resource amount difference is a resource amount difference between the updated expected remaining available resource amount and the target resource amount; determining a threshold adjustment amount matched by the second resource amount difference, and determining the second target access traffic threshold according to the current access traffic threshold of the second interface and the threshold adjustment amount.
[0012] Further, the method for determining the access traffic threshold of the interface further comprises: after updating the current access traffic threshold of the second interface to the second target access traffic threshold, for each of the M interfaces, determining a threshold adjustment period matched by the interface according to the weight value matched by the interface; determining a target time at which the interface needs to determine the expected access traffic threshold next time according to the threshold adjustment period matched by the interface; in the case that the current time reaches the target time, redetermining the expected access traffic threshold of the interface.
[0013] According to another aspect of the embodiments of the present application, there is also provided a device for determining access traffic threshold of interfaces, comprising: an obtaining module, configured to obtain a weight value matched by each of M interfaces in an application system, and determine an expected access traffic threshold of N interfaces of the M interfaces, wherein M and N are positive integers, and M is greater than or equal to N; a first determining module, configured to filter out an interface with an expected access traffic threshold less than a current access traffic threshold from the M interfaces, to obtain a first interface, and determine a first target access traffic threshold of the first interface, wherein the first target access traffic threshold is the expected access traffic threshold of the first interface or the current access traffic threshold of the first interface, and the current access traffic threshold is a traffic threshold used for access control of the interface at a current time point; a second determining module, configured to determine an interface other than the first interface from the M interfaces as a second interface, and determine a second target access traffic threshold of the second interface in turn according to a weight value from high to low, until an expected remaining available resource amount of the application system is less than or equal to a target resource amount, wherein the second target access traffic threshold is determined by the expected access traffic threshold of the second interface or the current access traffic threshold of the second interface, and the expected remaining available resource amount is a resource amount allowed to be used when the interface processes access; and an updating module, configured to update the current access traffic threshold of the first interface to the first target access traffic threshold, and update the current access traffic threshold of the second interface to the second target access traffic threshold.
[0014] According to another aspect of the embodiments of the present application, there is also provided a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the above-mentioned method for determining access traffic threshold of interfaces when running.
[0015] According to another aspect of the embodiments of the present application, there is also provided an electronic device, which comprises one or more processors; a memory configured to store one or more programs, which cause the one or more processors to implement a program for running when the one or more programs are executed by the one or more processors, wherein the program is configured to execute the above-mentioned method for determining access traffic threshold of interfaces when running.
[0016] In the embodiment of the present application, the access flow threshold of each interface is determined separately, the weight value matched by each interface of the M interfaces in the application system is obtained, the expected access flow threshold of N interfaces of the M interfaces is determined, then the interface whose expected access flow threshold is less than the current access flow threshold is screened out from the M interfaces to obtain a first interface, and the first target access flow threshold of the first interface is determined, then the interfaces other than the first interface of the M interfaces are determined as second interfaces, and the second target access flow threshold of the second interfaces is determined in turn according to the order from high to low of the weight values, until the expected remaining available resource amount of the application system is less than or equal to the target resource amount, so that the current access flow threshold of the first interface is updated to the first target access flow threshold, and the current access flow threshold of the second interface is updated to the second target access flow threshold, wherein M and N are positive integers, and M is greater than or equal to N, the first target access flow threshold is the expected access flow threshold of the first interface or the current access flow threshold of the first interface, the current access flow threshold is the flow threshold used for access control of the interface at the current time point, the second target access flow threshold is determined by the expected access flow threshold of the second interface or the current access flow threshold of the second interface, and the expected remaining available resource amount is the resource amount allowed to be used when the interface processes access.
[0017] In the above process, the target access flow threshold of each interface is determined according to the expected access flow threshold or the current access flow threshold of the interface, the access flow threshold of each interface is determined separately, the accuracy of determining the access flow threshold of the interface is improved, and the influence of the same degree of access flow limitation on the business service of interfaces with different importance degrees is different, so that the actual business service demand of the application system cannot be met. In addition, the first target access flow threshold of the first interface of the M interfaces is determined first, the maximum expected remaining available resource amount of the application system at the current stage is determined, further, since the resource amount of the application system is limited, the second target access flow threshold of the second interface is determined in turn according to the weight value, so that the relatively more important interface can be allocated to the system resource amount more preferentially, and the accuracy of determining the access flow threshold of the interface is further improved.
[0018] Therefore, the scheme provided in the present application achieves the purpose of determining the access flow threshold of each interface separately, thereby achieving the technical effect of improving the accuracy of determining the access flow threshold of the interface, and further solving the technical problem that the access flow threshold of different interfaces in the application system is determined in the same way in the prior art, thereby the threshold determination accuracy is low. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0020] Figure 1 is a schematic diagram of an optional method for determining an access traffic threshold of an interface according to an embodiment of the application;
[0021] Figure 2 is a schematic diagram of an optional method for determining a first target access traffic threshold according to an embodiment of the application;
[0022] Figure 3 is a schematic diagram of an optional device for determining an access traffic threshold of an interface according to an embodiment of the application;
[0023] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the application. DETAILED DESCRIPTION
[0024] In order to make the personnel in the art better understand the application scheme, the technical scheme in the embodiments of the application will be described clearly and completely below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, but not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the protection scope of the application.
[0025] It should be noted that the terms "first", "second" and the like in the specification and claims of the application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0026] It should be noted that the method and device for determining an access traffic threshold of an interface and the electronic device of the present disclosure can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application field of the method and device for determining an access traffic threshold of an interface and the electronic device of the present disclosure is not limited.
[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.
[0028] Embodiment 1
[0029] According to the embodiments of the present application, an embodiment of a method for determining an access flow threshold of an interface is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.
[0030] Figure 1 is a schematic diagram of an optional method for determining an access flow threshold of an interface according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0031] Step S101, obtaining a weight value matched by each interface of M interfaces in an application system, and determining an expected access flow threshold of N interfaces of the M interfaces, wherein M and N are positive integers, and M is greater than or equal to N.
[0032] Optionally, the electronic device, application system, server and the like can be used as the execution subject of the method for determining the access flow threshold of the interface. In this embodiment, the target processing system is used as the execution subject to obtain the weight value matched by each interface of M interfaces in an application system. When the access flow of the interface reaches the expected access flow threshold, the application system will take some measures to limit the flow to a certain extent, such as delay processing, rejection processing, or partial rejection processing, etc.
[0033] Each of the M interfaces is used to provide different business services, and the weight value matched by each interface can be set by the staff according to the importance of the business service matched by the interface. The higher the weight value, the more important the interface.
[0034] Further, the target processing system can determine the expected access flow threshold of the interface at the corresponding time point according to the time period matched by each interface. Based on different time periods, at a certain time point, the target processing system may not determine the expected access flow threshold of all interfaces of the M interfaces, but only determine the expected access flow threshold of N interfaces of the M interfaces. The expected access flow threshold of the interface can be determined according to the access information of the interface, or can be determined according to other information.
[0035] Step S102, filtering out the first interface from the M interfaces, where the expected access traffic threshold of the first interface is less than the current access traffic threshold of the first interface, and determining a first target access traffic threshold of the first interface, where the first target access traffic threshold is the expected access traffic threshold of the first interface or the current access traffic threshold of the first interface, and the current access traffic threshold is a traffic threshold used for access control of the interface at a current time point.
[0036] Optionally, after determining the expected access traffic threshold of each of the N interfaces, the target processing system can obtain the current access traffic threshold of each of the M interfaces, where the current access traffic threshold is a traffic threshold used for access control of the interface. Further, the target processing system can compare the expected access traffic threshold and the current access traffic threshold of each of the M interfaces, and filter out the first interface according to the comparison result.
[0037] Further, the target processing system can determine the expected access traffic threshold of the first interface as the first target access traffic threshold according to the recent access information of the first interface, or determine the current access traffic threshold of the first interface as the first target access traffic threshold.
[0038] Step S103, determining the second interface as the interfaces other than the first interface from the M interfaces, and determining the second target access traffic threshold of the second interface in turn according to the order from high to low of the weight values, until the expected remaining available resource amount of the application system is less than or equal to the target resource amount, where the second target access traffic threshold is determined by the expected access traffic threshold of the second interface or the current access traffic threshold of the second interface, and the expected remaining available resource amount is the resource amount allowed to be used when the interface processes access.
[0039] The expected remaining available resource amount is not the actual remaining available resource amount of the application system at the current time point, and the expected remaining available resource amount is determined according to the first target access traffic threshold and the second target access traffic threshold of the application system, and the expected remaining available resource amount is negatively correlated with the first target access traffic threshold and the second target access traffic threshold. For example, when the first target access traffic threshold (or the second target access traffic threshold) of the first interface (or the second interface) is higher than the current access traffic threshold of the first interface (or the second interface), it can be determined that if the current access traffic threshold of the first interface (or the second interface) is updated to the first target access traffic threshold (or the second target access traffic threshold), the first interface (or the second interface) will need to receive and process more access at the same time, thereby occupying more resource amount, and further reducing the actual remaining available resource amount of the application system, that is, equivalent to reducing the expected remaining available resource amount.
[0040] Therefore, after the first target access traffic threshold of the first interface in the M interfaces is determined, the determination of the maximum expected remaining available resource amount in the current stage application system is achieved. Further, since the interfaces other than the first interface in the M interfaces need more resource amount, or the required resource amount remains unchanged, and since the resource amount in the application system is limited, the target processing system can preferentially allocate the resource amount of the application system to the relatively more important interfaces in the application system.
[0041] Specifically, the target processing system can first determine the second target access traffic threshold of the second interface with the highest weight value in descending order of weight values, and update the expected remaining available resource amount according to the newly determined second target access traffic threshold after the second target access traffic threshold is determined. Then, in the case that the expected remaining available resource amount is greater than or equal to the target resource amount, the second target access traffic threshold of the second interface with the second highest weight value is determined, and the expected remaining available resource amount is updated again. If the expected remaining available resource amount of the application system is less than or equal to the target resource amount, it can be determined that if the second target access traffic threshold of any subsequent second interface is set to be higher than the current access traffic threshold, the resource amount of the application system will be difficult to support the M interfaces to process access after the current access traffic threshold of the second interface is updated to the second target access traffic threshold. Therefore, in the case that the expected remaining available resource amount of the application system is less than or equal to the target resource amount, the determination of the second target access traffic threshold of the remaining second interfaces is stopped, and the current access traffic threshold of the remaining second interfaces is directly determined as the second target access traffic threshold.
[0042] In step S104, the current access traffic threshold of the first interface is updated to the first target access traffic threshold, and the current access traffic threshold of the second interface is updated to the second target access traffic threshold.
[0043] Optionally, after the current access traffic threshold of the first interface and the current access traffic threshold of the second interface are updated, the first interface is controlled by the first target access traffic threshold, and the second interface is controlled by the second target access traffic threshold.
[0044] Based on the scheme defined in steps S101 to S104, it can be known that, in the embodiment of the application, the access flow threshold of each interface is determined separately, the weight value matched by each interface in the M interfaces in the application system is obtained, the expected access flow threshold of N interfaces in the M interfaces is determined, then the interfaces with the expected access flow threshold less than the current access flow threshold are screened out from the M interfaces to obtain the first interface, the first target access flow threshold of the first interface is determined, then the interfaces other than the first interface in the M interfaces are determined as the second interface, and the second target access flow threshold of the second interface is determined in turn according to the order from high to low of the weight values, until the expected remaining available resource amount of the application system is less than or equal to the target resource amount, so as to update the current access flow threshold of the first interface to the first target access flow threshold, and update the current access flow threshold of the second interface to the second target access flow threshold, wherein M and N are positive integers, M is greater than or equal to N, the first target access flow threshold is the expected access flow threshold of the first interface or the current access flow threshold of the first interface, the current access flow threshold is the flow threshold for access control of the interface at the current time point, the second target access flow threshold is determined by the expected access flow threshold of the second interface or the current access flow threshold of the second interface, and the expected remaining available resource amount is the resource amount allowed to be used when the interface processes access.
[0045] It is easy to note that, in the above process, the target access flow threshold corresponding to each interface is determined according to the expected access flow threshold or the current access flow threshold of the interface, the access flow threshold of each interface is determined separately, the accuracy of determining the access flow threshold of the interface is improved, and when the access flow threshold of different interfaces in the application system is determined in the same way in the related art, although all interfaces are affected by the same degree of access flow limitation, the influence degree of the same degree of access flow limitation on the business service of interfaces with different importance degrees is different, so the actual business service demand of the application system cannot be met. In addition, the maximum expected remaining available resource amount in the application system at the current stage is determined by determining the first target access flow threshold of the first interface in the M interfaces first, and further, since the resource amount of the application system is limited, the second target access flow threshold of the second interface is determined in turn according to the weight value, so that the relatively more important interface can be allocated to the system resource amount more preferentially, thereby further improving the accuracy of determining the access flow threshold of the interface.
[0046] Therefore, the scheme provided in the application achieves the purpose of separately determining the access flow threshold of each interface, thereby achieving the technical effect of improving the accuracy of determining the access flow threshold of the interface, and further solving the technical problem of low threshold determination accuracy in the prior art that the same method is used to determine the access flow threshold of different interfaces in an application system.
[0047] In an optional embodiment, in the process of determining the expected access flow threshold of the N interfaces in the M interfaces, the target processing system can obtain the access information of each interface in the N interfaces, and then determine the expected access flow threshold of the interface according to the access information of the interface.
[0048] Optionally, in this embodiment, a monitoring point can be added in the application system in advance to collect access requests sent to the application system, and then the correspondence between each access request and the interface can be determined according to the parameters, URL (Uniform Resource Locator) and other information of the access request, so as to determine the access information of each interface according to the processing information of the access request corresponding to the interface, wherein the access information includes but is not limited to access concurrency, access response time and the like, and the processing information of the access request corresponding to each interface and the information of the interface can be stored in a database after format conversion for permanent storage.
[0049] Further, the target processing system can determine the expected access flow threshold of the interface according to the access information of the interface. For example, the expected access flow threshold is determined according to the access concurrency and the access response time of the interface, and for another example, the expected access flow threshold is determined according to the number of access requests per second and the access response time corresponding to the interface.
[0050] It should be noted that the expected access flow threshold of the interface can be accurately determined by determining the expected access flow threshold of the interface according to the access information of the interface.
[0051] In an optional embodiment, the access information includes access concurrency information of the interface, wherein in the process of determining the expected access flow threshold of the interface according to the access information of the interface, the target processing system can respectively determine the access concurrency matched at the start time point and the end time point of the first historical time range of the interface, and then determine the change degree value of the access concurrency according to the access concurrency matched at the start time point and the access concurrency matched at the end time point, and then determine the processable access amount of the interface in the preset time range according to the access concurrency matched at the target historical time point and the average response time, so as to calculate the product of the change degree value and the processable access amount to obtain the expected access flow threshold.
[0052] The first historical time range is one minute before the expected access flow threshold is determined, or another time range. The access concurrency matching the start time point refers to the access concurrency in one second starting from the start time point. The access concurrency matching the end time point refers to the access concurrency in one second ending at the end time point. After the access concurrent of the interface matching the start time point and the end time point in the first historical time range is determined, the target processing system can determine the change degree value of the access concurrency by the following formula:
[0053]
[0054] K1 represents the change degree value of the access concurrency, P1 represents the access concurrency matching the end time point, P2 represents the access concurrency matching the start time point, and T1 represents the time interval between the start time point and the end time point, in seconds.
[0055] Further, the target processing system can determine the processable access amount of the interface in the preset time range by the following formula:
[0056]
[0057] K2 represents the processable access amount of the interface in the preset time range. In the embodiment, the preset time range is one second. C represents the access concurrency matching the target historical time point, which refers to the access concurrency in one second ending at the target historical time point. The target historical time point can be a time point in one second before the expected access flow threshold is determined. T2 represents the average response time corresponding to the access concurrency matching the target historical time point.
[0058] Further, the product of the change degree value and the processable access amount can be calculated to obtain the expected access flow threshold.
[0059] It should be noted that the expected access flow threshold is determined according to the change trend of the historical access concurrency and the access concurrency of the target historical time point, so that the expected access flow threshold is accurately determined.
[0060] In an alternative embodiment, Figure 2 is a schematic diagram of determining a first target access flow threshold according to an embodiment of the present application, as Figure 2 shown, in the process of determining the first target access flow threshold of the first interface, the target processing system can perform the following steps:
[0061] In step S201, the access information of the first interface in a second historical time range is obtained, and a maximum change range value of the access amount of the first interface in the second historical time range is determined according to the access information.
[0062] Optionally, for the interface whose access traffic threshold needs to be reduced, i.e., for the first interface, the fluctuation of the historical access amount of the interface can be determined first, so that when the fluctuation is small, it is determined that the current access traffic threshold of the first interface can be reduced, and when the fluctuation is large, the current access traffic threshold of the first interface is kept unchanged.
[0063] Specifically, the target processing system can obtain the access information of the first interface in a second historical time range, and the second historical time range can be the previous day of the current date or other time ranges. Then, the target processing system can determine the access amount per second in the second historical time range, so as to determine the highest access amount per second and the lowest access amount per second in the second historical time range. Further, the target processing system can subtract the lowest access amount per second from the highest access amount per second, so as to obtain the maximum change range value of the access amount of the first interface in the second historical time range.
[0064] In step S202, when the maximum change range value is less than the range threshold, the expected access traffic threshold of the first interface is determined as the first target access traffic threshold.
[0065] In step S203, when the maximum change range value is greater than or equal to the range threshold, the current access traffic threshold of the first interface is determined as the first target access traffic threshold.
[0066] It should be noted that by determining the first target access traffic threshold of the first interface according to the recent access amount of the first interface, the accurate determination of the first target access traffic threshold is realized.
[0067] In an optional embodiment, in the process of determining the second target access traffic threshold of the second interface, the target processing system can determine whether the second interface has an expected access traffic threshold, so that in the case that the expected access traffic threshold exists, the second target access traffic threshold is determined according to the expected remaining available resource amount, and in the case that the expected access traffic threshold does not exist, the current access traffic threshold of the second interface is determined as the second target access traffic threshold.
[0068] Optionally, if no new access traffic threshold is determined for the second interface, i.e., the second interface has no corresponding expected access traffic threshold, the current access traffic threshold of the second interface is determined as the second target access traffic threshold, i.e., the current access traffic threshold of the second interface remains unchanged. Conversely, if the second interface has a corresponding expected access traffic threshold, the second target access traffic threshold can be determined according to the expected remaining available resource amount. For example, the target processing system can determine a resource amount matched by a threshold difference between the current access traffic threshold of the second interface and the expected access traffic threshold of the second interface, obtaining a first resource amount, then determine a first resource amount difference between the expected remaining available resource amount and the target resource amount, so that in the case that the first resource amount difference is greater than or equal to the first resource amount, the expected access traffic threshold of the second interface is determined as the second target access traffic threshold, in the case that the first resource amount difference is less than the first resource amount, a threshold adjustment amount matched by the first resource amount difference is determined, then the current access traffic threshold of the second interface is added by the threshold adjustment amount matched by the first resource amount difference, so as to obtain the second target access traffic threshold.
[0069] It should be noted that by determining the determination manner of the second target access traffic threshold according to whether the second interface has an expected access traffic threshold, accurate determination of the second target access traffic threshold is realized.
[0070] In an optional embodiment, in the process of determining the second target access traffic threshold according to the expected remaining available resource amount, the target processing system can determine a resource amount matched by a threshold difference between the current access traffic threshold of the second interface and the expected access traffic threshold of the second interface, obtaining a first resource amount, then determine a first resource amount difference between the expected remaining available resource amount and the target resource amount, so that if the first resource amount difference is greater than or equal to the first resource amount, the expected access traffic threshold of the second interface is determined as the second target access traffic threshold, if the first resource amount difference is less than the first resource amount, it is determined whether there is a target interface, then in the case that there is a target interface, a target access traffic threshold of the target interface is determined, and the expected remaining available resource amount is updated by adjusting the target access traffic threshold of the target interface, until the second resource amount difference is greater than or equal to the first resource amount, or until the target access traffic threshold of the target interface is equal to a preset threshold, a threshold adjustment amount matched by the second resource amount difference is determined, and the second target access traffic threshold is determined according to the current access traffic threshold of the second interface and the threshold adjustment amount. Wherein, the target interface is an interface whose current access traffic threshold is greater than the preset threshold and whose weight value is less than the weight value of the second interface, and the second resource amount difference is a resource amount difference between the updated expected remaining available resource amount and the target resource amount.
[0071] In the case that the target processing system expects the remaining available resource amount to support an increase of the current access traffic threshold of the second interface to the desired access traffic threshold, the target processing system changes the current access traffic threshold of the second interface. In the case that the target processing system expects the remaining available resource amount to be insufficient to support an increase of the current access traffic threshold of the second interface to the desired access traffic threshold, the target processing system determines whether there is an interface with a smaller weight and meeting the condition, and if so, preferentially increases the current access traffic threshold of the current second interface and decreases the current access traffic threshold of the interface with a smaller weight. If there is no interface with a smaller weight or meeting the condition, the target processing system keeps the current access traffic threshold of the current second interface unchanged.
[0072] Specifically, in the case that the first resource amount difference is smaller than the first resource amount, the target processing system determines whether there is a target interface in the M interfaces, each of which corresponds to a preset threshold, and the current access traffic threshold of each interface cannot be smaller than or equal to the preset threshold to avoid failure to provide service, and when the current access traffic threshold of an interface is equal to the preset threshold, it means that the current access traffic threshold of the interface cannot be continuously decreased.
[0073] Further, if there is a target interface, the target processing system can also determine a target access traffic threshold of the target interface. In this stage, i.e., in the stage of determining the second target access traffic threshold of the second interface, the target processing system can directly determine the current access traffic threshold of the second interface as the target access traffic threshold, and then continuously decrease the target access traffic threshold of the target interface to continuously determine a new expected remaining available resource amount according to the adjusted target access traffic threshold until the second resource amount difference meets the desired access traffic threshold as the second target access traffic threshold, or until the current access traffic threshold of all target interfaces cannot be further decreased, i.e., until the target access traffic threshold of the target interface is equal to the preset threshold.
[0074] Further, the target processing system can determine a threshold adjustment amount matched with the second resource amount difference, so that in the case that the threshold adjustment amount matched with the second resource amount difference does not meet the adjustment of the current access traffic threshold of the second interface to the desired access traffic threshold, the threshold adjustment amount matched with the second resource amount difference is added to the current access traffic threshold of the second interface to obtain the second target access traffic threshold.
[0075] Conversely, if the threshold adjustment amount matched with the second resource amount difference meets the adjustment of the current access traffic threshold of the second interface to the desired access traffic threshold, the desired access traffic threshold of the second interface is determined as the second target access traffic threshold.
[0076] Optionally, if the target interface does not exist, a threshold adjustment amount matched with the first resource amount difference value is directly determined, and then the current access flow threshold value of the second interface is added with the threshold adjustment amount matched with the first resource amount difference value, so as to obtain the second target access flow threshold value.
[0077] If the target interface is one of the second interfaces, and when the size order of the weight values is reached to need to determine the second target access flow threshold value of the target interface, the step of determining whether the second interface exists the expected access flow threshold value includes: determining whether the second interface exists the target access flow threshold value; if the second interface exists the target access flow threshold value, determining the target access flow threshold value as the second target access flow threshold value of the second interface; if the second interface does not exist the target access flow threshold value, determining whether the second interface exists the expected access flow threshold value.
[0078] If the target interface is one of the first interfaces, after the target access flow threshold value of the interface is determined, the target access flow threshold value is determined as the first target access flow threshold value of the interface.
[0079] It should be noted that by allocating the resource amount occupied by the interface with lower weight to the second interface with relatively higher weight when the first resource amount difference value is less than the first resource amount, the quality of the service provided by the second interface is effectively guaranteed.
[0080] In an optional embodiment, after the current access flow threshold value of the second interface is updated as the second target access flow threshold value, the target processing system can determine, for each of the M interfaces, a threshold adjustment period matched with the interface according to the weight value matched with the interface, and then determine a target time when the expected access flow threshold value of the interface needs to be determined next time according to the threshold adjustment period matched with the interface, so that the expected access flow threshold value of the interface is re-determined when the current time reaches the target time.
[0081] Optionally, different weight values are matched with different threshold adjustment periods, and therefore the target processing system can determine the threshold adjustment period matched with the interface according to the weight value matched with the interface, so as to constantly re-determine the expected access flow threshold value of the interface according to the threshold adjustment period.
[0082] It should be noted that by constantly determining the expected access flow threshold value of the interface according to the threshold adjustment period of the interface, the expected access flow threshold value of the interface is timely adjusted according to the access information of the interface, so as to improve the accurate determination of the access flow threshold value of the interface.
[0083] In an alternative embodiment, the target processing system can also visualize the second target access traffic threshold of each interface or the second target access traffic threshold, so as to facilitate the staff to more intuitively and deeply check the traffic limiting of each interface. In addition, the target processing system can also provide a function of manually adjusting the access traffic threshold of the interface, thereby improving the applicability of the present application.
[0084] Therefore, the scheme provided by the present application achieves the purpose of separately determining the access traffic threshold of each interface, thereby achieving the technical effect of improving the accuracy of determining the access traffic threshold of the interface, and further solving the technical problem in the prior art that the same method is used to determine the access traffic threshold of different interfaces in an application system, thereby resulting in low threshold determination accuracy.
[0085] Embodiment 2
[0086] According to the embodiment of the present application, an embodiment of a determination device for an access traffic threshold of an interface is provided, wherein, Figure 3 is a schematic diagram of an alternative determination device for an access traffic threshold of an interface according to an embodiment of the present application, as Figure 3 shown, the device comprises:
[0087] The acquisition module 301 is configured to acquire a weight value matched by each interface of M interfaces in an application system, and determine an expected access traffic threshold of N interfaces of the M interfaces, wherein M and N are positive integers, and M is greater than or equal to N;
[0088] The first determination module 302 is configured to filter out an interface with an expected access traffic threshold less than a current access traffic threshold from the M interfaces, to obtain a first interface, and determine a first target access traffic threshold of the first interface, wherein the first target access traffic threshold is the expected access traffic threshold of the first interface or the current access traffic threshold of the first interface, and the current access traffic threshold is a traffic threshold used for access control of the interface at a current time point;
[0089] The second determination module 303 is configured to determine the interfaces other than the first interface in the M interfaces as second interfaces, and in turn determine a second target access traffic threshold of the second interfaces in a descending order of the weight values, until an expected remaining available resource amount of the application system is less than or equal to a target resource amount, wherein the second target access traffic threshold is determined by the expected access traffic threshold of the second interface or the current access traffic threshold of the second interface, and the expected remaining available resource amount is a resource amount allowed to be used when the interface processes access;
[0090] The update module 304 is configured to update the current access traffic threshold of the first interface to the first target access traffic threshold, and update the current access traffic threshold of the second interface to the second target access traffic threshold.
[0091] It should be noted that the above acquisition module 301, the first determination module 302, the second determination module 303 and the update module 304 correspond to steps S101 to S104 in the above embodiment, and the four modules have the same examples and application scenarios as the corresponding steps, but are not limited to the content disclosed in the above embodiment 1.
[0092] Optionally, the acquisition module 301 further comprises: a first acquisition submodule, configured to acquire access information of the interface for each of the N interfaces; and a first determination submodule, configured to determine the expected access traffic threshold of the interface according to the access information of the interface.
[0093] Optionally, the access information comprises access concurrency information of the interface, and the first determination submodule further comprises: a second determination submodule, configured to determine access concurrency matched at a starting time point and an ending time point of the first historical time range of the interface, respectively; a third determination submodule, configured to determine a change degree value of the access concurrency according to the access concurrency matched at the starting time point and the access concurrency matched at the ending time point; and a fourth determination submodule, configured to determine a processable access amount of the interface in the preset time range according to the access concurrency matched at the target historical time point and the average response time; and a calculation submodule, configured to calculate a product of the change degree value and the processable access amount to obtain the expected access traffic threshold.
[0094] Optionally, the first determination module 302 further comprises: a second acquisition submodule, configured to acquire access information of the first interface in a second historical time range, and determine a maximum change amplitude value of the access amount of the first interface in the second historical time range according to the access information; a fifth determination submodule, configured to determine the expected access traffic threshold of the first interface as the first target access traffic threshold in a case where the maximum change amplitude value is less than an amplitude threshold; and a sixth determination submodule, configured to determine the current access traffic threshold of the first interface as the first target access traffic threshold in a case where the maximum change amplitude value is greater than or equal to the amplitude threshold.
[0095] Optionally, the second determination module 303 further comprises: a seventh determination submodule, configured to determine whether the second interface has an expected access traffic threshold; an eighth determination submodule, configured to determine the second target access traffic threshold according to the expected remaining available resource amount in a case where the second interface has the expected access traffic threshold; and a ninth determination submodule, configured to determine the current access traffic threshold of the second interface as the second target access traffic threshold in a case where the second interface does not have the expected access traffic threshold.
[0096] Optionally, the eighth determining sub-module further includes: a first determining unit, configured to determine a resource amount matched by a threshold difference between the current access traffic threshold of the second interface and the expected access traffic threshold of the second interface, to obtain a first resource amount; a second determining unit, configured to determine a first resource amount difference between the expected remaining available resource amount and the target resource amount; a third determining unit, configured to determine the expected access traffic threshold of the second interface as the second target access traffic threshold if the first resource amount difference is greater than or equal to the first resource amount; a judging unit, configured to determine whether there is a target interface if the first resource amount difference is less than the first resource amount, wherein the target interface is an interface whose current access traffic threshold is greater than the preset threshold and whose weight value is less than the weight value of the second interface; a fourth determining unit, configured to determine a target access traffic threshold of the target interface and update the expected remaining available resource amount by adjusting the target access traffic threshold of the target interface if the target interface exists, until the second resource amount difference is greater than or equal to the first resource amount, or until the target access traffic threshold of the target interface is equal to the preset threshold, wherein the second resource amount difference is a resource amount difference between the updated expected remaining available resource amount and the target resource amount; and a fifth determining unit, configured to determine a threshold adjustment amount matched by the second resource amount difference, and determine the second target access traffic threshold according to the current access traffic threshold of the second interface and the threshold adjustment amount.
[0097] Optionally, the apparatus for determining the access traffic threshold of an interface further includes: a third determining module, configured to determine, for each of the M interfaces, a threshold adjustment period matched by the interface according to the weight value matched by the interface; a fourth determining module, configured to determine a target time at which the expected access traffic threshold of the interface needs to be determined next time according to the threshold adjustment period matched by the interface; and a fifth determining module, configured to redetermine the expected access traffic threshold of the interface if the current time reaches the target time.
[0098] Embodiment 3
[0099] According to another aspect of the embodiments of the present application, a computer readable storage medium is further provided, and the computer readable storage medium stores a computer program. The computer program is configured to execute the above-mentioned method for determining the access traffic threshold of an interface when running.
[0100] Embodiment 4
[0101] According to another aspect of the embodiments of the present application, an electronic device is further provided, and the electronic device includes: Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, as Figure 4As shown, the electronic device includes one or more processors; a memory for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement a program for running, wherein the program is configured to perform the above-described method for determining the access traffic threshold of the interface when running.
[0102] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0103] In the above-described embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0104] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of units can be a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0105] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. According to actual needs, part or all of the units can be selected to achieve the purpose of the present embodiment scheme.
[0106] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0107] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0108] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A method for determining the access traffic threshold of an interface, characterized in that, include: Obtain the weight value matched by each of the M interfaces in the application system, and determine the expected access traffic threshold of N interfaces among the M interfaces, where M and N are positive integers, and M is greater than or equal to N; The determination of the expected access traffic threshold for N interfaces out of the M interfaces includes: for each of the N interfaces, obtaining the access information of the interface, wherein the access information includes the access concurrency information of the interface; and determining the expected access traffic threshold of the interface based on the access information of the interface. From the N interfaces, the interfaces whose expected access traffic threshold is less than the current access traffic threshold are selected to obtain the first interface, and the first target access traffic threshold of the first interface is determined. The first target access traffic threshold is the expected access traffic threshold of the first interface or the current access traffic threshold of the first interface. The current access traffic threshold is the traffic threshold used for access control of the interface at the current time point. The method of determining the first target access traffic threshold of the first interface includes: obtaining access information of the first interface within a second historical time range, and determining the maximum change range of the access volume of the first interface within the second historical time range based on the access information; if the maximum change range is less than the range threshold, determining the expected access traffic threshold of the first interface as the first target access traffic threshold; if the maximum change range is greater than or equal to the range threshold, determining the current access traffic threshold of the first interface as the first target access traffic threshold. The interfaces other than the first interface among the M interfaces are identified as the second interfaces. The second target access traffic thresholds of the second interfaces are determined in descending order of the weight values until the expected remaining available resources of the application system are less than or equal to the target resource amount. The second target access traffic threshold is determined by the expected access traffic threshold of the second interface or the current access traffic threshold of the second interface. The expected remaining available resources are the amount of resources allowed to be used when the interface processes access. The method of determining the second target access traffic threshold of the second interface includes: determining whether the second interface has the expected access traffic threshold; if the expected access traffic threshold exists, determining the second target access traffic threshold based on the expected remaining available resources; if the expected access traffic threshold does not exist, determining the current access traffic threshold of the second interface as the second target access traffic threshold. Update the current access traffic threshold of the first interface to the first target access traffic threshold, and update the current access traffic threshold of the second interface to the second target access traffic threshold.
2. The method according to claim 1, characterized in that, Based on the access information of the interface, determine the expected access traffic threshold of the interface, including: Determine the number of concurrent accesses matching the start and end times of the interface within the first historical time range; The degree of change in access concurrency is determined based on the access concurrency matched at the start time point and the access concurrency matched at the end time point. The number of concurrent accesses and the average response time matched with the target historical time point are used to determine the number of accesses that the interface can handle within a preset time range. The expected access traffic threshold is obtained by multiplying the change level value by the processable access volume.
3. The method according to claim 1, characterized in that, Determining the second target access traffic threshold based on the expected remaining available resources includes: The resource quantity matched by the threshold difference between the current access traffic threshold of the second interface and the expected access traffic threshold of the second interface is determined to obtain the first resource quantity; Determine a first resource quantity difference between the expected remaining available resource quantity and the target resource quantity; If the difference in the first resource quantity is greater than or equal to the first resource quantity, then the expected access traffic threshold of the second interface is determined as the second target access traffic threshold. If the difference in the first resource quantity is less than the first resource quantity, then it is determined whether there is a target interface, wherein the target interface is an interface whose current access traffic threshold is greater than a preset threshold and whose weight value is less than the weight value of the second interface; In the presence of the target interface, a target access traffic threshold for the target interface is determined, and the expected remaining available resource quantity is updated by adjusting the target access traffic threshold of the target interface until the second resource quantity difference is greater than or equal to the first resource quantity, or until the target access traffic threshold of the target interface is equal to the preset threshold, wherein the second resource quantity difference is the resource quantity difference between the updated expected remaining available resource quantity and the target resource quantity. Determine the threshold adjustment amount for matching the second resource quantity difference, and determine the second target access traffic threshold based on the current access traffic threshold of the second interface and the threshold adjustment amount.
4. The method according to claim 1, characterized in that, After updating the current access traffic threshold of the second interface to the second target access traffic threshold, the method further includes: For each of the M interfaces, the threshold adjustment period for interface matching is determined based on the weight value of the interface matching. Based on the threshold adjustment cycle matched by the interface, determine the target time when the interface needs to determine the next expected access traffic threshold; If the target time is reached at the current time, the expected access traffic threshold for the interface is redefined.
5. A device for determining the access traffic threshold of an interface, characterized in that, include: The acquisition module is used to acquire the weight value matched by each of the M interfaces in the application system, and to determine the expected access traffic threshold of N interfaces among the M interfaces, where M and N are positive integers, and M is greater than or equal to N; The acquisition module includes: a first acquisition submodule, used to acquire access information for each of the N interfaces, wherein the access information includes access concurrency information of the interface; and a first determination submodule, used to determine the expected access traffic threshold of the interface based on the access information of the interface. The first determining module is used to filter out the interfaces from the N interfaces whose expected access traffic threshold is less than the current access traffic threshold, to obtain the first interface, and to determine the first target access traffic threshold of the first interface, wherein the first target access traffic threshold is the expected access traffic threshold of the first interface or the current access traffic threshold of the first interface, and the current access traffic threshold is the traffic threshold used for access control of the interface at the current time point. The first determining module includes: a second obtaining submodule, configured to obtain access information of the first interface within a second historical time range, and determine the maximum change range of the access volume of the first interface within the second historical time range based on the access information; a fifth determining submodule, configured to determine the expected access traffic threshold of the first interface as the first target access traffic threshold when the maximum change range is less than the amplitude threshold; and a sixth determining submodule, configured to determine the current access traffic threshold of the first interface as the first target access traffic threshold when the maximum change range is greater than or equal to the amplitude threshold. The second determining module is used to determine the interfaces other than the first interface among the M interfaces as the second interfaces, and to determine the second target access traffic threshold of the second interfaces in descending order of the weight values, until the expected remaining available resources of the application system are less than or equal to the target resource amount. The second target access traffic threshold is determined by the expected access traffic threshold of the second interface or the current access traffic threshold of the second interface, and the expected remaining available resources are the amount of resources allowed to be used when the interface processes access. The second determining module includes: a seventh determining submodule, used to determine whether the second interface has the expected access traffic threshold; an eighth determining submodule, used to determine the second target access traffic threshold based on the expected remaining available resources if the expected access traffic threshold exists; and a ninth determining submodule, used to determine the current access traffic threshold of the second interface as the second target access traffic threshold if the expected access traffic threshold does not exist. The update module is used to update the current access traffic threshold of the first interface to the first target access traffic threshold, and to update the current access traffic threshold of the second interface to the second target access traffic threshold.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute, at runtime, a method for determining the access traffic threshold of the interface as described in any one of claims 1 to 4.
7. An electronic device, characterized in that, The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to run the programs, wherein the programs are configured to execute, at runtime, the method for determining the access traffic threshold of the interface as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Flow control method and device, electronic equipment and storage medium
CN111262791A
Access behavior detection method and device, equipment, medium and product
CN115935394A