Service calling rate control method, system and equipment and storage medium
By constructing a dual-dimensional metadata system and a PID-QLearning hybrid algorithm model, combined with a thread pool and long connection pool linkage mechanism, the problem of third-party service call rate exceeding QPS limit under high concurrency was solved, thus maximizing system stability and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, the call rate of third-party services can easily exceed the QPS limit under instantaneous high concurrency. It is impossible to dynamically adjust according to the QPS limit or changes in business load, and it is impossible to monitor in a timely manner, resulting in the instability of the message platform system.
A dual-dimensional metadata system for tasks and services is constructed. The PID-QLearning hybrid algorithm model is used to adjust the call rate. Combined with the linkage mechanism of thread pool and long connection pool, dynamic scheduling and multi-level elastic management are achieved, and system indicators are monitored in real time.
It achieves the goal of avoiding exceeding the QPS limit under high concurrency conditions, ensuring maximum resource utilization, stable and efficient system operation, and meeting the calling requirements of different tasks.
Smart Images

Figure CN122045014A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed system scheduling technology, and in particular to a method, system, device and storage medium for controlling service call rate. Background Technology
[0002] With the rapid development of internet technology, messaging platforms are becoming increasingly important in enterprise applications. Within these platforms, sending messages (such as SMS, email, attendance notifications, etc.) typically relies on third-party services, which often have limitations on their call frequency (Queries Per Second, QPS). To ensure efficient operation and timely, reliable message delivery, effective control and management of the call rate of these third-party services are necessary. Currently, the call rate of third-party services is usually controlled statically based on preset thresholds, using batch fetching or fixed time interval scheduling. This approach is coarse-grained and prone to exceeding the QPS limit under sudden high concurrency, failing to dynamically adjust based on QPS limits or changes in business load, and lacking timely monitoring capabilities.
[0003] Therefore, there is a need to provide a method, system, device, and storage medium for controlling service call rates, which can improve the stability, response time, and resource utilization of the messaging platform system when facing complex and ever-changing business environments, especially under dynamic load changes. Summary of the Invention
[0004] This application addresses the technical problems existing in the prior art: the call rate of third-party services easily exceeds the QPS limit of third-party services under instantaneous high concurrency, and cannot be dynamically adjusted according to QPS limits or changes in business load, nor can it be monitored in a timely manner. It provides a method, system, device, and storage medium for controlling the service call rate. The technical solution of this application to solve the above technical problems is as follows:
[0005] This application provides a method for controlling service call rate, the method comprising:
[0006] Based on a pre-built dual-dimensional metadata system of tasks and services, the baseline call rate is determined;
[0007] Collect and adjust the dynamic periodic state perception of the two-dimensional metadata system;
[0008] Based on dynamic periodic state perception, the baseline call rate is adjusted using a rate adjustment model to obtain the target call rate; the rate adjustment model is a PID-QLearning hybrid algorithm model.
[0009] A dedicated scheduling engine for persistent tasks is established. This engine invokes tasks from the dual-dimensional metadata system based on the target call rate. The dedicated scheduling engine for persistent tasks adopts a dual-pool linkage mechanism of thread pool and long connection pool.
[0010] Multi-level control is implemented based on service elasticity levels, and rate adjustment logs, load status, and multi-level control execution are monitored in real time, with early warnings issued.
[0011] This application provides a control system for service call rate, the system including a dual-dimensional metadata management module, a dynamic cycle perception module, a PID-QLearning hybrid control module, a dual-pool linkage scheduling module and an elastic management and monitoring module, wherein the dual-pool linkage scheduling module includes a thread pool management unit and a long connection pool management unit;
[0012] The dual-dimensional metadata management module is configured to determine the baseline call rate based on a pre-built dual-dimensional metadata system for tasks and services;
[0013] The dynamic periodic perception module is configured to collect and adjust the dynamic periodic state perception of the dual-dimensional metadata system.
[0014] The PID-QLearning hybrid control module is configured to adjust the baseline call rate based on the dynamic cycle state perception using a rate adjustment model to obtain the target call rate; the rate adjustment model is a PID-QLearning hybrid algorithm model.
[0015] The dual-pool linkage scheduling module is configured to establish a dedicated scheduling engine for resident tasks. The dedicated scheduling engine for resident tasks calls tasks in the dual-dimensional metadata system according to the target call rate.
[0016] The elasticity management and monitoring module is configured to perform multi-level management based on the service elasticity level, and to monitor the rate adjustment logs, load status, and multi-level management execution status in real time and issue early warnings.
[0017] This application provides an electronic device, including a memory for storing computer software programs and a processor for reading and executing the computer software programs, thereby implementing the above-mentioned service call rate control method.
[0018] This application provides a non-transitory computer-readable storage medium storing a computer software program, which, when executed by a processor, implements the above-described method for controlling the service call rate.
[0019] The beneficial effects of this application are as follows: By constructing a dual-dimensional metadata system for tasks and services, a baseline call rate is determined. Based on this, the baseline call rate is dynamically perceived and adjusted using a PID-QLearning hybrid algorithm model, precisely controlling the call rate and avoiding exceeding third-party QPS limits under instantaneous high concurrency, thus ensuring maximum resource utilization in different time periods. The dedicated scheduling engine for resident tasks achieves efficient scheduling through a dual-pool linkage mechanism of thread pool and long connection pool, meeting the call requirements of different tasks. Finally, a multi-level elastic control mechanism is used for refined management, and various system indicators are monitored in real time to ensure stable and efficient system operation. Attached Figure Description
[0020] Figure 1 An exemplary block diagram of a service call rate control system provided in an embodiment of this application;
[0021] Figure 2 An exemplary flowchart of a service call rate control method provided in an embodiment of this application;
[0022] Figure 3 A schematic diagram of an embodiment of the electronic device provided in this application;
[0023] Figure 4 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided in this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0026] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessarily obscuring the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0027] Please see Figure 1 , Figure 1 This is an exemplary block diagram of a control system for service call rate provided according to embodiments of this application. For example... Figure 1 As shown, the service call rate control system 100 may include a dual-dimensional metadata management module 110, a dynamic cycle perception module 120, a PID-Q Learning hybrid control module 130, a dual-pool linkage scheduling module 140, and an elastic management and monitoring module 150. The dual-pool linkage scheduling module 140 includes a thread pool management unit 141 and a long connection pool management unit 142. The service call rate control system 100 involved in the embodiments of this specification will be described in detail below. It should be noted that the following embodiments are only for explaining this specification and do not constitute a limitation thereof.
[0028] In some embodiments, the dual-dimensional metadata management module 110 can be configured to determine the baseline call rate based on a pre-built dual-dimensional metadata system for tasks and services.
[0029] In some embodiments, the dynamic periodicity sensing module 120 can be configured to collect and adjust the dynamic periodicity state sensing of the two-dimensional metadata system.
[0030] In some embodiments, the PID-QLearning hybrid control module 130 can be configured to adjust the baseline call rate based on dynamic periodic state perception using a rate adjustment model to obtain the target call rate, wherein the rate adjustment model is a PID-QLearning hybrid algorithm model.
[0031] In some embodiments, the dual-pool linkage scheduling module 140 can be configured to establish a dedicated scheduling engine for resident tasks, which calls tasks in the dual-dimensional metadata system according to the target call rate.
[0032] In some embodiments, the elasticity management and monitoring module 150 can be configured to perform multi-level management based on the service elasticity level, and monitor rate adjustment logs, load status, multi-level management execution status in real time and issue early warnings.
[0033] For more details regarding the task and service dual-dimensional metadata system, baseline call rate, dynamic periodic state awareness, target call rate, etc., mentioned above, please refer to other parts of this manual (such as...). Figure 2 The description of ).
[0034] It should be noted that the above description of the service call rate control system 100 and its modules is for convenience only and should not be construed as limiting this specification to the scope of the illustrated embodiments. It is understood that those skilled in the art, after understanding the principles of this system, may arbitrarily combine the various modules or construct subsystems connected to other modules without departing from these principles. In some embodiments, Figure 1 The modules disclosed herein can be different modules within a system, or a single module can implement the functions of two or more of the aforementioned modules. For example, modules can share a single storage module, or each module can have its own separate storage module. Such variations are all within the scope of protection of this specification.
[0035] Please see Figure 2 , Figure 2 This is an exemplary flowchart of a service call rate control method provided according to an embodiment of this application. Figure 2 As shown, process 200 may include the following steps.
[0036] Step S1: Determine the baseline call rate based on the pre-built dual-dimensional metadata system of tasks and services.
[0037] The task and service dual-dimensional metadata system refers to the task characteristic data and target service characteristic data during the task invocation process. For example, the task and service dual-dimensional metadata system may include service identifier ID, maximum concurrent capacity C, etc. max Response time threshold T re The parameters include task type, service elasticity level, and resource sensitivity coefficient S. The service identifier (ID) is the identifier for the service. For example, services may include SMS, email, push notifications, payment services, and displaying attendance information. Maximum concurrent capacity (C) is also considered. max This refers to the maximum number of requests a service can handle simultaneously within a given time period. Response time threshold T reThis refers to the maximum acceptable response time for a given service. Task type refers to the type of task request, such as sending SMS messages, pushing notifications, synchronizing order data, or capturing Wi-Fi signals. Different task types may have different requirements for response time and capacity. Service resilience level refers to the service's ability to adapt to changes in load. Resource sensitivity coefficient S measures the degree to which a task depends on system resources. A higher resource sensitivity coefficient S indicates a higher utilization rate of system resources by the service or task, making it more susceptible to system resource impact. A lower resource sensitivity coefficient S indicates a higher concurrency level that the system can withstand.
[0038] In some embodiments, the attendance device automatically captures and analyzes the mobile phone's WIFI signal, and uploads it to a third-party server for processing and storage. Finally, the attendance information is displayed through a mobile app, which can detect the on-duty status of all employees in real time, accurately record employees' arrival, departure and time spent away from their posts, and eliminate the need for manual clocking in, making attendance tracking simpler and smarter. Through cloud data storage, administrators can more conveniently view and manage attendance information anytime and anywhere through a mobile app.
[0039] In some embodiments, the dual-dimensional metadata management module 110 can pre-build a database to store the task features and target service features data from the historical task invocation process, and store the latest task feature data and target service feature data in real time.
[0040] The baseline call rate refers to the reference value of the call rate of the PID-Q Learning hybrid control module 130 before dynamic adjustment. In some embodiments, the dual-dimensional metadata management module 110 can determine the baseline call rate in various ways. For example, the baseline call rate can be preset.
[0041] In some embodiments, the dual-dimensional metadata system includes a time-period load feature vector, wherein the time-period load feature vector is preset by the dual-dimensional metadata management module 110 based on historical data, and the time-period load feature vector includes the load peak coefficient F for 24 time periods within a day. t For example, the dual-dimensional metadata management module 110 can use the load data from 24 time periods in 30 days of historical data to determine the average load quantity or average peak percentage of the current time period within the 30 days of historical data as the load peak coefficient F. tPeak load percentage refers to the ratio of the current load to the maximum load across the 24 time slots of the day, used to measure the activity level of that time slot. For example, if the load from 9:00 AM to 10:00 AM is 950, and the maximum load from 10:00 AM to 11:00 AM is 1000, then the peak load percentage from 9:00 AM to 10:00 AM is 0.95. Therefore, the peak load coefficient F for 9:00 AM to 10:00 AM is... t This can be the average load between 9 AM and 10 AM each day over the past 30 days, or the average percentage of peak loads between 9 AM and 10 AM each day over the past 30 days. For example, the load feature vector can be [F1, F2, F3, ..., F...]. 24 By incorporating load feature vectors into a two-dimensional metadata system, the technical effect of shifting service call rate control from static to dynamic and from coarse-grained to fine-grained control is achieved, thereby enhancing resilience and predictive capabilities.
[0042] In some embodiments, the two-dimensional metadata management module 110 can calculate the maximum concurrent capacity C. max With response time threshold T re The proportional relationship, combined with the resource sensitivity coefficient S and the peak load coefficient F of the current period in the period load feature vector. t The weighting is performed to obtain the weighting ratio, and the baseline call rate is determined based on the weighting ratio.
[0045] In some embodiments, the baseline call rate can reserve a 15% rate redundancy to cope with sudden traffic surges.
[0046] In some embodiments of this specification, the call rate is controlled differently by the resource sensitivity coefficient, thereby improving the overall resource utilization and system resilience. Combined with the load feature vector, dynamic and adaptive rate control is achieved.
[0047] Step S2: Collect and adjust the dynamic periodic state perception of the dual-dimensional metadata system.
[0048] Dynamic periodic state awareness refers to the real-time state changes of a dual-dimensional metadata system for tasks and services within different time periods.
[0049] In some embodiments, the dynamic cycle perception module 120 obtains the current load fluctuation coefficient σ based on the ratio of the current response time standard deviation to the average response time; the dynamic cycle perception module 120 adjusts the collection cycle of the dual-dimensional metadata system based on the current load fluctuation coefficient σ; and the dynamic cycle perception module 120 periodically updates the dynamic cycle status perception of the dual-dimensional metadata system based on the adjusted collection cycle. The time standard deviation refers to the standard deviation of the response times of all task requests within a certain time period, representing the dispersion or fluctuation range of the response time. The average response time refers to the arithmetic mean of the response times of all task requests within a certain time period.
[0050] In some embodiments, the dynamic cycle sensing module 120 can use linear mapping to adjust the collection cycle of the dual-dimensional metadata system based on the current load fluctuation coefficient σ.
[0053] In some embodiments of this specification, by collecting dynamic periodic state awareness, it is possible to support dynamic adjustment of call rate control. By dynamically adjusting the collection cycle of the dual-dimensional metadata system according to load fluctuations, when the load fluctuates greatly, the collection is more frequent, reducing the failure rate of task requests. When the load is stable, the collection cycle is extended, saving system resources and improving resource utilization.
[0054] Step S3: Based on the dynamic cycle state perception, the baseline call rate is adjusted using the rate adjustment model to obtain the target call rate.
[0055] The rate adjustment model refers to the reinforcement learning model used by the PID-QLearning hybrid control module 130 to adjust the calling rate based on a dual-dimensional metadata system. For example, the rate adjustment model can be a PID-QLearning hybrid algorithm model.
[0056] The target call rate refers to the optimal call rate dynamically determined by the rate adjustment model after integrating the dual-dimensional metadata system.
[0057] In some embodiments, the PID-QLearning hybrid control module 130 collects dynamic periodic state perception data and / or historical data to construct a training dataset; based on the training dataset, it trains the rate adjustment model using a mini-batch gradient descent method, wherein the batch size is set to 64 and the learning rate η = 0.001; the model parameters are updated once per hour, and abnormal adjustment data is filtered during the update. Historical data refers to the dynamic periodic state perception data of the two-dimensional metadata system over a certain period of time.
[0058] In some embodiments of this specification, the mini-batch gradient descent method is used to train the model, making model updates smoother and convergence faster, avoiding drastic fluctuations caused by single-sample updates. By performing model parameter updates hourly, the system can adapt to load changes and task fluctuations in a timely manner, achieving continuous online self-optimization. By setting up a PID-QLearning hybrid control module, the system can continuously train and self-update the rate adjustment model using dynamic periodic state-aware data and historical data within the acquisition cycle. The PID-QLearning hybrid algorithm model combines response speed and long-term strategy optimization capabilities, realizing dynamic and fine-grained adjustment of the call rate, achieving the technical effect of maximizing throughput and minimizing response time without exceeding the QPS limit.
[0059] In some embodiments, the PID-QLearning hybrid algorithm model also supports algorithm switching functionality; when the load is detected to be in a stable state (e.g., load fluctuation coefficient < 0.2, and lasts for 5 minutes), it automatically switches to a simplified PID algorithm to reduce system overhead; when the load fluctuation increases (e.g., load fluctuation coefficient ≥ 0.3), it switches back to the PID-QLearning hybrid algorithm.
[0060] Step S4: Establish a dedicated scheduling engine for resident tasks. The dedicated scheduling engine for resident tasks calls tasks in the dual-dimensional metadata system according to the target call rate.
[0061] A dedicated scheduling engine for resident tasks refers to a dedicated scheduling engine designed for long-running or continuously triggered tasks, i.e., resident tasks, and is responsible for controlling the scheduling of tasks in the dual-dimensional metadata system.
[0062] In some embodiments, the dual-pool linkage scheduling module 140 establishes a dedicated scheduling engine for resident tasks using a dual-pool linkage mechanism of thread pool and long-connection pool. Based on the target call rate, the dual-pool linkage scheduling module 140 starts resident task executors and dynamically scales the number of resident task executors. The resident task executors, according to the dedicated scheduler for resident tasks, provide calls to third-party service APIs based on the call rate and parameters. The resident task executors support custom task logic, such as calling different services for different task types. For example, the expansion trigger condition is that the percentage of busy threads is greater than or equal to 85% or the connection utilization rate is greater than or equal to 90%, while the shrinkage trigger condition is that the percentage of idle threads is greater than or equal to 70% or the connection idle time is greater than or equal to 30 seconds.
[0063] In some embodiments of this specification, by establishing a dedicated scheduling engine for resident tasks and adopting a dual-pool linkage mechanism of thread pool and long connection pool, resource reuse and dynamic scaling can be achieved in continuous task scheduling scenarios, thus achieving the technical effect of maintaining low latency and high stability under high concurrency conditions.
[0064] In some embodiments, the dual-pool linkage scheduling module 140 establishes a progressive warm-up unit; when a third-party service is registered for the first time or resumes a call, the dual-pool linkage scheduling module 140 starts the progressive warm-up unit; the progressive warm-up unit steadily increases the initial call rate at a preset rate; the initial call rate is a baseline call rate at a preset ratio, which is less than 0.5; when the rate increases to half of the baseline call rate, the dedicated scheduling engine for resident tasks calls the tasks in the dual-dimensional metadata system according to the target call rate.
[0065] The progressive warm-up unit refers to the module that performs task scheduling before the dual-pool linkage scheduling module 140 schedules tasks according to the target call rate. By adding a progressive warm-up unit inside the dedicated scheduling engine for resident tasks, the call rate is gradually increased, avoiding problems such as abnormal response time caused by third-party services not undergoing a cold start during their first call. This ensures a smooth transition between the warm-up phase and the normal control phase, achieving the technical effect of avoiding resource contention caused by sudden high concurrency during the startup phase of third-party services and providing a stable rate increase curve.
[0066] Step S5: Perform multi-level control based on the service elasticity level, and monitor the rate adjustment log, load status, and multi-level control execution status in real time and issue early warnings.
[0067] Service elasticity levels refer to grading indicators used to characterize the resource scalability and performance stability of third-party services under different load conditions. For example, service elasticity levels can include rigid, semi-elastic, and elastic. Rigid means the third-party service has a fixed resource configuration and lacks automatic scaling capabilities; excessively high call rates can easily lead to response timeouts, rate limiting, or service interruptions. Semi-elastic means the third-party service can adjust resources within a certain range, but resource expansion has an upper limit, suitable for medium-load scenarios. Elastic means the third-party service can dynamically scale up and down according to real-time load, possessing high resource elasticity, capable of rapidly increasing resource expansion during peak loads and releasing resources when the load decreases.
[0068] Multi-level management refers to the tiered management strategies corresponding to service elasticity levels. For example, multi-level management can include rigid services, semi-elastic services, and elastic services. Rigid services refer to strict rate limiting and fixed quota strategies. For example, rigid services can limit the maximum call rate to a safety threshold that does not exceed the baseline call rate, prioritize fixed-rate scheduling and single-threaded execution to prevent concurrency surges, automatically reduce speed when the response time exceeds the threshold, and not participate in dynamic scaling or rate self-learning models to maintain execution stability. Semi-elastic services refer to dynamic adjustment and phased rate limiting strategies. For example, they allow dynamic adjustment of the call rate based on real-time load and response time; support multi-threaded concurrency control and sliding window rate limiting algorithms; can combine dynamic periodic state awareness for periodic rate correction; and automatically trigger call rate callbacks or resource reallocation when the load fluctuation coefficient σ exceeds the threshold. Elastic services refer to adaptive scaling and intelligent rate control strategies. For example, they automatically adjust the target call rate based on a hybrid control model of dynamic periodic state awareness and PID-QLearning; support concurrent thread pool scaling and adaptive connection pool expansion; and dynamically optimize the call rate limit by real-time monitoring of dynamic periodic state awareness to maximize system throughput.
[0069] Rate adjustment logs refer to the changes in target call rate, actual call rate, and baseline call rate.
[0070] Load status refers to the current load condition. For example, load status may include the average and standard deviation of response time, the number of concurrent executions, resource utilization (CPU, memory, bandwidth, etc.), and the load fluctuation coefficient σ.
[0071] Multi-level control execution status refers to the execution status of control policies corresponding to service elasticity levels. For example, multi-level control execution status may include rate limiting execution ratio, number of concurrent threads, call success rate, abnormal rate reduction or circuit breaker events, etc.
[0072] In some embodiments, services are divided into multiple elasticity levels; elasticity levels include rigid, semi-elastic, and elastic; corresponding multi-level management and control policies are adapted according to the elasticity level; wherein, multi-level management and control includes rigid services, semi-elastic services, and elastic services; rate adjustment logs, load status, and multi-level management and control execution status are monitored in real time; when abnormal conditions are detected, early warnings are automatically triggered.
[0073] Anomalies refer to events or states that deviate from expectations during task execution, invocation of third-party services, or rate adjustment. For example, anomalies may include abnormal load conditions, response time fluctuations exceeding preset thresholds, or rate adjustment strategy failures. Alerts may include log pushes, SMS notifications, or API callbacks.
[0074] In some embodiments, when an exception occurs and a warning is issued, the task is retried with a delay until it succeeds or the maximum number of retries is exceeded.
[0075] In some embodiments of this specification, a baseline call rate is determined by constructing a dual-dimensional metadata system for tasks and services. Based on this, the baseline call rate is dynamically perceived and adjusted using a PID-QLearning hybrid algorithm model to precisely control the call rate, avoiding exceeding third-party QPS limits under instantaneous high concurrency and ensuring maximum resource utilization in different time periods. A dedicated scheduling engine for resident tasks achieves efficient scheduling through a dual-pool linkage mechanism of thread pool and long connection pool to meet the call requirements of different tasks. Finally, a multi-level elastic control mechanism is used for refined management, and various system indicators are monitored in real time to ensure stable and efficient system operation.
[0076] Please see Figure 3 , Figure 3 A schematic diagram illustrating an embodiment of the electronic device provided in this application. For example... Figure 3 As shown, this application provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 511, it performs the following steps:
[0077] Based on a pre-built dual-dimensional metadata system of tasks and services, the baseline call rate is determined;
[0078] Collect and adjust the dynamic periodic state perception of the two-dimensional metadata system;
[0079] Based on dynamic periodic state perception, the baseline call rate is adjusted using a rate adjustment model to obtain the target call rate; the rate adjustment model is a PID-QLearning hybrid algorithm model.
[0080] A dedicated scheduling engine for persistent tasks is established. This engine invokes tasks from the dual-dimensional metadata system based on the target call rate. The dedicated scheduling engine for persistent tasks adopts a dual-pool linkage mechanism of thread pool and long connection pool.
[0081] Multi-level control is implemented based on service elasticity levels, and rate adjustment logs, load status, and multi-level control execution are monitored in real time, with early warnings issued.
[0082] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided in this application. For example... Figure 4As shown, this embodiment provides a computer-readable storage medium 600, on which a computer program 611 is stored. When the computer program 611 is executed by a processor, it performs the following steps:
[0083] Based on a pre-built dual-dimensional metadata system of tasks and services, the baseline call rate is determined;
[0084] Collect and adjust the dynamic periodic state perception of the two-dimensional metadata system;
[0085] Based on dynamic periodic state perception, the baseline call rate is adjusted using a rate adjustment model to obtain the target call rate; the rate adjustment model is a PID-QLearning hybrid algorithm model.
[0086] A dedicated scheduling engine for persistent tasks is established. This engine invokes tasks from the dual-dimensional metadata system based on the target call rate. The dedicated scheduling engine for persistent tasks adopts a dual-pool linkage mechanism of thread pool and long connection pool.
[0087] Multi-level control is implemented based on service elasticity levels, and rate adjustment logs, load status, and multi-level control execution are monitored in real time, with early warnings issued.
[0088] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0089] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0093] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0094] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for controlling service call rate, characterized in that, The method includes: Based on a pre-built dual-dimensional metadata system of tasks and services, the baseline call rate is determined; Collect and adjust the dynamic periodic state perception of the dual-dimensional metadata system; Based on the dynamic cycle state perception, the baseline call rate is adjusted using a rate adjustment model to obtain the target call rate; the rate adjustment model is a PID-QLearning hybrid algorithm model. A dedicated scheduling engine for persistent tasks is established, which calls tasks in the dual-dimensional metadata system according to the target call rate; the establishment of the dedicated scheduling engine for persistent tasks adopts a dual-pool linkage mechanism of thread pool and long connection pool; Multi-level control is implemented based on service elasticity levels, and rate adjustment logs, load status, and multi-level control execution are monitored in real time, with early warnings issued.
2. The method according to claim 1, characterized in that, The dual-dimensional metadata system includes a time-period load feature vector, which is preset based on historical data and includes the load peak coefficients for 24 time periods within a day.
3. The method according to claim 2, characterized in that, The metadata includes service identifier, maximum concurrent capacity, response time threshold, and resource sensitivity coefficient. The baseline call rate is determined based on a pre-built dual-dimensional metadata system for tasks and services, including: Calculate the ratio between the maximum concurrent load and the response time threshold; By combining the resource sensitivity coefficient with the load peak coefficient of the current period in the period load feature vector, a weighted ratio relationship is obtained; The baseline call rate is determined based on the weighted ratio.
4. The method according to claim 1, characterized in that, The dynamic periodic state awareness of collecting and adjusting the dual-dimensional metadata system includes: The current load fluctuation coefficient is obtained by using the ratio of the current standard deviation of response time to the average response time. The collection cycle of the dual-dimensional metadata system is adjusted according to the current load fluctuation coefficient; Based on the adjusted collection cycle, the dynamic periodic state perception of the dual-dimensional metadata system is updated periodically.
5. The method according to claim 1, characterized in that, The step of adjusting the baseline call rate using a rate adjustment model based on the dynamic periodic state perception to obtain the target call rate includes: Collect the dynamic periodic state-aware data and / or historical data to construct a training dataset; Based on the training dataset, the rate adjustment model is trained using the mini-batch gradient descent method, wherein the batch size is set to 64 and the learning rate η = 0.
001. The model parameters are updated once per hour, and abnormal data is filtered and adjusted during the update.
6. The method according to claim 1, characterized in that, The establishment of a dedicated scheduling engine for resident tasks, wherein the dedicated scheduling engine for resident tasks invokes tasks in the dual-dimensional metadata system according to the target invocation rate, includes: Establish a progressive preheating unit; The progressive warm-up unit is activated when a third-party service is first registered or resumed operation. The progressive preheating unit steadily increases the initial call rate at a preset rate; the initial call rate is a preset ratio of the baseline call rate, and the preset ratio is less than 0.
5. When the speed increases to half of the baseline call rate, the resident task dedicated scheduling engine calls the task in the dual-dimensional metadata system according to the target call rate.
7. The method according to claim 1, characterized in that, The aforementioned multi-level control based on service elasticity levels, and real-time monitoring of rate adjustment logs, load status, and multi-level control execution, with early warnings, includes: The service is divided into multiple resilience levels; these resilience levels include rigid, semi-resilient, and resilient. Based on the elasticity level, a corresponding multi-level control strategy is adapted; wherein, the multi-level control includes rigid services, semi-elastic services, and elastic services; Real-time monitoring of rate adjustment logs, load status, and multi-level control execution; When an abnormal situation is detected, an alert will be automatically triggered.
8. A control system for service call rate, characterized in that, The system includes a dual-dimensional metadata management module, a dynamic cycle perception module, a PID-QLearning hybrid control module, a dual-pool linkage scheduling module, and an elastic management and monitoring module. The dual-pool linkage scheduling module includes a thread pool management unit and a long connection pool management unit. The dual-dimensional metadata management module is configured to determine the baseline call rate based on a pre-built dual-dimensional metadata system for tasks and services; The dynamic periodic perception module is configured to collect and adjust the dynamic periodic state perception of the dual-dimensional metadata system. The PID-QLearning hybrid control module is configured to adjust the baseline call rate based on the dynamic cycle state perception using a rate adjustment model to obtain the target call rate; the rate adjustment model is a PID-QLearning hybrid algorithm model. The dual-pool linkage scheduling module is configured to establish a dedicated scheduling engine for resident tasks. The dedicated scheduling engine for resident tasks calls tasks in the dual-dimensional metadata system according to the target call rate. The elasticity management and monitoring module is configured to perform multi-level management based on the service elasticity level, and to monitor the rate adjustment logs, load status, and multi-level management execution status in real time and issue early warnings.
9. An electronic device, characterized in that, Includes memory used to store computer software programs; A processor is configured to read and execute the computer software program, thereby implementing the service call rate control method according to any one of claims 1-7.
10. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores a computer software program, which, when executed by a processor, implements the service call rate control method as described in any one of claims 1-7.