Flow control method, server, electronic device and computer readable storage medium
By acquiring historical access information from business systems and calculating health information across multiple time dimensions, the traffic control strategy is dynamically adjusted, overcoming the shortcomings of rigid flow control methods and achieving efficient, real-time traffic management, thereby improving system stability and resource utilization efficiency.
Patent Information
- Application Number
- CN202210678901.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-06-16
AI Technical Summary
In existing technologies, fixed flow control methods are difficult to adapt to the performance improvements after the hardware upgrade of business systems, resulting in resource waste and poor real-time performance. They cannot effectively control the access traffic of business systems, affecting system stability and efficiency.
By acquiring historical access information of the target business system at regular intervals, calculating its independent health information across multiple time dimensions, and combining this comprehensive health information to determine real-time traffic control strategies, the traffic control of access requests is dynamically adjusted.
It achieves efficient and real-time flow control, can adapt to the updates and iterations of business systems in a timely manner, improves the accuracy of flow control and the stability of the system, and reduces resource waste.
Smart Images

Figure CN117294652B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and in particular to a traffic control method, a server, an electronic device, and a computer-readable storage medium. Background Technology
[0002] With the development of internet technology, more and more people are accessing business systems via the internet to conduct their required business. These business systems can be, for example, the service systems of banking institutions, online ticketing systems, and payment systems of payment institutions. For instance, people can initiate payment settlement, deposit, or withdrawal service requests to a banking institution's service system via the internet.
[0003] Because the ability of a business system to handle object access is limited by hardware performance, a large number of simultaneous object accesses can disrupt its normal operation. To prevent this, a fixed flow control approach is typically used to manage traffic, i.e., a fixed access limit is set, and rate limiting is implemented when the real-time access volume exceeds this limit. However, with the improvement of internet hardware performance and the continuous upgrading of various business systems, throughput has also increased. The existing fixed flow control method cannot fully utilize the new performance of upgraded or optimized systems, resulting in resource waste, unless the access limits of each business system are manually reconfigured. Clearly, this approach is inefficient, lacks real-time performance, and cannot keep pace with the rapid pace of technological updates in the current internet landscape. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a traffic control method, a server, an electronic device, and a computer-readable storage medium, which can achieve efficient and real-time precise dynamic control of access traffic to a business system.
[0005] One aspect of this invention provides a flow control method, comprising:
[0006] Every preset time interval, historical access status information of the target business system is obtained; wherein, the historical access status information is used to characterize the traffic status of the target business system being accessed;
[0007] Based on the historical access information, the independent health information of the target business system under multiple different time dimensions is determined, and the comprehensive health information of the target business system is determined based on each independent health information; wherein, each independent health information is used to characterize the response level of the target business system under the corresponding time dimension, and the comprehensive health information is used to characterize the overall response level of the target business system; the degree of influence of the independent health information under different time dimensions on determining the comprehensive health information is different;
[0008] Based on the comprehensive health information, determine the real-time traffic control strategy for the target business system;
[0009] Traffic control is applied to the target access requests according to the real-time traffic control strategy.
[0010] Another aspect of the present invention provides a server, comprising:
[0011] The first module is used to acquire historical access status information of the target business system after a preset time interval; wherein, the historical access status information is used to characterize the traffic status of the target business system being accessed.
[0012] The second module is used to determine the independent health information of the target business system under multiple different time dimensions based on the historical access status information, and to determine the comprehensive health information of the target business system based on each independent health information; wherein, each independent health information is used to characterize the response level of the target business system under the corresponding time dimension, and the comprehensive health information is used to characterize the overall response level of the target business system; the degree of influence of the independent health information under different time dimensions on determining the comprehensive health information is different;
[0013] The third module is used to determine the real-time traffic control strategy of the target business system based on the comprehensive health information.
[0014] The fourth module is used to perform traffic control on the target access request according to the real-time traffic control strategy.
[0015] Optionally, the first module includes at least one of the following:
[0016] The first unit is used to obtain the initiation time information of the access requests to the target business system within a historical time period;
[0017] The second unit is used to obtain the time consumption information of access requests to the target business system within a historical time period;
[0018] The third unit is used to obtain access success and failure information of the target business system within a historical time period;
[0019] The fourth unit is used to obtain object information of access requests to the target business system within a historical time period, wherein the object information includes the identifier of the business system to be requested and the identifier of the current access request.
[0020] The fifth unit is used to obtain the total number of access requests to the target business system within a historical time period.
[0021] Optionally, the second module includes:
[0022] The sixth unit is used to calculate the average time consumption information of the target business system and the unit time statistics of the target business system under different time dimensions based on the historical access status information.
[0023] The seventh unit is used to calculate the independent health information under each time dimension based on the average time consumption information and the unit time statistics under different time dimensions.
[0024] The eighth unit is used to calculate the comprehensive health information based on the independent health information under each time dimension.
[0025] Optionally, the sixth unit includes:
[0026] The ninth unit is used to calculate the total number of requests to the target business system per unit time based on the total number of access requests to the target business system within the historical time period.
[0027] The tenth unit is used to calculate the number of successful requests to the target business system per unit time based on the success and failure information of access requests to the target business system within the historical time period.
[0028] The eleventh unit is used to calculate the average time consumption of the target business system per unit time based on the time consumption information of access requests to the target business system within the historical time period.
[0029] The twelfth unit is used to calculate the percentage coefficient of the successful request volume based on the total number of requests to the target business system within a unit of time and the number of successful requests to the target business system within a unit of time.
[0030] Optionally, the seventh unit includes:
[0031] The thirteenth unit is used to calculate independent health information for each time dimension based on the average time consumption information of the target business system under historical access conditions, the total number of requests of the target business system per unit time, the number of successful requests per unit time, the average time consumption per unit time, and the percentage coefficient of the number of successful requests.
[0032] Optionally, the eighth unit includes:
[0033] The fourteenth unit is used to configure the weight thresholds of independent health information under each time dimension; wherein, the weight thresholds of independent health information are used to characterize the degree of influence of the current independent health information on the comprehensive health information;
[0034] The fifteenth unit is used to perform weighted calculations on each independent health information according to the weight threshold of each independent health information to obtain the comprehensive health information; wherein, the weight threshold of the independent health information in the time dimension closer to the current time is greater than the weight threshold of the independent health information in the time dimension farther from the current time.
[0035] Optionally, the server may also include:
[0036] The fifth module is used to determine the preset query rate coefficient per second corresponding to the health range in which the comprehensive health information is located.
[0037] The sixth module is used to calculate the actual query rate per second of the target business system based on the maximum query rate per second of the target business system and the preset query rate per second coefficient.
[0038] The seventh module is used to determine the real-time traffic control strategy of the target business system based on the actual query rate per second of the target business system.
[0039] Optionally, the server may also include:
[0040] The eighth module is used to continuously send probing requests to the target business system when the target business system is in a disconnected state, until it is determined that the target business system has restored its connection state based on the response information received from the target business system.
[0041] The ninth module is used to send access requests corresponding to each traffic opening threshold to the target business system in sequence according to a preset set of traffic opening thresholds; wherein, the set of traffic opening thresholds includes multiple traffic opening thresholds at different time points, and each traffic opening threshold is used to characterize the maximum number of access requests that the target business system can receive at each time point.
[0042] Optionally, the ninth module includes:
[0043] The sixteenth unit is used to select the smallest first traffic opening threshold from the set of traffic opening thresholds as the current traffic opening threshold, and send a first set of access requests less than the current traffic opening threshold to the target business system that has recovered its connection status.
[0044] The seventeenth unit is used to select a second traffic opening threshold that is greater than the first traffic opening threshold from the traffic opening threshold set according to the threshold size when the request processing success rate of the first access request set meets the target ratio, and send a second access request set that meets the current traffic opening threshold to the target business system, until the largest traffic opening threshold in the traffic opening threshold set is used as the current traffic opening threshold.
[0045] Optionally, the server may also include at least one of the following:
[0046] The tenth module is used to configure the system maintenance information of the target business system; wherein, the system maintenance information is used to characterize the inaccessibility time of the target business system;
[0047] The eleventh module is used to configure the blacklist request table and whitelist request table of the target business system, wherein access requests in the blacklist request table are configured to be unable to access the target business system, and access requests in the whitelist request table are configured to be able to access the target business system.
[0048] The twelfth module is used to configure the maximum number of requests that the target business system can support per unit of time.
[0049] Optionally, the server may also include at least one of the following:
[0050] The thirteenth module is used to obtain the current traffic opening threshold of the target business system according to the real-time traffic control policy. When the current access volume of the target business system is greater than the current traffic opening threshold, the rate limiting status of the target access request is determined to be inaccessible. When the current access volume of the target business system is less than or equal to the current traffic opening threshold, the rate limiting status of the target access request is determined to be accessible.
[0051] The fourteenth module is used to obtain the blacklist request table and whitelist request table of the target business system according to the real-time traffic control policy, identify the request identity of the target access request according to the blacklist request table and the whitelist request table, and determine the rate limiting status of the target access request as an accessible status when the target access request is a whitelist request; and determine the rate limiting status of the target access request as an inaccessible status when the target access request is a blacklist request.
[0052] The fifteenth module is used to perform traffic control on the target access request based on the rate limiting status of the target access request.
[0053] Another aspect of the present invention provides an electronic device, including a processor and a memory;
[0054] The memory is used to store programs;
[0055] The processor executes the program to implement the method described above.
[0056] Another aspect of this invention provides a computer-readable storage medium storing a program that is executed by a processor to implement the methods described above.
[0057] Another aspect of the present invention provides a computer program that, when executed by a processor, implements the method described above.
[0058] In embodiments of the present invention, historical access status information of the target business system is acquired periodically to understand the real-time traffic status of the target business system. This allows for the calculation of independent health information of the target business system across multiple time dimensions. Based on this independent health information, the overall health information of the target business system is determined, and a real-time traffic control strategy is established to control the traffic of target access requests. By acquiring historical access status information of the target business system periodically, this invention can adapt to the timely updates and iterations of the target business system. It generates corresponding real-time traffic control strategies based on the real-time status of the target business system, ultimately achieving precise dynamic traffic control of target access requests. This approach is highly efficient and real-time, effectively adapting to the rapid pace of technological updates in the current internet landscape. Furthermore, this invention can determine the independent health information of the target business system across multiple time dimensions based on historical access status information, and then determine the overall health information of the target business system based on these independent health information. By combining the overall response level of the target business system across multiple time dimensions to determine the real-time traffic control strategy, the real-time traffic control strategy reflects the degree of influence across different time dimensions, further improving the accuracy of the real-time traffic control strategy. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present invention;
[0061] Figure 2 A flowchart illustrating the steps of a flow control method provided in an embodiment of the present invention;
[0062] Figure 3 A flowchart illustrating the steps for calculating comprehensive health information provided in this embodiment of the invention;
[0063] Figure 4 A flowchart illustrating the steps of the target business system recovery method provided in this embodiment of the invention;
[0064] Figure 5 A schematic diagram illustrating the "fast start, slow boost" target business system recovery method provided in this embodiment of the invention;
[0065] Figure 6 A schematic diagram of the architecture of the flow control system provided in an embodiment of the present invention;
[0066] Figure 7 Flowchart of steps to access the banking system;
[0067] Figure 8 This is a schematic diagram of the server structure provided in an embodiment of the present invention. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0069] To facilitate understanding of the embodiments of the present invention, the relevant concepts involved in this application will be briefly introduced below.
[0070] CKV: A distributed in-memory key-value storage system that supports atomic data operations.
[0071] NTP: Network Time Protocol. NTP is a protocol that synchronizes computer time, allowing computers to synchronize with their servers or clock sources, providing highly accurate time correction, and preventing protocol attacks through encrypted authentication.
[0072] The ability of business systems in banks, train stations, and similar establishments to handle object access volumes is significantly limited by hardware performance. When a business system receives a large number of object accesses in a short period, its normal processing flow may be affected. To maintain the long-term stable operation of these systems, fixed flow control methods are generally used to manage the traffic flow.
[0073] Flow control, also known as traffic control, refers to controlling the flow of data in a computer network through software, hardware, or a combination of both. In this invention, flow control for a business system specifically refers to controlling the amount of data accessed by that system. Therefore, the fixed flow control method in related technologies specifically refers to fixing the upper limit of access to the business system, thereby protecting the system from processing pressure caused by excessive object access.
[0074] However, the volume of business access received by a business system can vary significantly at different times. For example, business systems in banks and railway stations often experience peak business volumes before long holidays and festivals. For instance, before the Spring Festival, banks' business systems see a significant increase in asset deposit and withdrawal requests; similarly, railway station business systems experience a noticeable rise in access volume around the Spring Festival travel rush. Furthermore, within the same business system, the access volume for different types of business transactions can also differ. For example, in a banking system, access volume for stored-value transactions may be higher than access volume for investment transactions. Therefore, in the actual operation of business systems, fixed flow control methods are not well-suited to the fluctuating access volumes of business systems, while manually setting multiple access volume limits is cumbersome and inefficient.
[0075] Furthermore, with the continuous development of hardware technology, the update speed of business systems is also accelerating, and the throughput of business systems is also increasing. If business systems still rely on the previously set access limits to operate, it is undoubtedly a waste of resources for updated business systems. On the other hand, if the access limits of each business system are manually reset, or even if corresponding access limits are set for various business functions within the business system, this way of adapting to changes in business system resources obviously takes a lot of time, has poor real-time performance, and is inefficient, making it difficult to keep up with the rapid development speed of current Internet technology.
[0076] Based on this, embodiments of the present invention provide a traffic control method that periodically acquires historical access status information of a target business system to understand the real-time traffic status of the target business system. This allows for the calculation of independent health information of the target business system across multiple time dimensions. Based on this independent health information, the comprehensive health information of the target business system is determined, and a real-time traffic control strategy is established to control the traffic of target access requests. This invention can adapt promptly to the updates and iterations of the target business system, generating corresponding real-time traffic control strategies based on the real-time status of the target business system. Ultimately, it accurately achieves dynamic traffic control of target access requests, offering high efficiency and real-time performance, and effectively adapting to the rapid pace of updates and iterations in current internet technology. Furthermore, this invention can determine the comprehensive health information of the target business system across multiple time dimensions based on historical access status information. By combining the comprehensive response level of the target business system across multiple time dimensions to determine the real-time traffic control strategy, the real-time traffic control strategy can reflect the degree of influence across different time dimensions, further improving the accuracy of the real-time traffic control strategy.
[0077] The flow control method proposed in this embodiment of the invention can be applied to, for example... Figure 1 The implementation environment shown. Figure 1 The illustrated implementation environment includes multiple terminal devices 101 and a server 102. The terminal devices can communicate with the server via wired or wireless means. The wireless connection includes, but is not limited to, Wi-Fi (Wireless Fidelity) connection, cellular data connection, Bluetooth connection, or infrared connection; the wired connection includes USB (Universal Serial Bus) connection. Figure 1 The terminal device and the server communicate with each other through the communication network 103.
[0078] The terminal device in this embodiment of the invention can be any electronic product capable of accessing the business system in this embodiment of the invention, such as a personal computer (PC), mobile phone, smartphone, personal digital assistant (PDA), wearable device, pocket PC (PPC), tablet computer, etc. Figure 1 The example demonstrates how mobile phones and personal computers can be used as terminal devices. Users can interact with these devices via one or more methods, such as keyboards, touchpads, touchscreens, remote controls, voice interaction, or handwriting recognition, to access various services within the business system. The terminal device, based on the user's actions, then sends the service access requests to the server via the communication network.
[0079] The server in this embodiment of the invention can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. This server can run the business system in this embodiment of the invention, receive and process business access requests sent by terminal devices, and return the processing results (i.e., business access responses) to the terminal devices. Furthermore, the server is also used to formulate real-time traffic control strategies for the business system based on business access requests, thereby achieving dynamic traffic control of business system access requests and further improving the stability of the business system.
[0080] In some embodiments, the server described above can also be implemented as a node in a blockchain system.
[0081] The business systems in this embodiment of the invention may include payment systems of payment institutions, service systems of banking institutions, or online ticketing systems, etc. Payment institutions are those that provide payment for daily consumer goods such as water, electricity, gas, and broadband, such as public institutions that provide water services and operators that provide broadband services. Service systems of banking institutions are business systems that can provide services such as currency storage and venture capital to customers. Online ticketing systems are business systems that can provide ticketing services for transportation such as trains and airplanes, or for events such as concerts and theatrical performances, or for places such as scenic spots and amusement parks.
[0082] In this embodiment of the invention, the business system runs on a server. For example, this business system is a bank's business system. During operation, the business system may suspend service due to system updates or failures. When the business system resumes service, it needs to handle a large backlog of access requests. Alternatively, as mentioned above, the business system may experience peak access times before and after holidays, requiring it to handle a large number of access requests in a short period. It is evident that the business system frequently needs to cope with sudden surges in traffic. However, because the processing capacity of the business system is significantly constrained by hardware performance, the traffic control schemes in related technologies are difficult to efficiently and promptly resolve the business system's predicament, leading to increased instability during operation, higher manual maintenance costs, and a decreased user experience. Therefore, this application proposes a traffic control method, such as... Figure 1As shown, the server receives service access requests from multiple terminal devices and formulates a real-time traffic control strategy that dynamically changes with the current overall response level of the service system. The server processes the service access requests according to this strategy and returns the processing results to the corresponding terminal devices. This embodiment of the traffic control method achieves efficient and accurate matching between the real-time traffic control strategy and the processing capacity of the service system, further improving the stability and processing efficiency of the service system.
[0083] based on Figure 1 The implementation environment shown is based on... Figure 2 , Figure 2 This is a flowchart illustrating the steps of a flow control method provided in an embodiment of the present invention. This method can be performed by… Figure 1 This is implemented by server 102, and the method specifically includes, but is not limited to, the following steps S200-S230:
[0084] S200. After a preset time interval, obtain historical access status information of the target business system; wherein, the historical access status information is used to characterize the traffic status of the target business system being accessed.
[0085] Specifically, as mentioned above, the fixed flow control solutions in related technologies are difficult to match the ever-changing business processing capabilities of business systems. Furthermore, they struggle to address issues such as insufficient processing capacity and operational instability caused by significant fluctuations in access volume across different time dimensions. Therefore, the flow control method proposed in this invention focuses on the latest business access situation of the business system and dynamically adjusts the real-time flow control strategy based on this information. This achieves the goal of fully utilizing the processing capacity of the business system and maintaining its stable operation.
[0086] Therefore, the flow control method proposed in this embodiment of the invention first needs to collect the business access information of the business system. In this embodiment, the target business system is the business system that requires flow control, specifically it can be at least one of the banking business system, online ticketing system, or payment system mentioned above, which will not be elaborated here. Since the business access information of the target business system changes over time, in this step, historical access information is obtained from the data storage space storing the target business system data at preset intervals. This data storage space can be at least one of local storage, database, cloud storage, etc.
[0087] In this embodiment of the invention, the preset duration refers to the time interval between retrieving the required data from the data storage space of the target business system and retrieving data from the same data storage space again. It is understood that, to simplify the system design process and facilitate data queries by business system maintenance personnel, in some embodiments, the preset duration may refer to time intervals of equal length. For example, if the preset duration is set to 30 minutes, and the first retrieval of historical access information of the target business system begins at 9:00, then the historical access information is retrieved a second time at 9:30, a third time at 10:00, and so on, retrieving the required historical access information from the data storage space at fixed time intervals.
[0088] As mentioned above, the fluctuations in access to business systems vary considerably depending on the time frame. Taking the bank's business system as an example, before the Spring Festival, residents typically access the system via mobile banking or online banking apps, or bank staff access it in person, leading to a significant increase in access volume. In other words, months closer to the Spring Festival (e.g., January and February) are likely to be peak periods for bank business system access. Conversely, March and April, immediately after the Spring Festival, are typically the "off-season" for banking, with lower overall access volume and less fluctuation. Therefore, consistently using fixed preset time intervals for data acquisition can lead to inadequate historical access data during busy periods, potentially causing lag in traffic control strategies. Conversely, during quieter periods, frequently acquiring historical access information and updating real-time traffic control strategies based on fixed preset time intervals can waste computing resources. Therefore, considering the above, in some embodiments, the preset duration can also be a time interval of unequal length. For example, throughout the year, based on the general trend of business system access volume, different preset durations are used to acquire data in different months. For instance, in January and February, the preset duration is set to 15 minutes, so historical access information is retrieved from the banking business system's data storage space every 15 minutes; in March and April, the preset duration is set to 4 hours, and historical access information is retrieved again every 4 hours. In this embodiment, the real-time performance of the real-time traffic control strategy is taken into account while reducing the occupation of communication resources or storage space caused by data transmission.
[0089] In other embodiments, the preset duration can vary irregularly over a smaller time frame. Taking a bank's business system as an example, the system might provide services from 8:00 AM to 6:00 PM, with the highest traffic occurring between 9:00 AM and 11:00 AM and between 3:00 PM and 5:00 PM. Therefore, the preset duration for data retrieval could be set on a daily basis. For example, between 8:00 AM and 9:00 AM, the preset duration for data retrieval could be set to be longer, such as 30 minutes. Between 9:00 AM and 11:00 AM, historical access information could be retrieved every 10 minutes. The preset duration for the remaining time periods of the day could also be set based on typical traffic patterns. This approach helps the server improve the accuracy of its traffic control decisions.
[0090] In summary, the preset duration in the embodiments of the present invention can be set according to the actual business access situation of the business system, and other setting methods will not be described in detail here.
[0091] It should be noted that the preset duration and the length of the time period corresponding to the acquired historical access status information can be the same or different. For example, in some embodiments, historical access status information is acquired every 5 minutes, with the first acquisition at 9:00 and the second at 9:05. The second acquired historical access status information can represent all access status information generated within the time period from 9:00 to 9:05 (i.e., the same time period as the preset duration). This ensures that the server obtains relatively complete and coherent historical access status information, which positively impacts the accuracy of specified traffic control decisions. In other embodiments, the business access volume within the preset duration may be relatively consistent with minimal fluctuations. In this case, the length of the time period corresponding to the acquired historical access status information can be shorter than the preset duration. For example, if historical access status information is acquired every hour, with the first acquisition at 9:00 and the second at 10:00, the second acquired historical access status information can represent all access status information generated between 9:30 and 10:00. This portion of historical access status information can serve as representative of the business access status information during the 9:00-10:00 period. This approach reduces the pressure on data transmission and storage while reflecting the business access volume during this period.
[0092] In this embodiment of the invention, the historical access status information is used to characterize the traffic status of the target business system. Depending on the actual traffic control process, the content included in this historical access status information may vary. Since the traffic status of the business system is closely related to time, this embodiment of the invention obtains historical access status information according to time periods. A historical time period refers to a time interval earlier than the current time, which is the time period corresponding to the historical access status information obtained as mentioned above. Since various possible settings for this time period have already been mentioned above, the specific settings for the historical time period will not be elaborated upon here.
[0093] First, historical access information can include the business access volume mentioned above, more precisely, the total number of access requests to the target business system within a historical time period. Understandably, if the total number of access requests to the business system within a specified historical time period is very high, it reflects that the business system is under significant processing pressure and requires traffic control.
[0094] Similarly, historical access status information may also include the initiation time of access requests to the target business system within a historical time period, the time taken for access requests to the target business system within a historical time period, the success or failure of access requests to the target business system within a historical time period, and the object information of access requests to the target business system within a historical time period.
[0095] The access request time information refers to the duration and specific time taken from when the terminal device sends the current access request to when the terminal device receives the processing result returned by the business system for the current access request. It's conceivable that if the business system takes a long time to process the access request after it's sent by the terminal device, it indicates that the current business system may have a large backlog of access requests that need to be queued; or it may be that the processing capacity is insufficient, causing a decrease in the speed of processing individual access requests.
[0096] Based on the above, when the total number of access requests is large, the business system may need to queue them for processing, or distribute computing power across multiple access requests, leading to slower processing speeds. Furthermore, when access requests from terminal devices have time-sensitive requirements, the business system may not be able to complete processing within the preset timeframe after a request is sent. In this case, the business system can return a processing failure response to the terminal device; conversely, if processing is completed, it can return a processing success response. Therefore, the success and failure information of access requests to the target business system within a historical time period can also reflect the urgency of the business system's need for traffic control.
[0097] Furthermore, since the server in this application can be a standalone server or a server cluster, it may serve multiple business systems. To distinguish access requests from different terminal devices to different business systems, the historical access status information may also include object information of the target business system's access requests within a historical time period. This object information includes the identifier of the requested business system and the identifier of the current access request. This identifier can be sent to the server in plaintext or ciphertext along with the access request.
[0098] S210. Based on historical access information, determine the independent health information of the target business system under multiple different time dimensions, and determine the comprehensive health information of the target business system based on each independent health information; wherein, each independent health information is used to characterize the response level of the target business system under the corresponding time dimension, and the comprehensive health information is used to characterize the overall response level of the target business system; the degree of influence of independent health information under different time dimensions on determining the comprehensive health information is different;
[0099] Specifically, after obtaining historical access status information in step S200, a real-time traffic control strategy for the business system can be formulated based on this information. In this embodiment of the invention, the concept of comprehensive health information of the target business system across different time dimensions is proposed. This comprehensive health information characterizes the overall response level of the target business system. Compared to real-time traffic control strategies formulated based solely on a single variable such as the number of access requests received by the business system, the comprehensive health information proposed in this embodiment provides a more scientific basis for formulating real-time traffic control strategies. Furthermore, the comprehensive health information in this embodiment is correlated with the time dimension, which also helps improve the calculation accuracy of the real-time traffic control strategy. For example, for independent health information under different time dimensions, embodiments of the present invention can assign different calculation weights to each, and then calculate comprehensive health information based on the different independent health information. It can be understood that the calculation result of comprehensive health information is affected to varying degrees by different independent health information. For independent health information with larger weight values, the influence on the final calculated comprehensive health information is also greater. Therefore, different weights can be assigned to different independent health information according to the traffic control requirements of the target business system under different time dimensions, so that the result of the final calculated comprehensive health information best matches the current response status of the target business system, thereby improving the control accuracy of the control strategy.
[0100] Reference Figure 3 , Figure 3 This is a flowchart illustrating the steps for calculating comprehensive health information according to an embodiment of the present invention. The method specifically includes, but is not limited to, steps S300-S320:
[0101] S300. Based on historical access information, calculate the average time consumption of the target business system and the unit time statistics of the target business system under different time dimensions.
[0102] Specifically, the average time consumption information refers to the average time required for the current target business system to process an access request. This average time consumption information can be calculated from the time consumption information of access requests of the target business system within a historical time period and the total number of access requests in the historical access status information. For example, to obtain the average time consumption information for a day, first calculate the sum of the time consumption corresponding to all access requests processed by the target business system on that day, and then divide the calculated sum of time consumption by the total number of access requests to obtain the average time consumption required for the target business system to process a single access request on that day. It can be understood that this average time consumption information takes into account both successfully processed and unsuccessfully processed access requests when calculating, so this average time consumption information can objectively reflect the access request processing status of the target business system on that day. At the same time, since the embodiments of the present invention need to use the average time consumption information as a reference for the health status when calculating the comprehensive health information of the target business system, the calculation of the average time consumption information should be based on historical access status information as close as possible to the current time. For example, when calculating the current comprehensive health information, the average time consumption information of the previous day can be calculated using the historical access status information of the previous day and used as a reference.
[0103] Unit-time statistics refer to the statistical information on the processing of access requests by a business system within a preset unit time range. As mentioned above, for some business systems, the number of access requests received may vary significantly between different time periods throughout the day. Therefore, relying solely on average latency information is insufficient to comprehensively reflect the access processing status of a business system. Furthermore, it's understandable that the process of processing access requests by a business system is continuous. For example, if all access requests in the current access request list cannot be processed within the previous time period, the next time period will need to not only receive new access requests but also process those left over from the previous period. Conversely, once the access requests from the previous time period are processed, the business system can focus on processing the access requests received in the current time period at the start of the next time period, thus improving processing efficiency. Therefore, unit-time statistics within a single unit time range can only partially represent the access request processing status within that unit time range, and their reference value for the server in formulating real-time traffic control strategies for the target business system in the next time period is relatively limited.
[0104] Therefore, this embodiment of the invention proposes to calculate unit-time statistics under different time dimensions, thereby providing a more comprehensive reference for the server to formulate real-time traffic control strategies for the target business system in the next time period. In this step, different time dimensions can be understood as multiple time periods with different time ranges. For example, the time dimensions can be set to include a first time dimension, a second time dimension, and a third time dimension, where the first time dimension is 1 minute, the second time dimension is 5 minutes, and the third time dimension is 20 minutes. Then, under the first time dimension, the unit-time range refers to the previous 1 minute; under the second time dimension, the unit-time range refers to the previous 5 minutes; similarly, under the third dimension, the unit-time range refers to the previous 20 minutes. Since the unit-time range changes under different time dimensions, the unit-time statistics obtained within that unit-time range can more comprehensively reflect the changes in access requests of the target business system, thereby providing a more accurate reference for the real-time traffic control strategy in the next time period.
[0105] It should be noted that there is no necessary relationship between the above-mentioned unit time and historical time period duration settings. Generally speaking, in order to reduce the resource consumption caused by frequently retrieving historical access status information from the data storage space, the unit time duration should be shorter than the historical time period duration. For example, if the historical time period is set to 30 minutes, then only one retrieval of the historical access status information within the historical time period before the current moment is needed to obtain unit time statistics for the three time dimensions of the previous 1 minute, the previous 5 minutes, and the previous 20 minutes.
[0106] The above content mentions that the unit time statistics information refers to the statistical information on the processing of access requests by the business system within a preset unit time range. Specifically, the unit time statistics information includes the total number of requests, the number of successful requests, the average time spent, and the percentage coefficient of the number of successful requests in the target business system within the unit time.
[0107] The total number of requests per unit time can be obtained from the total number of access requests to the target business system within a historical time period. For example, if the historical time period is 30 minutes and the unit time is 1 minute, then the total number of requests in the last minute of the historical time period is the total number of requests per unit time. Based on the success and failure information of access requests to the target business system within the historical time period, the number of successful requests to the target business system within a unit time can be calculated. The number of successful requests refers to the number of access requests that the business system has processed and returned a successful result to the terminal device. The access success and failure information records the processing results (success or failure) of all access requests within the historical event segment, thus determining the number of successful requests to the target business system within a unit time. For example, if the historical time period is 30 minutes and the unit time is 1 minute, and the business system processed 10 access requests in the last minute of the historical event segment, of which 8 were processed successfully and returned a successful result to the terminal device, and 2 either timed out or failed due to processing errors by the business system; then the number of successful requests within a unit time is 8. Furthermore, based on the time consumption information of access requests to the target business system within a historical time period, the average time consumption of the target business system per unit time can be calculated. This average time consumption differs from the average time consumption information mentioned above; it refers to the time required for the target business system to process one business request per unit time. For example, if the historical time period is 30 minutes, and the unit time is 1 minute, and the business system processed 10 access requests in the last minute of the historical event period, then the average time consumption to process one business request per unit time can be calculated as 6 seconds.
[0108] Furthermore, based on the total number of requests and the number of successful requests received by the target business system within a unit of time, a success rate coefficient can be calculated. More specifically, the success rate coefficient refers to the ratio of successful requests to the total number of requests received by the target business system within a unit of time. Clearly, the higher the percentage of successful requests in the total number of requests, the higher the success rate of the target business system in processing access requests, and thus the more "healthy" the target business system is considered. For example, if the historical time period is 30 minutes, and the unit time is 1 minute, and the business system processed 10 access requests in the last minute of the historical event period, with 8 of them successfully processed and returning a successful result to the terminal device, then the calculated success rate coefficient is 0.8.
[0109] Furthermore, in practical applications, the aforementioned percentage coefficient can also be an empirical value preset based on prior data. The success rate requirements for access requests sent by terminal devices may differ across different business systems. Even within the same business system, the success rate requirements for access requests from different services may vary. For example, in a banking system, there may be some services with high timeliness requirements, such as checking an account's real-time balance or completing a small transfer. These services involve relatively small amounts of data or small sums of money, so the banking system should prioritize speed, accuracy, and a high success rate in processing them. Conversely, for services with lower timeliness, such as large transfers or investment product purchases via mobile banking, the processing time is longer. Even if the current access request fails, the terminal device can repeatedly send requests to the business system running on the server until the request is completed. In this case, the percentage requirement for successful requests in the total number of requests can be relatively relaxed. Based on the above, in practical application scenarios, the proportion coefficient can be manually set as needed. The proportion coefficient can be between 0 and 1. For example, based on experience, the proportion coefficient of the current target business system can be set to 0.7, and the proportion coefficient of 0.7 can be used for calculation in the subsequent calculation process.
[0110] As can be seen, in the above embodiments, the calculation of health status references the successful processing of access requests by the target business system to help measure its health. In other embodiments, the target business system's ability to process access requests may be measured from a different perspective. For example, instead of calculating health status, a risk level may be required. In such cases, the risk level can be quantified by referencing the failure to process access requests by the target business system. This embodiment of the invention mainly focuses on the health status of the business system.
[0111] S310. Based on the average time consumption information and the unit time statistics under different time dimensions, calculate the independent health information under each time dimension.
[0112] Specifically, after calculating the average time consumption information and the unit time statistics under different time dimensions through step S300, the independent health information under different time dimensions can be calculated based on the above information. As mentioned above, the comprehensive health information in this embodiment of the invention is used to characterize the comprehensive response level of the target business system. Correspondingly, the independent health information is used to characterize the comprehensive response level of the target business system under different time dimensions. Assuming that the preset first time dimension, second time dimension, and third time dimension are 1 minute, 5 minutes, and 20 minutes respectively, the independent health information under the first time dimension can be calculated using the average time consumption information and the unit time statistics under the first time dimension. The calculation process of the independent health information is illustrated below using the example of a first time dimension of 1 minute.
[0113] Step S300 above first provides the average time consumption information of the target business system under historical access conditions. It assumes that the average time consumption information of the previous day is calculated based on the historical access information of the previous day. This average time consumption information is then used as a parameter for calculating the current independent health information, and `useTime` is used as the parameter. avg This indicates the average time spent the previous day. Then, step S300 further elaborates on the unit-time statistics of the target business system, including the total number of requests per unit time, the number of successful requests per unit time, the average time spent per unit time, and the percentage of successful requests. Within a unit time, reqNum is used... all Representing the total number of requests, use reqNum period The number of successful requests is represented by useTime. period Let represent the average latency, and 'm' represent the percentage coefficient. Based on the average latency information of the target business system under historical access conditions, as well as the total number of requests per unit time, the number of successful requests per unit time, the average latency per unit time, and the percentage coefficient of successful requests per unit time, the independent health information for each time dimension can be calculated. Let healthIndex represent the independent health information for the current time dimension. healthIndex conforms to the following formula:
[0114]
[0115] The above formula is the calculation formula for independent health information under various time dimensions provided in the embodiments of the present invention. For example, under the time dimension with a unit time of 1 minute, the calculated independent health information can be represented by healthIndex. 1min This is used to represent the value. Similarly, within a time dimension of 5 minutes, the healthIndex is calculated. 5min The healthIndex is calculated within a time dimension of 20 minutes.20min It is understood that, depending on the needs of actual application scenarios, more and larger time dimensions can be set, and corresponding independent health information can be calculated. This embodiment of the invention does not impose specific limitations on the setting of time dimensions.
[0116] After calculating the independent health information for each time dimension based on the average time consumption information and the unit time statistics under different time dimensions, the independent health information is stored in the corresponding data storage space, such as the database of the server.
[0117] S320. Calculate the comprehensive health information based on the independent health information under each time dimension;
[0118] Specifically, after calculating the independent health information for each dimension, the overall health information can be calculated based on the impact of each independent health information on the overall response of the current target business system. The overall health information characterizes the current overall response level of the target business system. Based on this overall health information, the server can formulate corresponding real-time traffic control strategies. Generally speaking, for example, if the overall health information indicates that the target business system's current overall response level is low, potentially indicating a backlog of access requests, slow processing speed, and high error rate, then the server's real-time traffic control strategy should focus on reducing the pressure of new access requests on the target business system, allowing it to process the backlog of requests as quickly as possible, and avoiding the situation where the target business system continues to bear a large request processing pressure in the next time period. Conversely, if the overall health information indicates that the target business system's current overall response level is high, then the real-time traffic control strategy should tend to relax current access requests to the target business system to fully utilize its access request processing capabilities.
[0119] As mentioned above, because the process of handling business access requests by a business system is continuous, the response level of the business system to access requests at multiple time dimensions will more or less affect the response level of the business system at the current moment. It is understandable that, since the business access request situation of the target business system fluctuates over time, the degree to which the response level of the business system to access requests at different time dimensions affects the overall response level of the business system at the current moment varies significantly. To illustrate with an extreme example, using the response level of the target business system 24 hours ago to assess the response level at the current moment has very limited reference value. If the response level 24 hours ago is used as the primary reference, the accuracy of the calculated response level at the current moment will be low, making it difficult to assist the server in formulating accurate real-time traffic control strategies. For example, if we use the response level of the target business system 30 seconds ago to evaluate the response level at the current moment, the change in response level that can occur within this unit of time for the target business system is quite limited. Therefore, the impact of the response level of the target business system 30 seconds ago on the response level at the current moment is obviously much greater than the impact of the response level more than 24 hours ago on the response level at the current moment.
[0120] Furthermore, because this embodiment of the invention uses independent health information to quantify the response level of the target business system under different time dimensions, and uses comprehensive health information to quantify the comprehensive response level of the target business system at the current moment, it can be determined that the impact of independent health information in time dimensions closer to the current moment on comprehensive health information is greater than the impact of independent health information in time dimensions farther from the current moment on comprehensive health information. In the specific calculation of comprehensive health information, the difference in the above impact is specifically reflected by the difference in the weight threshold of each independent health information, that is, the weight threshold of independent health information in time dimensions closer to the current moment is greater than the weight threshold of independent health information in time dimensions farther from the current moment. The weight threshold of independent health information is used to characterize the degree of influence of the current independent health information on comprehensive health information. For example, assuming the first time dimension is 1 minute, the second time dimension is 5 minutes, and the third time dimension is 20 minutes, different weight thresholds are set for the independent health information in the first, second, and third time dimensions respectively. Assuming that in the first time dimension, the independent health information healthIndex... 1min The weight threshold is set to 0.7. Similarly, the weight threshold for independent health information in the second time dimension is lower than that in the first time dimension, and the healthIndex is set accordingly. 5minThe weight threshold for healthIndex is 0.2; however, the weight threshold for independent health information in the third time dimension is even lower than that in the second time dimension. 20min The weight threshold is 0.1. Therefore, the difference in weight thresholds can reflect the different impacts of independent health information on overall health information at different time dimensions when quantifying and calculating comprehensive health information.
[0121] As mentioned above, the embodiments of the present invention do not impose specific limitations on the specific settings of the time dimension. That is to say, in addition to the three time dimensions listed in the above examples, more or fewer time dimensions can be set in actual application scenarios to calculate independent health information and comprehensive health information. When setting the weight threshold, note that the sum of the weight thresholds for the independent health information corresponding to all time dimensions should be 1.
[0122] In some embodiments, the weight threshold can be set empirically, as in the examples above. In other embodiments, the weight threshold can also be determined based on the proportion of a unit time in the sum of all unit times in the time dimension. For example, if the first, second, and third time dimensions are 2 minutes, 3 minutes, and 5 minutes respectively, then the sum of all unit times is 2 + 3 + 5 = 10 minutes. Therefore, the proportions of the unit time in the first, second, and third time dimensions in the sum of all unit times are 0.2, 0.3, and 0.5 respectively. Furthermore, as mentioned above, the weight threshold for independent health information in time dimensions closer to the current time should be set higher. Therefore, the weight threshold for independent health information (healthIndex) in the first time dimension can be set in descending order of proportion. 2min Setting it to 0.2 will set the independent health index information under the second time dimension to healthIndex. 3min Setting it to 0.3 will set the independent health index information under the third time dimension to healthIndex. 5min The value is set to 0.5. In other embodiments, the weight thresholds corresponding to independent health information under different time dimensions can also be determined in other ways, as long as the condition that the weight threshold of independent health information under the time dimension closer to the current time is greater than the weight threshold of independent health information under the time dimension farther from the current time is met. This embodiment of the present invention will not elaborate further here.
[0123] Based on the above, after configuring the weight thresholds for independent health information under each time dimension, the overall health information can be calculated by weighting each independent health information according to its weight threshold. For example, if the first time dimension is 1 minute, the second time dimension is 5 minutes, and the third time dimension is 20 minutes, then configure healthIndex. 1minThe weight threshold is 0.7, and the healthIndex is... 5min The weight threshold is 0.2, and healthIndex 20min The weight threshold is 0.1, using healthIndex. period healthIndex represents the overall health information at the current moment. period The calculation process satisfies the following formula:
[0124] healthIndex period =0.7*healthIndex 1min +0.2*healthIndex 5min +0.1*healthIndex 20min
[0125] According to the above formula, comprehensive health information can be calculated based on independent health information under each time dimension.
[0126] Through the above steps S300-S320, this embodiment of the invention illustrates the specific process of calculating comprehensive health information. The content of calculating comprehensive health information based on independent health information in step S210 has already been explained through steps S300-S320; step S220 will now be further described.
[0127] S220. Based on the comprehensive health information, determine the real-time traffic control strategy for the target business system;
[0128] Specifically, based on step S210 above, comprehensive health information that characterizes the overall response level of the target system is calculated. As mentioned above, comprehensive health information provides important reference for the server to formulate real-time traffic control strategies for the target business system in the next time period. For example, if the comprehensive health information shows that the current overall response level of the target business system is high, the traffic control strategy can be relaxed, allowing the target business system to process more new access requests in the next time period; conversely, if the comprehensive health information shows that the current overall response level of the target business system is low, the traffic control strategy can be appropriately tightened, allowing the target business system to focus on processing the backlog of access requests in the next time period.
[0129] The real-time traffic control strategy proposed in this embodiment of the invention is related to the speed at which the comprehensive health information is updated. For example, according to the preset time interval set in step S200, the historical access status information of the target business system is acquired every preset time interval. Then, based on the historical access status information acquired this time, the new comprehensive health information is calculated using the method in step S210. The server then adjusts the real-time traffic control strategy of the previous time period according to the latest comprehensive health information, or specifies the latest real-time traffic control strategy based on the latest comprehensive health information. As mentioned above, the number of access requests to the business system fluctuates significantly at different times, so the real-time requirements for the traffic control strategy also differ at different times. For example, when the total number of access requests to the target business system is large, the server needs to increase the update speed of the real-time traffic control strategy to ensure that the target business system can fully utilize its processing performance and keep up with the growth rate of access requests; conversely, when the total number of access requests to the target business system is small, the server can appropriately relax the real-time requirements for the real-time traffic control strategy to reduce unnecessary computing power loss.
[0130] In real-world applications, performance limitations of different server hardware and software result in varying processing capabilities for business access requests across different servers. Furthermore, a single server (or within the same cluster) may serve multiple business systems and various services within those systems, and these systems and services may have different priorities. For example, business systems A and B might both run on server C, but system A has a higher priority and its supported services have higher requirements for timeliness and success rate. Therefore, server C might allocate more computing resources to system A and reserve sufficient resources for it as a buffer. Consequently, the computing resources available to system B on server C will be reduced, resulting in a maximum threshold for the computing resources it can access. Similarly, this same principle may apply to different types of services within the same business system.
[0131] Therefore, when determining real-time traffic control strategies based on comprehensive health information, it is necessary to consider the actual hardware support that the server can provide. In this embodiment of the invention, QPS (Query Per Second) is proposed as a metric for server hardware performance. QPS refers to the number of queries the server can respond to per second, and can be used to measure the server's ability to process access request traffic within a specified time period. In this embodiment of the invention, it is necessary to link the comprehensive health information of the target business system with the server's QPS to determine the number of access queries the business system can respond to under the current comprehensive health information.
[0132] For the same business system, excluding special cases such as server or business system updates, the maximum query rate per second (i.e., maximum QPS) that the server running the business system can provide is fixed. However, depending on the different overall response levels of the business system to access requests, the server can provide different actual query rates per second (i.e., actual QPS), and this actual QPS can at most equal the maximum QPS that the server can provide. To distinguish the actual QPS corresponding to different overall response levels of the business system, this embodiment of the invention proposes to match different preset query rate per second coefficients (i.e., preset QPS coefficients) to different overall health information. Specifically, the mapping relationship between overall health information and preset QPS coefficients can be constructed using functions, formulas, tables, etc. As shown in Table 1 below, Table 1 is a mapping relationship table between the overall health information range and the preset QPS coefficients provided in this embodiment of the invention.
[0133] Table 1
[0134] 95–100 1 80–94 0.8 60–79 0.5 40–59 0.2 0–39 0
[0135] As shown in Table 1 above, in this embodiment, the comprehensive health information is specifically divided into multiple intervals. Assuming that the quantification value of the comprehensive health information ranges from 0 to 100, then according to Table 1, the comprehensive health information is divided into five intervals: 0-39, 40-59, 60-79, 80-94, and 95-100, and different preset QPS coefficients are matched for each of the five intervals. For example, assuming the calculated comprehensive health information healthIndex period =96, and 96 falls within the comprehensive health information range of 95-100, so healthIndex = 96. period =96 corresponds to a preset QPS coefficient of 1. Similarly, when healthIndex = 96, the preset QPS coefficient is 1. period =27, then healthIndex period =27 corresponds to a preset QPS coefficient of 0. It's understandable that the value of the comprehensive health information calculated from independent health information may be a decimal, for example, showing a healthIndex value. period In cases like 39.8, the healthIndex is usually... period The value is rounded before matching the preset QPS coefficient.
[0136] Table 1 shows that the higher the value of the comprehensive health information obtained from quantitative calculation, the higher the corresponding preset QPS coefficient. This preset QPS coefficient represents the proportion of the actual QPS allocated to the target business system under the current comprehensive health information to the maximum QPS that the server can provide. In other words, actual QPS = maximum QPS * preset QPS coefficient. For example, if the preset QPS coefficient corresponding to the current comprehensive health information is 1, it indicates that the current health status of the target business system is excellent, and the business system can allocate maximum computing resources to process new access requests; therefore, actual QPS = maximum QPS. Similarly, if the preset QPS coefficient corresponding to the current comprehensive health information is 0.8, it indicates that the current health status of the target business system is good, but some computing resources still need to be reserved to handle backlogged access requests or other business operations; therefore, actual QPS = 0.8 * maximum QPS.
[0137] It should be noted that the criteria for dividing the comprehensive health information ranges into the preset QPS can be set according to the actual application scenario when constructing the mapping relationship between the comprehensive health information ranges. That is, more or fewer ranges than the five ranges shown in Table 1 can be used to meet actual traffic control needs. Correspondingly, the preset QPS coefficient can also be divided more finely or more simply; just note that the preset QPS coefficient ranges from 0 to 1. Furthermore, the size of the comprehensive health information ranges can also be set according to the actual application scenario; the ranges can be the same or different. For example, when the comprehensive health information value is relatively low, the primary task of the target business system is to process the backlog of access requests. Therefore, as shown in Table 1, within a relatively large score range of 0-39, the corresponding preset QPS coefficient is 0, meaning the actual QPS = 0. This can be understood as the target business system not processing any new access requests within this range, ensuring that the target business system can successfully process all backlogged access requests. In the range of 40-59 points, a small amount of actual QPS can be opened to handle a small number of access requests. As the comprehensive health information value gradually increases, more computing resources can be gradually opened to handle access requests.
[0138] Based on the mapping relationship between the comprehensive health information range and the preset QPS coefficient shown in Table 1, or other tables, formulas, functions, etc. that can map the comprehensive health information to the actual QPS, the actual QPS corresponding to the current comprehensive health information can be determined. This actual QPS can be used to determine the real-time traffic control strategy of the target business system.
[0139] S230. Perform flow control on the target access request according to the real-time flow control policy;
[0140] Specifically, a target access request refers to an access request sent by a terminal device to a target business system. Step S220 above proposes determining a real-time traffic control strategy for the target business system based on the actual QPS. The specific content of this real-time traffic control strategy can vary depending on the actual application scenario. For example, the real-time traffic control strategy may include limiting the total number of access requests sent by the terminal device to the target business system within the current time period. For instance, if the actual QPS is used as the maximum QPS within the current time period, the maximum number of access requests the target business system can receive within the current time period can be calculated using the actual QPS and the duration of the current time period. At the beginning of the current time period, the server counts the access requests. When the total number of access requests equals the maximum number of access requests, no new access requests are received for the remainder of the current time period. For access requests sent during the remaining time of the current time period, these requests can be stored in a storage space such as a message sequence, waiting to be consumed in the next time period; or the server can directly send a processing failure response to the terminal device for these access requests, such as displaying a pop-up window on the terminal device's interface: "The system is currently busy, please try again later."
[0141] In other embodiments, the real-time traffic control strategy can also allocate computing resources to different services of the target business system based on the actual QPS. For example, within the target business system, the maximum number of access requests that the target business system can receive in the current time period is calculated based on the actual QPS and the duration of the current time period. Then, access request thresholds corresponding to each service are allocated according to the maximum number of access requests. For example, if the maximum number of access requests for the target business system in the current time period is 100, and service A in the target business system is a relatively important high-level service while service B is a normal service, then 80 access requests are allocated as a threshold for service A and 20 access requests are allocated as a threshold for service B. Then, in the current time period, the target business system receives and processes access requests according to the access request thresholds for services A and B, respectively.
[0142] Alternatively, in some other embodiments, the real-time traffic control strategy can also set the access request reception rate per unit time within the current time period. For example, when the actual QPS is relatively high, assuming the current time period is 5 minutes and the unit time is 30 seconds, the access request reception rate can be set to 80% every 30 seconds. That is, if 10 access requests are received within 30 seconds, 8 access requests will be randomly received and processed, and the remaining 2 access requests will be cached or a processing failure result will be returned directly.
[0143] Through the above steps S200-S230, this embodiment of the invention provides a method for traffic control of target access requests to a target business system. The main steps are to continuously acquire historical access status information of the target business system according to a preset time period, determine comprehensive health information that reflects the overall response level of the target business system based on the historical access status information, formulate a real-time traffic control strategy for the target business system based on the comprehensive health information, and perform traffic control on the target access requests based on the real-time traffic control strategy.
[0144] The above embodiments of the present invention illustrate a flow control method during the normal operation of a business system. However, in practical application scenarios, business systems often have certain special working periods. For example, a bank's business system and a train ticketing system are not open to access 24 hours a day. For instance, a train ticketing system is generally not open from 11:00 PM to 4:00 AM the following morning. Alternatively, a business system may undergo system upgrades and maintenance during fixed periods within a week or month; during these maintenance periods, the business system is also unable to provide services. Within these special working periods, there may be exceptions. For example, high-level objects in the business system may still be able to access services during maintenance; conversely, blacklisted objects in the business system can have their access requests denied regardless of the time. Therefore, for the special circumstances outside the normal working flow of the target business system, it is necessary to configure corresponding special event information in the business system beforehand.
[0145] Based on the above, from a temporal perspective, the special event information of the target business system can include system maintenance information. This maintenance information indicates the inaccessible period of the target business system, during which routine maintenance and upgrades are performed. For example, the system maintenance information for a banking system might include: 8:00 PM to 8:00 AM daily as the inaccessible period, and Saturdays as the system maintenance time. During these two preset time periods, the banking system would be inaccessible. In other words, when a terminal device sends an access request to the target business system during the inaccessible period, the server will directly return a processing failure result to the terminal device, such as a pop-up message on the terminal device's display: "Currently under system maintenance; please retry during system operating hours." The system maintenance information should be configured according to the actual needs of different business systems.
[0146] From the perspective of the objects, this special event information can also include a blacklist request table and a whitelist request table for the current target business system. The request tables include object information and terminal information. Access requests from blacklisted objects in the blacklist request table are configured to be blocked from accessing the target business system, while access requests from whitelisted objects in the whitelist request table are configured to be accessible. Depending on the specific circumstances, for example, in a public transportation ticketing system, blacklisted objects in the blacklist request table might be registered individuals with illegal or dishonest records, requiring restrictions on their travel. In a utility payment system like water or electricity, blacklisted objects might be individuals who have not paid their water or electricity bills for a long time, requiring urging them to pay their bills at the service provider. Objects in the whitelist request table could be high-level bank users or maintenance personnel of the current target business system. Blacklist and whitelist request tables are configured according to the actual needs of different business systems.
[0147] Based on the current real-time traffic control policy, the target business system obtains a blacklist request table and a whitelist request table, and identifies the requester's identity based on these tables. As mentioned above, the target access request can carry identifiers representing the object or terminal, which are used for identity matching in the blacklist and whitelist request tables. If the object or terminal represented by the current target access request is neither in the blacklist nor the whitelist request table, the target access request is processed according to the current real-time traffic control policy. When the target access request is a whitelisted request, its rate-limiting status is directly set to "accessible," meaning it is processed normally regardless of the overall response level of the target system. Conversely, when the target access request is a blacklisted request, its rate-limiting status is set to "inaccessible."
[0148] In conjunction with the aforementioned system maintenance information, the method for the target business system to perform traffic control based on the real-time traffic control strategy also includes: objects or terminals in the blacklist request table cannot access the target business system at any time, while whitelist objects in the whitelist request table can access the target business system at any time.
[0149] In some other embodiments, the special event information of the target business system also includes the maximum number of requests that the target business system can support per unit time. It should be noted that this maximum number of requests that can be supported per unit time is mainly configured manually by the management and maintenance personnel of the business system. This maximum number of requests may be related to factors such as the number of bank employees, employee workload, and the amount of business that employees can handle. It is understood that since the hardware performance of the business system is the basis for processing access requests, the aforementioned maximum number of requests that can be supported per unit time should be less than the actual QPS that the business system's hardware can handle.
[0150] The maximum request count can serve as a reference for the target business system to set traffic opening thresholds at different time points. The traffic opening threshold refers to the maximum number of access requests the target business system can accept at each time point, based on real-time QPS and the aforementioned maximum request count. The set of traffic opening thresholds at different time points is called the traffic opening threshold set. This traffic opening threshold can be used as part of a real-time traffic control strategy and participate in the traffic control process of the target business system. For example, under a real-time traffic control strategy, the current traffic opening threshold for the target business system is determined from the traffic opening threshold set. If the current access volume of the target business system is greater than the current traffic opening threshold, it indicates that the current access volume has exceeded the access traffic limit that the target business system can handle, and the rate-limited state of the target access request is determined to be inaccessible. Conversely, if the current access volume of the target business system is less than or equal to the current traffic opening threshold, it is considered that the target business system can continue to handle more access volume, and the rate-limited state of the target access request is determined to be accessible, allowing the target business system to process the current target access request.
[0151] As can be seen, configuring the above-mentioned special event information is equivalent to "pre-screening" target access requests before implementing real-time traffic control strategies. By filtering out target access requests that do not need to be processed or can be processed directly through special event information, it can also achieve the effect of saving computing resources of business systems and improving the processing efficiency of business systems.
[0152] In conjunction with one or more of the above embodiments, this application provides a traffic control method. Unlike the fixed traffic control schemes in related technologies, this invention provides a dynamic, real-time traffic control method. First, this invention acquires historical access status information that characterizes the target business system's handling of access requests. Based on this historical access status information, it calculates comprehensive health information. This comprehensive health information comprehensively reflects the target business system's ability to handle access requests, providing reliable data support for the formulation of real-time traffic control strategies. As time progresses, the server can continuously acquire historical access status information to calculate new comprehensive health information, thereby dynamically updating the real-time traffic control strategy. This allows the target business system to adapt to the rapid pace of internet hardware performance updates and upgrades, maximizing its processing capacity even as the system is continuously optimized, updated, and upgraded. Furthermore, the traffic control method proposed in this invention can automatically adjust based on the current comprehensive health information of the business system, eliminating the need for manual setting and modification of access limits for the business system or even individual services. This significantly improves the stability and efficiency of the business system. Furthermore, this embodiment of the invention proposes to calculate comprehensive health information by integrating independent health information from different time dimensions. This allows for a comprehensive consideration of the impact of the target business system's response level on the current comprehensive response level across different time dimensions, further improving the calculation accuracy and precision of the comprehensive health information, thereby enhancing the scientific rigor and accuracy of the real-time traffic control strategy. Additionally, considering the specific working periods of the target business system in actual application scenarios, such as inaccessible system maintenance time, system blacklists and whitelists, etc., based on the real-time traffic control strategy, pre-screening of target access requests is performed by acquiring pre-configured special event information, further improving the processing efficiency of the target business system for target access requests.
[0153] Through the above, this invention provides a traffic control method that can maintain the normal and stable operation of a target business system to a considerable extent. However, in real-world application scenarios, business systems still face the risk of failure and may suddenly stop providing services. For example, a bank's business system may need to be updated outside of system maintenance time, during which time the bank's business system cannot provide services. Alternatively, the bank's business system may crash and restart due to software or hardware failure, rendering previous access requests invalid. Or, the bank's business system server may fail due to force majeure factors such as power outages or floods, requiring system repair before it can be re-launched to provide services. In addition to the above-mentioned failure scenarios, newly launched business systems have not undergone extensive access testing, and their processing capabilities are relatively fragile. In the above situations, after updates or maintenance, the target business system is relatively vulnerable for a period of time after relaunch. If normal request processing volume is immediately restored, the target business system may fail again shortly after repair or update. To solve the above problems, this invention, based on the real-time traffic control strategy, further proposes a "traffic ramping strategy" for the target business system after a failure and recovery, as detailed below.
[0154] Reference Figure 4 , Figure 4 This is a flowchart illustrating the steps of a target business system recovery method provided in an embodiment of the present invention. The method is applied to... Figure 1 The method, specifically including but not limited to steps S400-S410, is used in server 102.
[0155] S400: When the target business system is disconnected, continuously send probing requests to the target business system until the target business system is determined to have restored its connection based on the response information received from the target business system.
[0156] Specifically, based on the above, the target business system may become disconnected due to system updates, system downtime, or hardware failure. Disconnection refers to the state where the target business system is currently inaccessible; conversely, connectivity refers to the state where the target business system is accessible. When the target business system is disconnected, the server continuously sends probing requests to it. For example, every 30 seconds, the server sends a probing request. If the target business system is currently disconnected, the server will not receive any response from it. Therefore, when the server receives a response from the target business system, it can determine that the target business system has emerged from the disconnection state and returned to the connectivity state. Thus, the server determines that the target business system can begin processing access requests.
[0157] S410. Based on the preset set of traffic access thresholds, send access requests corresponding to each traffic access threshold to the target business system in sequence; wherein, the set of traffic access thresholds contains multiple traffic access thresholds at different time points, and each traffic access threshold is used to characterize the maximum number of access requests that the target business system can receive at each time point.
[0158] Specifically, as mentioned above, based on the comprehensive health information of the target business system, a suitable real-time traffic control strategy can be formulated to control the traffic of target access requests. However, the comprehensive health information of the target business system is calculated based on historical access status information. If the target business system recovers from a disconnected state to a connected state, it may be its first time being used online, lacking historical access status information; or it may have undergone a version update, potentially altering its throughput and processing capacity. Therefore, the historical access status information prior to the disconnection state no longer reflects the new processing performance of the target business system. Consequently, without the ability to calculate comprehensive health information based on historical access status information, the server cannot formulate a real-time traffic control strategy for the current target business system. Therefore, protecting the target business system from falling back into a disconnected state due to excessive traffic pressure becomes the primary goal of maintaining its stable operation, and determining the initial traffic after the target business system recovers its connection becomes crucial.
[0159] As mentioned above, based on the server's actual QPS (if the actual QPS cannot be calculated from comprehensive health information, the server's maximum QPS can be used instead) and maximum request count, a set of traffic opening thresholds can be determined. In some embodiments, the maximum traffic opening threshold in this set can be set as the server's maximum QPS. This set of traffic opening thresholds includes traffic opening thresholds for multiple different time points. Therefore, according to the traffic opening thresholds in the set, in ascending order, the traffic opening thresholds are sequentially used as the maximum number of access requests that the target business system can receive at each time point. This achieves the purpose of controlling the traffic situation of the target business system after it recovers its connection state through the set of traffic opening thresholds. It is conceivable that since the target business system receives access requests according to the ascending traffic opening threshold standard, based on the target business system's handling of access requests at different time points, the server can begin to evaluate the target business system's new processing performance. After the target business system enters normal operation, sufficient historical access data is collected to restart dynamic traffic control of the target business system.
[0160] For example, after the target business system regains its connection, the smallest first traffic open threshold is selected from the set of traffic open thresholds as the current traffic open threshold. Since the traffic open threshold represents the maximum number of access requests the target business system can receive at the current time, a first set of access requests, fewer than the current traffic open threshold, is sent to the target business system that has regained its connection. The traffic open thresholds in the set can be multiple traffic open thresholds set empirically, or they can be represented as a percentage of the largest traffic open threshold in the set. For example, the traffic open thresholds can be arranged from smallest to largest as 10%, 20%,...100% of the largest traffic open threshold.
[0161] Understandably, if the target business system is a new system going live for the first time, the first set of access requests will consist entirely of new access requests sent by the terminal system. However, if the target business system is an older system that has been repaired or updated before going live, the first set of access requests can include new access requests sent by the terminal system, with access requests received while the target business system was disconnected being discarded. Alternatively, the first set of access requests may initially include access requests received while the target business system was disconnected. During this period, these access requests are temporarily stored in storage spaces such as message sequences, and are then sequentially added to the first set of access requests after the target business system regains connectivity, where they are processed in order. Of course, if the backlog of access requests is small, the first set of access requests may also include both backlogged old access requests and new access requests after the connection is restored. The target business system processes the access requests in the first set of access requests first.
[0162] To assess the current processing performance of the target business system, during the initial processing of a small number of access requests, the server continuously records the processing status of the requests in the initial set, such as processing time and success rate. The ratio of successfully processed requests to the total number of requests in the initial set is defined as the request processing success rate. To measure whether the target business system can proceed to the next processing stage and handle more access requests, a target ratio corresponding to a traffic opening threshold is set. This target ratio represents the minimum request processing success rate required for the target business system to handle requests at a higher traffic opening threshold. Therefore, when the request processing success rate of the first set of access requests meets the target ratio, it indicates that the target business system can effectively handle the number of access requests corresponding to the current traffic opening threshold, and more access requests can be opened for processing. For example, if the current traffic opening threshold is 10% of the maximum traffic opening threshold, and the corresponding target ratio is set to 99%, then when the success rate of request processing in the first set of access requests meets 99% (i.e., equal to or greater than 99%), a second traffic opening threshold greater than the first traffic opening threshold is selected in ascending order according to the thresholds within the traffic opening threshold set. This second threshold represents the maximum number of access requests the target business system can receive in the next time period, and a second set of access requests meeting the current traffic opening threshold is sent to the target business system for access request processing. Similarly, the number of requests in this second set of access requests should be less than the current second traffic opening threshold. Similarly, assuming the current second traffic opening threshold is 20% of the maximum traffic opening threshold, and the corresponding target ratio is set to 99%, then when the success rate of request processing in the second set of access requests meets 99%, the next second traffic opening threshold, larger than the current one, is selected as the traffic opening threshold for the next time period, until the maximum traffic opening threshold in the traffic opening threshold set is used as the current traffic opening threshold. This means the target business system operates entirely according to the maximum traffic opening threshold standard, receiving and processing the maximum number of access requests corresponding to the maximum traffic opening threshold.
[0163] In the above description of how the target business system processes access requests at different time points using access request numbers corresponding to the traffic open thresholds in the traffic open threshold set, the example given is that the traffic open thresholds in the set may increase systematically, for example, the traffic open thresholds are arranged from smallest to largest as 10%, 20%,...100% of the maximum traffic open threshold. However, in practical application scenarios, it's easy to see that if the target business system is an older system that has been repaired or updated, its ability to process access requests is generally not worse than before; rather, it maintains the previous processing level or even improves upon it. Therefore, if the processing performance of a repaired or updated target business system is "slowly tested" based on the aforementioned systematically increasing traffic open thresholds, this process takes a long time, leading to a decrease in the overall efficiency of the target business system recovering from a disconnected state to normal operation, and creating a significant backlog of access requests. For target business systems with high timeliness requirements, this lengthy recovery phase can also significantly impact the user experience. Therefore, based on the above-mentioned method of gradually increasing the access request processing volume of the target business system by utilizing the traffic opening threshold, this embodiment of the invention proposes a "fast start, slow increase" method for restoring the target business system.
[0164] Reference Figure 5 , Figure 5 This is a schematic diagram illustrating the "fast start, slow upgrade" target business system recovery method provided in an embodiment of the present invention. For example, the maximum traffic opening threshold is set to the server's maximum QPS. It should be noted that this maximum QPS should be the latest maximum QPS after the server has been upgraded and repaired. Figure 5 As shown, the horizontal axis represents the timeline after the target business system enters the connected state, with recovery time increasing from left to right; while the vertical axis represents the ratio of the number of access requests the target business system can receive to the maximum QPS at different time points. (Refer to...) Figure 5 The term "fast start" refers to selecting a smaller traffic opening threshold as the maximum target for the target business system to handle access requests during the initial period after the system recovers from a disconnected state to a connected state. Initially, 10% of the maximum QPS is selected as the current traffic opening threshold to test the availability of the target business system. Figure 5 As shown, point A represents the target business system's ability to handle 10% of its maximum QPS before the first time point. After the success rate of processing the first set of access requests meets the target ratio, the next selected traffic opening threshold should be significantly larger than the current first traffic opening threshold, for example... Figure 5In this embodiment of the invention, the traffic opening threshold for the next time period is selected as 70% of the maximum QPS as the second traffic opening threshold. This is because, as mentioned above, after the target business system has been repaired or updated, its processing capacity generally remains stable or even increases. Therefore, after the first set of access requests confirms that the target business system is currently available, a larger traffic opening threshold can be set to accelerate the startup process of the target business system and improve its processing efficiency from a disconnected state to a normal working state. Figure 5 As shown, point B indicates that between the first and second time nodes, the target business system can handle 70% of its maximum QPS (Queries Per Second). Since the more access requests the target business system handles, and the closer these requests are to its maximum capacity (i.e., maximum QPS), maintaining stable operation becomes increasingly difficult. Therefore, after the "fast start" phase, the target business system's traffic control should enter a "slow ramp-up" state, using gradual changes in the traffic opening threshold to allow the system to adapt to the larger number of access requests, preventing it from crashing again. Figure 5 As shown, point C indicates that between the second and third time nodes, the target business system can handle 80% of its maximum QPS, a mere 10% increase compared to 70% of the maximum QPS in the previous time interval. Furthermore, in the next time interval, between the third and fourth time nodes, point D indicates that the target business system can handle 85% of its maximum QPS. The increase in the traffic opening threshold decreases again, aiming to ensure that during the "slow increase" phase, the current rate of increase in the traffic opening threshold is lower than the rate of increase in the previous time interval. This process continues until the maximum traffic opening threshold is selected as the current traffic opening threshold, allowing the target business system to handle the maximum number of access requests. In this state, the target business system can calculate comprehensive health information based on historical access data and ultimately formulate a real-time traffic control strategy to dynamically control target access requests during normal operation.
[0165] Through steps S400-S410 above, this embodiment of the invention provides a method to control the entire process of a target business system recovering from a disconnected state to a connected state after a failure, or in the case of the target business system's initial online deployment, by using a set of traffic opening thresholds. This ensures that the target business system can stably enter a normal working state, preventing it from failing again due to excessive access requests. Furthermore, based on the actual repair and update status of the target business system, a "fast start, slow upgrade" recovery scheme is proposed. This improves the recovery efficiency of the target business system while reducing the risk of it falling back into a disconnected state, thus positively impacting the stable operation of the target business system.
[0166] In summary, the traffic control method proposed in this invention involves the server first configuring special event information for the target business system to determine whether to accept target access requests during system maintenance periods or when the number of target access requests exceeds the maximum request limit. Additionally, target requests are pre-screened using blacklist and whitelist request tables. During normal operation of the target business system, the server continuously updates the comprehensive health information of the target business system across different time dimensions by acquiring historical access request information. Based on this comprehensive health information, a dynamically changing real-time traffic control strategy is formulated, and traffic control is applied to target access requests according to this strategy. This traffic control method eliminates the need for manual configuration of access limits, offering high efficiency and real-time performance, and effectively adapts to the rapid pace of technological updates in the current internet landscape. Specifying the real-time traffic control strategy using comprehensive health information across different time dimensions enhances the scientific rigor and accuracy of the real-time traffic control strategy. When the target business system encounters a failure and becomes disconnected, the server continuously sends probing requests to the target business system to confirm whether the target business system has recovered to the connected state. After the target business system is restored to online, the recovery process of the target business system is controlled by the traffic opening threshold set, and a "fast start, slow ramp" recovery strategy is adopted to improve the recovery efficiency of the target business system, reduce the risk of the target business system failing again, and further improve the stability of the target business system operation.
[0167] The following describes the implementation process of the flow control method in the banking system, using a banking business system as an example.
[0168] Reference Figure 6 , Figure 6 This is a schematic diagram of the architecture of a flow control system provided in an embodiment of the present invention. Figure 6As shown, this system can be installed on a server to implement dynamic traffic control for target business systems. The system includes a health monitoring module, a rate limiting strategy layer, a data storage layer, a traffic control layer, a bank service access layer, a dedicated service line, and bank services.
[0169] The health detection module continuously collects bank request data reported by the bank service access layer. This bank request data is the historical access status data corresponding to the target access request mentioned above. Refer to Table 2 below; Table 2 is a bank access request processing result table provided in this embodiment of the invention.
[0170] Table 2
[0171]
[0172]
[0173] As shown in Table 2 above, the processing results of bank request data are stored in multiple fields such as bank_type, line_name, succ, use_time, and req_time, with each field corresponding to data types such as string, int, and datetime. For example, bank_type stores bank type information; line_name stores the name of the bank service line; succ stores data as 1 or 0, where 1 indicates successful access and 0 indicates failed access; use_time stores the request time, and req_time stores the request time. Similar to the format in Table 2, this health detection module stores the collected bank request data in the data layer and periodically calculates and updates the comprehensive health information of the bank service line. This comprehensive health information serves as data support for the dynamic rate limiting module of the flow control layer.
[0174] The rate limiting strategy layer includes a rate limiting configuration management terminal and a management timer. Management and maintenance personnel configure rate limiting strategies for multiple banks (e.g., Bank A, Bank B, Bank C, etc.) within the current banking system through this rate limiting configuration management terminal. Unlike the real-time traffic control strategy in the previous embodiment, the rate limiting strategy here is actually specific time information as described above. That is, the rate limiting strategy includes the announcement time data for each bank (during the announcement period, the banking system does not accept access requests; therefore, the announcement time here is equivalent to the system maintenance information mentioned above), blacklist / whitelist data (i.e., the blacklist request table and whitelist request table mentioned above), and rate limiting configuration data (i.e., the maximum number of requests per unit time mentioned above). The management timer is used to periodically synchronize the rate limiting strategy to the CKV via the NTP service based on the rate limiting strategy from the rate limiting configuration management terminal and the comprehensive health information from the health monitoring module, facilitating the traffic control layer to quickly obtain the rate limiting data from the rate limiting strategy. Rate limiting data refers to the announcement time data, blacklist / whitelist data, and rate limiting configuration data in the rate limiting strategy.
[0175] The data storage layer includes a relational database MySQL and an in-memory database CKV. MySQL stores the rate limiting policies configured by management and maintenance personnel and the comprehensive health information of the bank service lines. CKV stores the rate limiting data of each bank service line for the traffic control layer to quickly retrieve.
[0176] The traffic control layer includes an announcement system module, a blacklist / whitelist module, a dynamic rate limiting module, and other data modules. The announcement system module obtains the bank's announcement time; the blacklist / whitelist module obtains blacklist / whitelist data; the dynamic rate limiting module obtains rate limiting configuration data; and the other data modules obtain data other than the aforementioned rate limiting data. Based on the rate limiting data and comprehensive health information, the traffic control layer determines the rate limiting status of each bank access request according to a preset strategy. This rate limiting status is either accessible or inaccessible, thereby determining whether the bank access request can be received and processed by the banking business system.
[0177] The bank service access layer is a proxy layer for the server to access various bank service lines. Its main function is to shield the policy logic of accessing the bank and report the results and time consumption of the bank access requests (that is, the historical access status information mentioned above) to the health detection module, so that the health detection module can calculate the comprehensive health information of each bank service line.
[0178] A dedicated service line refers to a private access network between a server and various banks, while banking services refer to the business service systems of each bank.
[0179] Combination Figure 6 The schematic diagram of the flow control system architecture shown is as follows: Figure 7This describes the process of accessing the banking system. Figure 7 This is a flowchart illustrating the steps involved in accessing a banking system. First, an individual accesses banking services via online banking software on a mobile device such as a smartphone, or bank staff access services via a terminal device such as a computer. This request will initially trigger rate limiting, which is then handled by… Figure 6 The traffic control layer supports determining whether the current banking system can be accessed based on the rate limiting service. If the target of the rate limiting service is a blacklisted object, or the banking system is in the announcement period, or the number of access requests received by the banking system has exceeded the system's rate limiting configuration, then the current banking system is determined to be inaccessible, and an access failure message is returned to the terminal device. If the current banking system is determined to be accessible, the bank access request enters the bank service through the bank service access layer. The bank's business service system processes the bank access request, and after processing, the bank service returns the access processing result to the terminal device and continuously reports the access processing result to the health check module so that the health check module can continuously update the health status of the banking system and adjust the dynamic rate limiting strategy accordingly.
[0180] Reference Figure 8 , Figure 8 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. The server is equivalent to... Figure 1 The server 102 shown can implement the steps in the flow control method described above through hardware or a combination of hardware and software. Figure 8 As shown, the server may include:
[0181] The first module 810 is used to obtain historical access status information of the target business system after a preset time interval; wherein, the historical access status information is used to characterize the traffic status of the target business system being accessed.
[0182] The second module 820 is used to determine the comprehensive health information of the target business system across multiple time dimensions based on historical access information; the comprehensive health information is used to characterize the overall response level of the target business system.
[0183] The third module 830 is used to determine the real-time traffic control strategy for the target business system based on the comprehensive health information.
[0184] The fourth module 840 is used to perform traffic control on target access requests according to real-time traffic control policies.
[0185] In some embodiments, the first module includes at least one of the following:
[0186] The first unit is used to obtain the initiation time information of access requests to the target business system within a historical time period;
[0187] The second unit is used to obtain the time consumption information of access requests to the target business system within a historical time period;
[0188] The third unit is used to obtain access success and failure information of access requests to the target business system within a historical time period;
[0189] The fourth unit is used to obtain object information of access requests to the target business system within a historical time period. The object information includes the identifier of the business system to be requested and the identifier of the current access request.
[0190] The fifth unit is used to obtain the total number of access requests to the target business system within a historical time period.
[0191] In some embodiments, the second module includes:
[0192] The sixth unit is used to calculate the average time consumption of the target business system and the unit time statistics of the target business system under different time dimensions based on historical access information.
[0193] The seventh unit is used to calculate the independent health information for each time dimension based on the average time consumption information and the unit time statistics under different time dimensions.
[0194] The eighth unit is used to calculate the comprehensive health information based on the independent health information under each time dimension.
[0195] In some embodiments, the sixth unit includes:
[0196] Unit 9 is used to calculate the total number of requests to the target business system per unit time based on the total number of access requests to the target business system within a historical time period.
[0197] Unit 10 is used to calculate the number of successful requests to the target business system per unit time based on the success and failure information of access requests to the target business system within a historical time period.
[0198] Unit 11 is used to calculate the average time spent by the target business system per unit of time based on the time spent information of access requests to the target business system within a historical time period.
[0199] Unit 12 is used to calculate the percentage of successful requests based on the total number of requests to the target business system within a unit of time and the number of successful requests to the target business system within a unit of time.
[0200] In some embodiments, the seventh unit includes:
[0201] The thirteenth unit is used to calculate independent health information for each time dimension based on the average time consumption information of the target business system under historical access conditions, the total number of requests per unit time of the target business system, the number of successful requests per unit time, the average time consumption per unit time, and the percentage coefficient of successful requests per unit time.
[0202] In some embodiments, the eighth unit includes:
[0203] The fourteenth unit is used to configure the weight thresholds for independent health information under each time dimension; among them, the weight thresholds for independent health information are used to characterize the degree of influence of the current independent health information on the overall health information;
[0204] The fifteenth unit is used to perform weighted calculations on each independent health information according to the weight threshold of each independent health information to obtain comprehensive health information; wherein, the weight threshold of independent health information in the time dimension closer to the current time is greater than the weight threshold of independent health information in the time dimension farther from the current time.
[0205] In some embodiments, the server may further include:
[0206] The fifth module is used to determine the preset query rate coefficient per second corresponding to the health range based on the health range in which the comprehensive health information is located.
[0207] The sixth module is used to calculate the actual query rate per second of the target business system based on the maximum query rate per second and the preset query rate per second coefficient of the target business system.
[0208] The seventh module is used to determine the real-time traffic control strategy for the target business system based on the actual query rate per second of the target business system.
[0209] In some embodiments, the server may further include:
[0210] The eighth module is used to continuously send probe requests to the target business system when the target business system is disconnected, until the target business system is determined to have restored connection based on the response information received from the target business system.
[0211] The ninth module is used to send access requests corresponding to each traffic opening threshold to the target business system in sequence according to a preset set of traffic opening thresholds. The set of traffic opening thresholds contains multiple traffic opening thresholds at different time points, and each traffic opening threshold is used to characterize the maximum number of access requests that the target business system can receive at each time point.
[0212] In some embodiments, the ninth module includes:
[0213] The sixteenth unit is used to select the smallest first traffic opening threshold from the traffic opening threshold set as the current traffic opening threshold, and send a first access request set with a number less than the current traffic opening threshold to the target business system that has recovered the connection status.
[0214] The seventeenth unit is used to select a second traffic opening threshold that is greater than the first traffic opening threshold from the traffic opening threshold set according to the threshold size when the success rate of the request processing of the first access request set meets the target ratio, and send a second access request set that meets the current traffic opening threshold to the target business system, until the largest traffic opening threshold in the traffic opening threshold set is used as the current traffic opening threshold.
[0215] In some embodiments, the server may further include at least one of the following:
[0216] The tenth module is used to configure the system maintenance information of the target business system; the system maintenance information is used to characterize the inaccessibility period of the target business system.
[0217] The eleventh module is used to configure the blacklist request table and whitelist request table of the target business system. Access requests in the blacklist request table are configured to be unable to access the target business system, while access requests in the whitelist request table are configured to be able to access the target business system.
[0218] The twelfth module is used to configure the maximum number of requests that the target business system can support per unit of time.
[0219] In some embodiments, the server may further include at least one of the following:
[0220] The thirteenth module is used to obtain the current traffic opening threshold of the target business system according to the real-time traffic control policy. When the current access volume of the target business system is greater than the current traffic opening threshold, the rate limiting status of the target access request is determined to be inaccessible. When the current access volume of the target business system is less than or equal to the current traffic opening threshold, the rate limiting status of the target access request is determined to be accessible.
[0221] The fourteenth module is used to obtain the blacklist request table and whitelist request table of the target business system according to the real-time traffic control policy, identify the request identity of the target access request based on the blacklist request table and whitelist request table, and determine the rate limiting status of the target access request as an accessible status when the target access request is a whitelist request; and determine the rate limiting status of the target access request as an inaccessible status when the target access request is a blacklist request.
[0222] The fifteenth module is used to perform rate limiting control on target access requests based on the rate limiting status of the target access request.
[0223] In summary, the server provided in this embodiment of the invention acquires historical access status information of the target business system at regular intervals to grasp the real-time traffic status of the target business system, calculates the comprehensive health information of the target business system, and determines a real-time traffic control strategy to complete traffic control of target access requests. This invention can adapt to the updating and iteration status of the target business system in a timely manner, generate corresponding real-time traffic control strategies based on the real-time status of the target business system, and ultimately accurately achieve dynamic traffic control of target access requests. It is highly efficient and real-time, and can well adapt to the current speed of Internet technology updates. In addition, this invention can determine the comprehensive health information of the target business system under multiple different time dimensions based on historical access status information. This invention combines the comprehensive response level of the target business system under multiple different time dimensions to determine the real-time traffic control strategy, so that the real-time traffic control strategy can reflect the degree of impact of different time dimensions, further improving the accuracy of the real-time traffic control strategy.
[0224] This invention also provides an electronic device, which includes a processor and a memory;
[0225] The memory stores the program;
[0226] The processor executes the program to perform Figure 2 The flow control method of server 102 shown.
[0227] The electronic device has the function of traffic control for target access requests to the target business system, such as personal computers, mobile phones, smartphones, personal digital assistants, wearable devices, PDAs, tablets, etc.
[0228] In this embodiment of the invention, the processor included in the electronic device has the following functions:
[0229] Every preset time interval, historical access status information of the target business system is obtained; the historical access status information is used to characterize the traffic status of the target business system.
[0230] Based on historical access information, the overall health information of the target business system is determined across multiple time dimensions; the overall health information is used to characterize the overall response level of the target business system.
[0231] Based on comprehensive health information, determine the real-time traffic control strategy for the target business system;
[0232] Traffic control is applied to target access requests based on real-time traffic control policies.
[0233] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned flow control method.
[0234] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0235] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0236] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0237] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0238] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0239] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0240] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0241] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0242] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A flow control method, characterized in that, include: Every preset time interval, historical access status information of the target business system is obtained; wherein, the historical access status information is used to characterize the traffic status of the target business system being accessed; Based on the historical access information, the independent health information of the target business system under multiple different time dimensions is determined, and the comprehensive health information of the target business system is determined based on each independent health information; wherein, each independent health information is used to characterize the response level of the target business system under the corresponding time dimension, and the comprehensive health information is used to characterize the overall response level of the target business system; the degree of influence of the independent health information under different time dimensions on determining the comprehensive health information is different; Based on the comprehensive health information, determine the real-time traffic control strategy for the target business system; Traffic control is applied to the target access request according to the real-time traffic control strategy. When the target business system is disconnected, continuously send probing requests to the target business system until it is determined that the target business system has restored its connection based on the response information received from the target business system. Select the smallest first traffic opening threshold from the set of traffic opening thresholds as the current traffic opening threshold, and send a first set of access requests, which is less than the current traffic opening threshold, to the target business system that has recovered its connection. When the success rate of the first set of access requests meets the target ratio, a second traffic opening threshold greater than the first traffic opening threshold is selected from the set of traffic opening thresholds according to the threshold size as the current traffic opening threshold. A second set of access requests that meets the current traffic opening threshold is then sent to the target business system until the largest traffic opening threshold in the set of traffic opening thresholds is selected as the current traffic opening threshold. The set of traffic opening thresholds contains multiple traffic opening thresholds at different time points, and each traffic opening threshold is used to characterize the maximum number of access requests that the target business system can receive at each time point.
2. The flow control method according to claim 1, characterized in that, The acquisition of historical access information of the target business system includes at least one of the following: Obtain the initiation time information of access requests to the target business system within a historical time period; Alternatively, obtain the time consumption information of access requests to the target business system within a historical time period; Alternatively, obtain access success and failure information of access requests to the target business system within a historical time period; Alternatively, obtain object information of access requests to the target business system within a historical time period, wherein the object information includes the identifier of the business system to be requested and the identifier of the current access request; Alternatively, obtain the total number of access requests to the target business system within a historical time period.
3. The flow control method according to claim 2, characterized in that, The step of determining the independent health information of the target business system under multiple different time dimensions based on the historical access status information, and determining the comprehensive health information of the target business system based on each independent health information, includes: Based on the historical access information, calculate the average time consumption of the target business system and the unit time statistics of the target business system under different time dimensions; Based on the average time consumption information and the unit time statistics under different time dimensions, the independent health information under each time dimension is calculated. The comprehensive health information is calculated based on the independent health information at each time dimension.
4. The flow control method according to claim 3, characterized in that, The step of calculating the unit-time statistics of the target business system under different time dimensions based on the historical access information includes: Calculate the total number of requests to the target business system within a unit of time based on the total number of access requests to the target business system during the historical time period; Based on the success and failure information of access requests to the target business system within the historical time period, calculate the number of successful requests to the target business system per unit time. Based on the time consumption information of access requests to the target business system within the historical time period, calculate the average time consumption of the target business system per unit time. The percentage coefficient of the successful request volume is calculated based on the total number of requests made by the target business system within a unit of time and the number of successful requests made by the target business system within a unit of time.
5. The flow control method according to claim 4, characterized in that, The step of calculating independent health information for each time dimension based on the average time consumption information and the unit time statistics under different time dimensions includes: Based on the average time consumption information of the target business system under historical access conditions, as well as the total number of requests per unit time, the number of successful requests per unit time, the average time consumption per unit time, and the percentage coefficient of the number of successful requests, independent health information under each time dimension is calculated.
6. A flow control method according to any one of claims 3-5, characterized in that, The comprehensive health information is calculated based on the independent health information under each time dimension, including: Configure weight thresholds for independent health information under each time dimension; wherein, the weight thresholds for independent health information are used to characterize the degree of influence of the current independent health information on the comprehensive health information; Based on the weight threshold of each independent health status information, the individual health status information is weighted and calculated to obtain the comprehensive health status information; Among them, the weight threshold of independent health information in the time dimension closer to the current time is greater than the weight threshold of independent health information in the time dimension farther from the current time.
7. The flow control method according to claim 1, characterized in that, The step of determining the real-time traffic control strategy for the target business system based on the comprehensive health information includes: Based on the health range in which the comprehensive health information is located, determine the preset query rate coefficient per second corresponding to the health range; The actual query rate per second of the target business system is calculated based on the maximum query rate per second of the target business system and the preset query rate per second coefficient. Based on the actual query rate per second of the target business system, determine the real-time traffic control strategy for the target business system.
8. The flow control method according to claim 1, characterized in that, The method further includes at least one of the following: Configure system maintenance information for the target business system; wherein, the system maintenance information is used to characterize the inaccessibility period of the target business system; Alternatively, configure a blacklist request table and a whitelist request table for the target business system, wherein access requests in the blacklist request table are configured to be unable to access the target business system, and access requests in the whitelist request table are configured to be able to access the target business system. Alternatively, configure the target business system to support the maximum number of requests per unit of time.
9. A flow control method according to claim 1, characterized in that, The step of controlling the traffic of the target access request according to the real-time traffic control policy includes at least one of the following: The current traffic access threshold of the target business system is obtained according to the real-time traffic control strategy. When the current access volume of the target business system is greater than the current traffic access threshold, the rate limiting status of the target access request is determined to be an inaccessible state. When the current access volume of the target business system is less than or equal to the current traffic opening threshold, the rate limiting status of the target access request is determined to be an accessible status. Alternatively, the blacklist request table and whitelist request table of the target business system can be obtained according to the real-time traffic control policy. The request identity of the target access request can be identified according to the blacklist request table and the whitelist request table. When the target access request is a whitelist request, the rate limiting status of the target access request is determined to be an accessible status; when the target access request is a blacklist request, the rate limiting status of the target access request is determined to be an inaccessible status. Traffic control is applied to the target access request based on its rate limiting status.
10. A server, characterized in that, include: The first module is used to acquire historical access status information of the target business system after a preset time interval; wherein, the historical access status information is used to characterize the traffic status of the target business system being accessed. The second module is used to determine the independent health information of the target business system under multiple different time dimensions based on the historical access status information, and to determine the comprehensive health information of the target business system based on each independent health information; wherein, each independent health information is used to characterize the response level of the target business system under the corresponding time dimension, and the comprehensive health information is used to characterize the overall response level of the target business system; the degree of influence of the independent health information under different time dimensions on determining the comprehensive health information is different; The third module is used to determine the real-time traffic control strategy of the target business system based on the comprehensive health information. The fourth module is used to perform traffic control on target access requests according to the real-time traffic control strategy; The eighth module is used to continuously send probing requests to the target business system when the target business system is in a disconnected state, until it is determined that the target business system has restored its connection state based on the response information received from the target business system. The ninth module is used to select the smallest first traffic opening threshold from the traffic opening threshold set as the current traffic opening threshold, and send a first set of access requests less than the current traffic opening threshold to the target service system that has recovered its connection. When the success rate of the request processing of the first set of access requests meets the target ratio, a second traffic opening threshold greater than the first traffic opening threshold is selected from the traffic opening threshold set according to the threshold size as the current traffic opening threshold, and a second set of access requests that meets the current traffic opening threshold is sent to the target service system, until the largest traffic opening threshold in the traffic opening threshold set is used as the current traffic opening threshold. The traffic opening threshold set contains multiple traffic opening thresholds at different time points, and each traffic opening threshold is used to characterize the maximum number of access requests that the target service system can receive at each time point.
11. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the method as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Method and system for controlling access flow
CN106817424A
Flow control method and system
CN108156091A