Queue adjustment method, device and equipment based on thread pool

By obtaining thread running parameters, calculating the target capacity value and adjusting the thread pool capacity when the task queue triggers the rejection policy, the problem of insufficient flexibility caused by the fixed parameters of traditional Java thread pool is solved, and the performance and stability of the system are improved.

CN120670113APending Publication Date: 2025-09-19BEIJING XIAKEHUI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510752308.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Traditional Java thread pools are difficult to adjust dynamically after parameter configuration, resulting in an inability to flexibly respond to load changes in different business scenarios, which may lead to performance bottlenecks or resource waste.

Method used

By obtaining thread running parameters when the task queue triggers the rejection policy, calculating the target capacity value, and sending an adjustment request to the configuration center, the capacity of the thread pool can be dynamically adjusted.

Benefits of technology

It achieves dynamic adjustment of thread pool capacity according to load demand, improves system performance and stability, and avoids system crashes or performance degradation caused by insufficient resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670113A_ABST
    Figure CN120670113A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a queue adjustment method, device and equipment based on a thread pool. The method comprises the steps that when it is determined that a task queue operated in a terminal triggers a refusal strategy, thread operation parameters of the terminal are acquired; wherein the thread operation parameters represent operation conditions of threads in a thread pool in the terminal; the task queue inherits the function of a blocking queue; determining a target capacity value of the task queue according to the thread operation parameters; sending an adjustment request to a configuration center; wherein the adjustment request represents that the capacity of a task queue is requested to be adjusted to a target capacity value; the adjustment request is used for requesting the configuration center to adjust the capacity of a task queue in the terminal to a target capacity value in response to the adjustment request. The method is used for achieving the effect of adjusting queues according to load requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to network technology, and in particular to a queue adjustment method, apparatus and device based on a thread pool. Background Art

[0002] In modern application development, thread pools are a common concurrent programming tool used to manage and reuse thread resources, thereby improving system performance and resource utilization. However, traditional Java thread pool implementations have some limitations, especially in terms of parameter configuration.

[0003] Traditional thread pools typically require specification of parameters such as the number of core threads, maximum number of threads, idle thread lifetime, and task queues during creation. Once these parameters are set, they are difficult to adjust dynamically at runtime, resulting in an inability to flexibly adapt to load fluctuations in different business scenarios. Because these parameters are fixed, the thread pool may not be able to respond promptly to sudden traffic surges or fluctuating load demands, leading to performance bottlenecks or wasted resources.

[0004] Therefore, there is an urgent need for a solution that can adjust the thread pool capacity according to load requirements. Summary of the Invention

[0005] The embodiments of the present application provide a queue adjustment method, apparatus, and device based on a thread pool, so as to adjust the thread pool capacity according to load demand.

[0006] In the first aspect, an embodiment of the present application provides a queue adjustment method based on a thread pool, comprising: when determining that a task queue running in a terminal triggers a rejection policy, obtaining the thread running parameters of the terminal; wherein the thread running parameters represent the running status of the threads of the thread pool in the terminal; the task queue inherits the function of a blocking queue; according to the thread running parameters, determining the target capacity value of the task queue; sending an adjustment request to a configuration center; wherein the adjustment request represents a request to adjust the capacity of the task queue to the target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the task queue in the terminal to the target capacity value in response to the adjustment request.

[0007] In one possible implementation, upon receiving an alarm message sent by a thread monitoring center, it is determined that the task queue triggers a rejection strategy, and a view request is sent to the thread monitoring center; wherein the alarm message indicates that the task queue cannot receive new tasks, or the alarm message indicates that the free capacity of the task queue is less than a preset capacity; the view request is used to request thread running parameters; the thread monitoring center is used to obtain the thread running parameters of the terminal in response to the view request; and receive the thread running parameters sent by the thread monitoring center.

[0008] In a possible implementation, when it is monitored that the task queue cannot receive new tasks, or the idle capacity of the task queue is less than a preset capacity, it is determined that the task queue triggers a rejection strategy, and thread running parameters of the terminal are obtained.

[0009] In one possible implementation, if it is determined that the task execution efficiency carried in the load information is less than a first preset value, it is determined to increase the capacity value of the thread pool, and determine the target capacity value corresponding to the task execution efficiency; if it is determined that the task execution efficiency is greater than or equal to the first preset value, and the thread idle rate carried in the load information is greater than a second preset value, it is determined to reduce the capacity value of the thread pool, and determine the target capacity value corresponding to the thread idle rate; wherein, the target capacity value also indicates the type of thread to be adjusted.

[0010] In one possible implementation, based on a first mapping relationship, a target capacity value corresponding to the task execution efficiency is determined; wherein the first mapping relationship represents a mapping relationship between the task execution efficiency and the target capacity value; or, the task execution efficiency is displayed, and the target capacity value input by the user based on the displayed task execution efficiency is received.

[0011] In one possible implementation, based on a second mapping relationship, a target capacity value corresponding to the thread idle rate is determined; wherein the second mapping relationship represents a mapping relationship between the thread idle rate and the target capacity value; or, the thread idle rate is displayed, and the target capacity value input by the user based on the displayed thread idle rate is received.

[0012] In one possible implementation, if it is determined that the proportion of unexecuted tasks carried in the load information is greater than or equal to a third preset value, it is determined to increase the capacity value of the thread pool and determine the capacity value corresponding to the task ratio; if it is determined that the task ratio is less than the third preset value, it is determined to reduce the capacity value of the thread pool and determine the capacity value corresponding to the task ratio.

[0013] In one possible implementation, the target capacity value corresponding to the task ratio is determined based on a third mapping relationship; wherein the third mapping relationship represents the mapping relationship between the task ratio and the target capacity value; or, the task ratio is displayed, and the target capacity value input by the user based on the displayed task ratio is received.

[0014] In one possible implementation, thread parameters; the thread parameters indicate the target number of threads in the thread pool and the thread type to be adjusted; the configuration center is further used to adjust the number of threads corresponding to the thread type in the thread pool in the terminal based on the target number of threads.

[0015] In a possible implementation, new thread running parameters sent by the thread monitoring center are received; if it is determined that the current capacity value of the task queue indicated by the thread running parameters is consistent with the target capacity value, it is determined that the capacity adjustment of the task queue is successful.

[0016] In a possible implementation, graphic information sent by the thread monitoring center is received, where the graphic information is generated based on new thread running parameters acquired by the thread monitoring center; and the graphic information is sent to the terminal for display.

[0017] In the second aspect, an embodiment of the present application provides a second-hand transaction queue adjustment method based on a thread pool, comprising: when it is determined that the second-hand transaction queue running in the terminal triggers a rejection strategy, obtaining the thread running parameters of the terminal; wherein the thread running parameters represent the running status of the thread of the thread pool in the terminal; the second-hand transaction queue inherits the function of the blocking queue; the second-hand transaction queue includes at least one second-hand transaction task, and the thread is used to execute the second-hand transaction task; according to the thread running parameters, determining the target capacity value of the second-hand transaction queue; sending an adjustment request to the configuration center; wherein the adjustment request represents a request to adjust the capacity of the second-hand transaction queue to the target capacity value; the adjustment request is used to request the configuration center to respond to the adjustment request and adjust the capacity of the second-hand transaction queue in the terminal to the target capacity value.

[0018] In the third aspect, an embodiment of the present application provides a queue adjustment device based on a thread pool, comprising: a first determination module, for obtaining the thread running parameters of the terminal when it is determined that the task queue running in the terminal triggers a rejection policy; wherein the thread running parameters represent the running status of the threads of the thread pool in the terminal; the task queue inherits the function of a blocking queue; a second determination module, for determining the target capacity value of the task queue based on the thread running parameters; an adjustment module, for sending an adjustment request to a configuration center; wherein the adjustment request represents a request to adjust the capacity of the task queue to the target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the task queue in the terminal to the target capacity value in response to the adjustment request.

[0019] In a fourth aspect, an embodiment of the present application provides a queue adjustment device based on a thread pool, comprising: a memory, a processor;

[0020] The memory stores computer-executable instructions;

[0021] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0022] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementation methods of the first aspect.

[0023] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the first aspect and / or various possible implementation methods of the first aspect.

[0024] The thread pool-based queue adjustment method, apparatus, and device provided in the embodiments of the present application require obtaining the thread running parameters of the terminal when determining that the task queue running in the terminal triggers a rejection policy. Based on the running parameters, the current load of the thread pool in the terminal can be determined. Based on the obtained thread running parameters, a target capacity value can be calculated. Based on the determined target capacity value, an adjustment request is sent to the configuration center. The configuration center can adjust the capacity of the task queue in the terminal to the target capacity value based on the received adjustment request, thereby dynamically adjusting the capacity of the thread pool according to the load demand to improve the performance and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0026] Figure 1 Schematic diagram of the thread pool-based queue adjustment scenario provided in this application;

[0027] Figure 2 Schematic diagram of the process of queue adjustment method based on thread pool provided in this application Figure 1 ;

[0028] Figure 3 Schematic diagram of the process of queue adjustment method based on thread pool provided in this application Figure 2 ;

[0029] Figure 4 Graphical information diagram of the thread pool-based queue adjustment method provided in this application Figure 1 ;

[0030] Figure 5 Graphical information diagram of the thread pool-based queue adjustment method provided in this application Figure 2 ;

[0031] Figure 6 A schematic diagram of the structure of the queue adjustment device based on the thread pool provided in this application;

[0032] Figure 7 A schematic diagram of the structure of the queue adjustment based on the thread pool provided in this application.

[0033] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0034] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0035] First, let’s explain the terms involved in this application:

[0036] Thread: It is the smallest unit that a computer operating system can use to schedule operations;

[0037] Thread pool: It is a form of multithreaded processing that adds tasks to a queue and then automatically starts these tasks after creating threads;

[0038] Prometheus: An open-source service monitoring system and time-series database. It provides a common data model and fast data collection, storage, and query interfaces.

[0039] Grafana: is an open source data visualization tool used to monitor and display time series data.

[0040] Apollo: is an open source distributed configuration center that can centrally manage the configuration of applications in different environments and clusters. Configuration changes take effect immediately and can be manually released and rolled back.

[0041] Figure 1 The following is a schematic diagram of the thread pool-based queue adjustment scenario provided for this application, such as Figure 1 As shown, the specific application scenario of this application is that when the user finds that the load of the current thread pool needs to be adjusted, the user cannot directly expand the queue of the thread pool.

[0042] In Java, if users find that the current thread pool load needs to be adjusted, they cannot directly modify the size of the task queue. For example, if the task queue is full and cannot accommodate more tasks, users cannot simply increase the queue capacity. Users can only frequently view the current queue's operating parameters, but cannot increase or decrease the queue capacity.

[0043] In combination with the above scenarios, it can be seen that in the existing technology, although the existing thread pool technology has improved resource utilization and system performance to a certain extent, it still has certain limitations when facing dynamically changing loads, and there is a technical problem that the queue capacity of the thread pool cannot be dynamically adjusted according to load requirements.

[0044] The thread pool-based queue adjustment method provided in the embodiment of the present application requires obtaining the thread running parameters of the terminal when determining that the task queue running in the terminal triggers a rejection policy. Based on the running parameters, the current load of the thread pool in the terminal can be determined. Based on the obtained thread running parameters, a target capacity value can be calculated. Based on the determined target capacity value, an adjustment request is sent to the configuration center. The configuration center can adjust the capacity of the task queue in the terminal to the target capacity value based on the received adjustment request, thereby dynamically adjusting the queue capacity of the thread pool according to the load demand to improve the performance and stability of the system.

[0045] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0046] Figure 2 Schematic diagram of the process of queue adjustment method based on thread pool provided in this application Figure 1 ,like Figure 2 As shown, the method includes:

[0047] S201. When determining that a task queue running in a terminal triggers a rejection policy, obtain thread running parameters of the terminal; wherein the thread running parameters represent the running status of threads in a thread pool in the terminal; the task queue inherits the function of a blocking queue;

[0048] S202: Determine a target capacity value of the task queue according to the thread operation parameters;

[0049] Task queues inherit the functionality of blocking queues, ensuring that under high load conditions, appropriate measures are taken to prevent resource exhaustion.

[0050] When it is determined that the task queue running in the terminal triggers the rejection policy, thread running parameters of the terminal are obtained.

[0051] Optionally, these parameters may include indicators such as the number of threads in the thread pool, the number of running tasks, the number of tasks waiting to be executed, thread utilization, task execution time, task waiting time, QPS of submitted tasks, the number of threads in various states (such as running, waiting, blocked, etc.), the CPU resource usage of each thread or process, and the amount of memory occupied by threads or processes. These parameters can reflect the current load of the terminal's thread pool.

[0052] When the rejection policy is triggered, the triggering reason of the rejection policy can be determined based on the operating parameters.

[0053] The standard library components do not support modifying the queue capacity by default. Therefore, the queue capacity is adjusted by inheriting LinkedBlockingQueue and adding the setCapacity method.

[0054] S203. Send an adjustment request to the configuration center; wherein the adjustment request represents a request to adjust the capacity of the task queue to the target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the task queue in the terminal to the target capacity value in response to the adjustment request.

[0055] When the configuration center receives an adjustment request from the terminal, it parses the target capacity value in the request and performs corresponding operations to change the capacity of the task queue.

[0056] Once the configuration center completes the adjustment, the new thread pool configuration will take effect immediately, allowing the system to quickly adapt to new load conditions. By dynamically adjusting the thread pool size, the system can better handle sudden high load conditions and reduce the risk of system crashes or performance degradation due to insufficient resources.

[0057] Optionally, the configuration center can be an Apollo configuration center. When the software system starts, it reads Apollo's default configuration parameters such as coreSize (minimum number of threads), msxSize (maximum number of threads), queueCapacity (queue capacity), workSlowTime (slow execution time threshold), and queueSlowTime (slow waiting time threshold) (if not configured, local default parameters are used) to load the AdjustableMonitorExecutor thread pool.

[0058] Optionally, you can implement a custom monitorable thread pool object, AdjustableMonitorExecutor, by inheriting the ThreadPoolExecutor class from the Java standard library. This object records the start and end times before and after task execution.

[0059] Optionally, the execution subject of the above steps is the thread pool component of the system, such as a second-hand trading system, a second-hand knowledge training system, etc.

[0060] The thread pool-based queue adjustment method provided in the embodiment of the present application requires obtaining the thread running parameters of the terminal when determining that the task queue running in the terminal triggers a rejection policy. Based on the running parameters, the current load of the thread pool in the terminal can be determined. Based on the obtained thread running parameters, a target capacity value can be calculated. Based on the determined target capacity value, an adjustment request is sent to the configuration center. The configuration center can adjust the capacity of the task queue in the terminal to the target capacity value based on the received adjustment request, thereby dynamically adjusting the queue capacity of the thread pool according to the load demand to improve the performance and stability of the system.

[0061] Figure 3 Schematic diagram of the process of queue adjustment method based on thread pool provided in this application Figure 2 ,like Figure 3 As shown, this embodiment Figure 2 Based on the embodiment, a queue adjustment method based on a thread pool is described in detail. The method includes:

[0062] S301. When receiving an alarm message sent by a thread monitoring center, determine that the task queue triggers a rejection strategy, and send a viewing request to the thread monitoring center; wherein the alarm message indicates that the task queue cannot receive new tasks, or the alarm message indicates that the free capacity of the task queue is less than a preset capacity; the viewing request is used to request to obtain thread running parameters; the thread monitoring center is used to obtain the thread running parameters of the terminal in response to the viewing request; and receive the thread running parameters sent by the thread monitoring center.

[0063] Receiving an alarm from the thread monitoring center indicates that an abnormality has been detected in the task queue. This may be because the task queue cannot accept new tasks or the free capacity of the task queue is less than the preset capacity. At this time, these abnormalities need to be handled.

[0064] Based on the alarm information, determine whether the task queue has triggered a rejection policy. If so, action is required to resolve the issue. To understand the cause of the task queue anomaly, send a request to the thread monitoring center to obtain thread operating parameters. These parameters can help analyze the problem with the task queue. After receiving the request, the thread monitoring center obtains the terminal's thread operating parameters, including the number of threads and thread status. These parameters are crucial for analyzing task queue issues.

[0065] After receiving the thread running parameters sent by the thread monitoring center, the problem of the task queue can be analyzed according to these parameters, and corresponding measures can be taken to solve it.

[0066] Optionally, the monitoring center may be a Prometheus monitoring center (English: Prometheus) or a combination of Prometheus and Grafana.

[0067] This process can effectively manage and control the status of the task queue by receiving alarm information, determining rejection strategies, sending view requests and receiving thread running parameters, ensuring stable and efficient operation under high load conditions.

[0068] S302: When it is monitored that the task queue cannot receive new tasks, or the idle capacity of the task queue is less than a preset capacity, determine that the task queue triggers a rejection strategy, and obtain thread running parameters of the terminal.

[0069] Exemplarily, by monitoring the status of the task queue in real time, when it is detected that the task queue cannot receive new tasks or the idle capacity is less than the preset capacity, the rejection strategy is triggered and the thread running parameters are obtained.

[0070] Continuously monitor the status of the task queue, including metrics such as its length and free capacity. This allows timely detection of overloaded or near-full status, providing a basis for subsequent decision-making. A task queue triggers a rejection policy when any of the following conditions are met: the task queue cannot accept new tasks (for example, it has reached its maximum capacity limit) or the free capacity of the task queue is less than a preset capacity threshold. This prevents task queue overload, prevents system resource exhaustion, and ensures system stability and responsiveness.

[0071] After determining that a task queue has triggered a rejection policy, a request is sent to the thread monitoring center to obtain the current terminal's thread operating parameters. These thread operating parameters provide a deep understanding of the system's current load and bottlenecks, providing data support for further optimization and adjustment.

[0072] S303: If it is determined that the task execution efficiency carried in the load information is less than a first preset value, determine to increase the capacity value of the thread pool, and determine a target capacity value corresponding to the task execution efficiency;

[0073] If it is determined that the task execution efficiency is greater than or equal to a first preset value, and the thread idle rate carried in the load information is greater than a second preset value, determining to reduce the capacity value of the thread pool, and determining a target capacity value corresponding to the thread idle rate;

[0074] The target capacity value also indicates the type of thread to be adjusted.

[0075] It should be noted that the thread running parameters include load information of the thread pool in the terminal.

[0076] Monitor and collect information about the current thread pool load, including task execution efficiency (such as task completion speed, task queue length, etc.) and thread idle rate (i.e., the proportion of threads in an idle state). When the task execution efficiency is detected to be less than the first preset value, this generally means that the existing thread pool capacity is insufficient to efficiently process the current task volume, resulting in task backlogs or insufficient processing speed.

[0077] If the task execution efficiency is greater than or equal to the first preset value, but the thread idle rate is greater than the second preset value, this indicates that while the task processing capacity is generally sufficient, there are too many idle threads, resulting in wasted resources. If the task execution efficiency is lower than the first preset value, the thread pool capacity is increased. This decision is based on increasing parallel processing capabilities, thereby speeding up task processing and reducing task waiting time.

[0078] At the same time, based on the specific value of task execution efficiency, a suitable target capacity value will be determined through a pre-defined mapping relationship (or algorithm) to ensure that the expanded thread pool can more effectively cope with the current load.

[0079] When the task execution efficiency meets the requirement (greater than or equal to the first preset value) and the thread idle rate is too high, the system chooses to reduce the capacity value of the thread pool to save system resources and avoid unnecessary overhead.

[0080] Similarly, a reasonable target capacity value will be determined based on the specific value of the thread idle rate in combination with the second mapping relationship (or algorithm), so that the adjusted thread pool can both meet the task processing requirements and avoid resource waste.

[0081] When determining the target capacity, the system also indicates the thread types that need to be adjusted. This is because different types of threads may have different responsibilities and impact system performance in different ways. Therefore, when adjusting the thread pool capacity, it is necessary to clearly indicate which thread types need to be increased or decreased to achieve more refined resource allocation.

[0082] Optionally, the thread type includes at least one of the following: number of core threads, maximum number of threads.

[0083] Exemplarily, based on a first mapping relationship, a target capacity value corresponding to the task execution efficiency is determined; wherein the first mapping relationship represents a mapping relationship between task execution efficiency and the target capacity value; or, the task execution efficiency is displayed, and the target capacity value input by the user based on the displayed task execution efficiency is received.

[0084] Exemplarily, the first mapping relationship is a pre-built rule set or algorithm for establishing an association between task execution efficiency (such as task completion rate, success rate, and other indicators) and the thread pool target capacity value.

[0085] Alternatively, the mapping relationship may be defined based on historical data, performance test results, or knowledge of domain experts.

[0086] First, the current task execution efficiency is monitored. Then, based on the monitored task execution efficiency, the system searches for or calculates the corresponding target capacity value in the first mapping relationship.

[0087] For example, if the task execution efficiency is low, the first mapping relationship may indicate increasing the capacity of the thread pool to speed up task processing; otherwise, reducing the capacity to avoid resource waste.

[0088] The above method can automatically adjust the thread pool capacity according to task execution efficiency without manual intervention. It can also quickly adapt to changes in task execution efficiency and ensure the rational use of system resources.

[0089] For example, an interface or report is provided to display current task execution efficiency information to the user. This can include charts, numerical values, trend analysis, etc., so that users can intuitively understand the current operating status of the system. The interface displays the task execution efficiency information displayed, and the user manually enters a target capacity value that they deem appropriate based on their own experience, needs, and understanding. Users can then make decisions based on specific business scenarios, expected workloads, or performance goals. Users are allowed to customize the thread pool capacity value based on actual conditions and specific needs. Users can optimize performance based on their own experience and in-depth understanding of the system, rather than relying solely on preset rules.

[0090] In an optional embodiment, these two approaches can complement each other. The system can first provide a preliminary recommended capacity value based on the first mapping relationship, and then allow the user to modify and confirm this recommended value. This leverages the convenience and intelligence of automated mapping while retaining the flexibility and customizability of user intervention, thereby enabling more effective management and optimization of thread pool performance.

[0091] Through the above steps, whether it is the automatic determination method based on the first mapping relationship or the flexible customization method based on user input, the ultimate goal is to reasonably adjust the capacity value of the thread pool according to the task execution efficiency to ensure that the system can run efficiently and stably.

[0092] Exemplarily, based on a second mapping relationship, a target capacity value corresponding to the thread idle rate is determined; wherein the second mapping relationship represents a mapping relationship between the thread idle rate and the target capacity value; or, the thread idle rate is displayed, and the target capacity value input by the user based on the displayed thread idle rate is received.

[0093] Exemplarily, the second mapping relationship is a pre-built rule or algorithm for establishing an association between the thread idle rate and the thread pool target capacity value. Optionally, the second mapping relationship is formed based on an in-depth understanding of system performance and resource utilization and analysis of historical data.

[0094] Through this second mapping relationship, the appropriate thread pool capacity value can be automatically calculated according to the current thread idle rate to optimize resource allocation and system performance.

[0095] Optionally, the thread idle rate in the current thread pool is monitored, and a search or calculation is performed in the second mapping relationship based on the monitored thread idle rate. For example, if the thread idle rate matches a preset range, the system will obtain the corresponding target capacity value.

[0096] To help users understand the current thread pool's operating status and resource utilization, the system intuitively displays the monitored thread idle rate. This helps users better understand system performance and make informed decisions. The thread idle rate can be displayed in a variety of ways, such as as a numeric percentage or as a chart. Users can choose the viewing method that best suits their needs.

[0097] Alternatively, the user can manually enter the target capacity value based on their experience and system performance requirements. This method allows the user to flexibly adjust the line according to actual conditions. The user can enter the target capacity value through the input box, slider or other input device on the interface.

[0098] To ensure that the value entered by the user is reasonable and valid, the user input is validated, for example, to check whether it is within the allowed range, whether it complies with certain rules, etc. If the value entered by the user is invalid, the system prompts the user to re-enter and displays the correct input rules or value range.

[0099] For example, by combining the automatic determination method based on the second mapping relationship with the manual input method, the system can ensure automation and intelligence while retaining user flexibility and customizability. This method can better adapt to different business scenarios and user needs.

[0100] For example, a preliminary target capacity value may be generated based on the second mapping relationship and recommended to the user. This recommended value may serve as a reference for the user's decision-making, helping the user to make a decision more quickly.

[0101] Users can review and confirm the system's recommended initial target capacity value. If they find the recommended value inappropriate, they can modify it based on their experience and needs. Finally, the target capacity value confirmed by the user will be used to adjust the thread pool capacity.

[0102] Exemplarily, according to a third mapping relationship, a target capacity value corresponding to the task ratio is determined; wherein the third mapping relationship represents a mapping relationship between the task ratio and the target capacity value;

[0103] Alternatively, the task ratio is displayed, and a target capacity value input by the user based on the displayed task ratio is received.

[0104] The third mapping relationship is a pre-built correspondence rule or mathematical model used to establish the relationship between the task ratio and the thread pool target capacity value. The task ratio reflects the proportion of tasks of different types or sources in the total task volume.

[0105] Optionally, the task ratio may be the proportion of unexecuted tasks in the total task volume. When the task ratio of unexecuted tasks is too high, it indicates that the current thread pool load is high and needs to be adjusted to ensure the smooth completion of the tasks.

[0106] Optionally, the task ratio may also be the proportion of different types of tasks. The types of tasks may be divided based on the actual functions corresponding to the tasks, and different types of tasks carry different task labels.

[0107] In addition to the system automatically determining the target capacity based on the task ratio, users can also manually enter a target capacity based on their own experience, business needs, and system performance expectations. This approach gives users greater control and flexibility, allowing them to adjust the thread pool capacity based on actual conditions.

[0108] Optionally, the target capacity value entered by the user is received and necessary verification and inspection are performed to ensure its rationality and validity. If the value entered by the user does not meet the requirements or contains errors, the user may be prompted to re-enter or further guidance may be provided.

[0109] Alternatively, a combination of automatic determination based on the third mapping relationship and manual user input can be used to ensure both automation and intelligence while leveraging user experience and expertise. This combination can improve the accuracy and adaptability of the target capacity value, better meeting actual needs.

[0110] As the task ratio changes or the business develops and changes, the system can adjust the thread pool capacity in a timely manner. Users can also re-enter the target capacity value according to the new situation, so that the system can always maintain the optimal operating state.

[0111] S304. If it is determined that the proportion of unexecuted tasks carried in the load information is greater than or equal to a third preset value, determine to increase the capacity value of the thread pool and determine the capacity value corresponding to the task proportion; if it is determined that the task proportion is less than the third preset value, determine to reduce the capacity value of the thread pool and determine the capacity value corresponding to the task proportion.

[0112] If it is determined that the proportion of unexecuted tasks is greater than or equal to a preset third preset value, this means that the system has a serious backlog of tasks and more threads are needed to process these tasks to improve the processing capability and response speed of the system.

[0113] For example, in an online trading system, load information might include the number of transactions being processed, the number of transactions queued for processing, and the proportion of different transaction types (such as inquiries and payments). A higher proportion of unexecuted tasks indicates greater system pressure, necessitating timely adjustments to resource allocation to ensure normal system operation.

[0114] Extract data about unexecuted tasks from the load information and calculate their proportion to the total number of tasks. This proportion is a dynamic value that changes continuously as new tasks arrive and existing tasks complete. For example, if at a certain point in time the system has a total of 100 tasks and 30 of them are unexecuted, then the proportion of unexecuted tasks is 30%.

[0115] After deciding to increase the thread pool capacity, determine the appropriate capacity increase based on certain rules or algorithms.

[0116] On the contrary, if the ratio of unexecuted tasks is less than the third preset value, it indicates that there are relatively few tasks in the system and the existing thread pool capacity may exceed the actual demand. In order to save system resources and improve resource utilization, the number of threads needs to be reduced.

[0117] For example, if the third preset value is 40%, when the proportion of unexecuted tasks is lower than this value, it means that the current thread pool capacity may be too large and some threads are in idle or low-load state.

[0118] Similar to increasing capacity, when reducing thread pool capacity, it is necessary to determine the reasonable reduction level according to certain rules or system performance indicators.

[0119] For example, it is stipulated that when the task ratio is less than 40%, the thread pool capacity will be reduced by 10%; or based on historical data and trend forecasts of current tasks, a thread pool capacity value that can save resources and ensure the normal operation of the system is calculated.

[0120] Exemplarily, the adjustment request also includes: thread parameters; the thread parameters indicate the target number of threads in the thread pool and the thread type to be adjusted; the configuration center is also used to adjust the number of threads corresponding to the thread type in the thread pool in the terminal based on the target number of threads.

[0121] The configuration center will accurately find the corresponding thread pool in the terminal based on the target number of threads and thread type information in the received adjustment request.

[0122] For example, suppose a Java application is running on an endpoint. Its thread pool contains threads that handle network requests. When the configuration center receives a request to increase the number of these network request threads on the endpoint from 8 to 12, it interacts with the endpoint through a specific communication protocol (such as the remote call interface).

[0123] Then, according to the adjustment instructions, the number of threads of the corresponding type in the terminal's thread pool is increased or decreased. This process may involve operations such as creating new thread objects, allocating system resources (such as memory and CPU time slices), and registering the newly created threads with the thread pool.

[0124] S305 , receiving new thread running parameters sent by the thread monitoring center; if it is determined that the current capacity value of the task queue indicated by the thread running parameters is consistent with the target capacity value, it is determined that the capacity adjustment of the task queue is successful.

[0125] After receiving the new thread execution parameters, you need to determine whether the current capacity of the task queue is consistent with the target capacity. The target capacity is the ideal task queue size, pre-set based on factors such as the overall system load, performance optimization goals, and business needs. Check whether the current number of tasks in the task queue (the current capacity) is the same as the previously set desired number of tasks (the target capacity). If they are, the task queue adjustment has achieved the desired effect.

[0126] Through this step, when the load changes or other situations require adjustment of the task queue capacity, adjustments can be made quickly through new thread operation parameters, and the adjustment results can be obtained in a relatively short time through capacity value comparison.

[0127] S306: Receive graphic information sent by the thread monitoring center, where the graphic information is generated based on new thread running parameters acquired by the thread monitoring center; and send the graphic information to the terminal for display.

[0128] The main purpose of sending graphic information to the terminal for display is to allow users to intuitively understand the running parameters of the thread and its changes. Through the graphical display method, users can grasp the complex thread running information more quickly and accurately. Figure 4 and Figure 5 As shown in the figure, it is easier to understand the data by displaying it in pictures. The corresponding trend charts of parameters such as task execution time, average task execution time, task queuing time, submitted task QPS, executed task QPS, number of slow queued tasks, number of slow executed tasks, thread utilization, number of queued tasks, and number of rejected tasks are more useful for technical personnel to see the thread running speed and the changing trend at different time nodes displayed in a graphical way than with simple numbers.

[0129] This also helps users promptly identify anomalies in thread execution. If a thread's resource usage suddenly increases significantly, this can be highlighted in the graphic (e.g., with a color change or a sudden increase in value), allowing users to quickly detect and take appropriate action.

[0130] The thread pool-based queue adjustment method, electronic device, storage medium and program product provided in the embodiments of the present application need to obtain the thread running parameters of the terminal when determining that the task queue running in the terminal triggers a rejection policy. According to the running parameters, the current load of the thread pool in the terminal can be determined. According to the obtained thread running parameters, a target capacity value can be calculated. According to the determined target capacity value, an adjustment request is sent to the configuration center. The configuration center can adjust the capacity of the task queue in the terminal to the target capacity value according to the received adjustment request, so as to achieve the purpose of dynamically adjusting the capacity of the thread pool according to the load demand, so as to improve the performance and stability of the system.

[0131] The thread pool-based second-hand transaction queue adjustment method provided in an embodiment of the present application includes: when it is determined that the second-hand transaction queue running in the terminal triggers a rejection strategy, obtaining the thread running parameters of the terminal; wherein the thread running parameters represent the running status of the threads of the thread pool in the terminal; the second-hand transaction queue inherits the function of the blocked queue; the second-hand transaction queue includes at least one second-hand transaction task, and the thread is used to execute the second-hand transaction task; according to the thread running parameters, determining the target capacity value of the second-hand transaction queue; sending an adjustment request to the configuration center; wherein the adjustment request represents a request to adjust the capacity of the second-hand transaction queue to the target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the second-hand transaction queue in the terminal to the target capacity value in response to the adjustment request.

[0132] Figure 6 A schematic diagram of the structure of the queue adjustment device based on the thread pool provided in this application is shown as follows: Figure 6 As shown, the thread pool-based queue adjustment device 60 provided in this embodiment includes:

[0133] The first determining module 601 is configured to obtain thread running parameters of the terminal when determining that a task queue running in the terminal triggers a rejection policy; wherein the thread running parameters represent the running status of threads in the thread pool of the terminal; the task queue inherits the function of the blocking queue;

[0134] A second determining module 602 is configured to determine a target capacity value of the task queue according to the thread running parameters;

[0135] The adjustment module 603 is used to send an adjustment request to the configuration center; wherein the adjustment request represents a request to adjust the capacity of the task queue to the target capacity value; the adjustment request is used to request the configuration center to respond to the adjustment request and adjust the capacity of the task queue in the terminal to the target capacity value.

[0136] In one possible implementation, the first determination module 601 is also used to, when receiving an alarm message sent by a thread monitoring center, determine that the task queue triggers a rejection strategy and send a view request to the thread monitoring center; wherein the alarm information indicates that the task queue cannot receive new tasks, or the alarm information indicates that the free capacity of the task queue is less than a preset capacity; the view request is used to request to obtain thread running parameters; the thread monitoring center is used to obtain the thread running parameters of the terminal in response to the view request; and receive the thread running parameters sent by the thread monitoring center.

[0137] In one possible implementation, the first determination module 601 is also used to determine that the task queue triggers a rejection strategy and obtain the thread running parameters of the terminal when it is monitored that the task queue cannot receive new tasks or the free capacity of the task queue is less than the preset capacity.

[0138] In one possible implementation, the second determination module 602 is used to determine to increase the capacity value of the thread pool and determine the target capacity value corresponding to the task execution efficiency if it is determined that the task execution efficiency carried in the load information is less than a first preset value; if it is determined that the task execution efficiency is greater than or equal to the first preset value and the thread idle rate carried in the load information is greater than a second preset value, determine to reduce the capacity value of the thread pool and determine the target capacity value corresponding to the thread idle rate; wherein, the target capacity value also indicates the type of thread to be adjusted.

[0139] In one possible implementation, the second determination module 602 is used to determine the target capacity value corresponding to the task execution efficiency based on the first mapping relationship; wherein the first mapping relationship represents the mapping relationship between the task execution efficiency and the target capacity value; or, display the task execution efficiency and receive the target capacity value input by the user based on the displayed task execution efficiency.

[0140] In one possible implementation, the second determination module 602 is used to determine the target capacity value corresponding to the thread idle rate based on a second mapping relationship; wherein the second mapping relationship represents the mapping relationship between the thread idle rate and the target capacity value; or, display the thread idle rate and receive the target capacity value input by the user based on the displayed thread idle rate.

[0141] In one possible implementation, the second determination module 602 is used to determine whether to increase the capacity value of the thread pool and determine the capacity value corresponding to the task ratio if it is determined that the proportion of unexecuted tasks carried in the load information is greater than or equal to a third preset value; if it is determined that the task ratio is less than the third preset value, determine whether to reduce the capacity value of the thread pool and determine the capacity value corresponding to the task ratio.

[0142] In one possible implementation, the second determination module 602 is used to determine the target capacity value corresponding to the task ratio based on a third mapping relationship; wherein the third mapping relationship represents the mapping relationship between the task ratio and the target capacity value; or, display the task ratio and receive the target capacity value input by the user based on the displayed task ratio.

[0143] In one possible implementation, the adjustment request also includes: a thread parameter; the thread parameter indicates the target number of threads in the thread pool and the thread type to be adjusted; the configuration center is also used to adjust the number of threads corresponding to the thread type in the thread pool in the terminal based on the target number of threads.

[0144] In one possible implementation, the device also includes: a fourth determination module, used to receive new thread operating parameters sent by the thread monitoring center; if it is determined that the current capacity value of the task queue indicated by the thread operating parameters is consistent with the target capacity value, it is determined that the capacity adjustment of the task queue is successful.

[0145] In a possible implementation, the device further includes: a display module for receiving graphic information sent by the thread monitoring center, where the graphic information is generated based on new thread running parameters obtained by the thread monitoring center; and sending the graphic information to the terminal for display.

[0146] The thread pool-based queue adjustment device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and are not described in detail in this embodiment.

[0147] Figure 7 This is a schematic diagram of the structure of the queue adjustment device based on the thread pool provided in this application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, the memory 702 and the communication component 703 are connected via a bus.

[0148] During the specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that the at least one processor 701 performs the above method.

[0149] The specific implementation process of the processor 701 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.

[0150] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.

[0151] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.

[0152] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.

[0153] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0154] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0155] The readable storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0156] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0157] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.

[0158] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0159] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0160] 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 the present invention, or the portion that contributes to the prior art, or a portion 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 for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of the present invention. The aforementioned storage medium includes various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0161] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0162] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.

Claims

1. A queue adjustment method based on thread pool, characterized in that: include: When determining that a task queue running in a terminal triggers a rejection policy, obtaining thread running parameters of the terminal; wherein the thread running parameters represent the running status of threads in a thread pool in the terminal; the task queue inherits the function of a blocking queue; Determining a target capacity value of the task queue according to the thread operation parameters; An adjustment request is sent to a configuration center; wherein the adjustment request represents a request to adjust the capacity of the task queue to a target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the task queue in the terminal to the target capacity value in response to the adjustment request.

2. The method according to claim 1, characterized in that When determining that a task queue running in a terminal triggers a rejection policy, obtaining thread running parameters of the terminal includes: Upon receiving an alarm message sent by a thread monitoring center, determining that the task queue triggers a rejection policy, and sending a viewing request to the thread monitoring center; wherein the alarm message indicates that the task queue cannot receive new tasks, or the alarm message indicates that the free capacity of the task queue is less than a preset capacity; the viewing request is used to request to obtain thread running parameters; the thread monitoring center is used to obtain the thread running parameters of the terminal in response to the viewing request; Receive the thread running parameters sent by the thread monitoring center.

3. The method according to claim 1, characterized in that When determining that a task queue running in a terminal triggers a rejection policy, obtaining thread running parameters of the terminal includes: When it is monitored that the task queue cannot receive new tasks, or the idle capacity of the task queue is less than a preset capacity, it is determined that the task queue triggers a rejection strategy, and the thread running parameters of the terminal are obtained.

4. The method according to claim 1, wherein The thread running parameters include load information of a thread pool in the terminal; and determining a target capacity value of the task queue according to the thread running parameters includes: If it is determined that the task execution efficiency carried in the load information is less than a first preset value, determining to increase the capacity value of the thread pool, and determining a target capacity value corresponding to the task execution efficiency; If it is determined that the task execution efficiency is greater than or equal to a first preset value, and the thread idle rate carried in the load information is greater than a second preset value, determining to reduce the capacity value of the thread pool, and determining a target capacity value corresponding to the thread idle rate; The target capacity value also indicates the type of thread to be adjusted.

5. The method according to claim 4, characterized in that Determining a target capacity value corresponding to the task execution efficiency includes: Determining a target capacity value corresponding to the task execution efficiency according to a first mapping relationship; wherein the first mapping relationship represents a mapping relationship between the task execution efficiency and the target capacity value; Alternatively, the task execution efficiency is displayed, and a target capacity value input by a user based on the displayed task execution efficiency is received.

6. The method according to claim 4, characterized in that Determining a target capacity value corresponding to the thread idle rate includes: Determining a target capacity value corresponding to the thread idle rate according to a second mapping relationship; wherein the second mapping relationship represents a mapping relationship between the thread idle rate and the target capacity value; Alternatively, the thread idle rate is displayed, and a target capacity value input by a user based on the displayed thread idle rate is received.

7. The method according to claim 1, characterized in that The thread running parameters include load information of a thread pool in the terminal; and determining a target capacity value of the task queue according to the thread running parameters includes: If it is determined that the ratio of unexecuted tasks carried in the load information is greater than or equal to a third preset value, determining to increase the capacity value of the thread pool, and determining a capacity value corresponding to the task ratio; If it is determined that the task ratio is less than a third preset value, it is determined to reduce the capacity value of the thread pool, and a capacity value corresponding to the task ratio is determined.

8. The method according to claim 4, characterized in that Determine the capacity value corresponding to the task ratio, including: Determining a target capacity value corresponding to the task ratio according to a third mapping relationship; wherein the third mapping relationship represents a mapping relationship between the task ratio and the target capacity value; Alternatively, the task ratio is displayed, and a target capacity value input by the user based on the displayed task ratio is received.

9. The method according to any one of claims 1 to 8, characterized in that The adjustment request also includes: thread parameters; the thread parameters indicate the target number of threads in the thread pool and the thread type to be adjusted; the configuration center is also used to adjust the number of threads corresponding to the thread type in the thread pool in the terminal based on the target number of threads.

10. The method according to any one of claims 1 to 8, characterized in that The method further comprises: Receive new thread running parameters sent by the thread monitoring center; If it is determined that the current capacity value of the task queue indicated by the thread running parameter is consistent with the target capacity value, it is determined that the capacity adjustment of the task queue is successful.

11. The method according to any one of claims 1 to 8, characterized in that The method further comprises: Receiving graphic information sent by the thread monitoring center, where the graphic information is generated based on new thread running parameters acquired by the thread monitoring center; The graphic information is sent to the terminal for display.

12. A second-hand transaction queue adjustment method based on thread pool, characterized in that: include: When determining that a second-hand transaction queue running in a terminal triggers a rejection policy, obtaining thread operation parameters of the terminal; wherein the thread operation parameters represent the operation status of threads in a thread pool in the terminal; the second-hand transaction queue inherits the function of a congestion queue; the second-hand transaction queue includes at least one second-hand transaction task, and the thread is used to execute the second-hand transaction task; Determining a target capacity value of the second-hand transaction queue according to the thread operation parameters; An adjustment request is sent to a configuration center; wherein the adjustment request represents a request to adjust the capacity of the second-hand transaction queue to a target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the second-hand transaction queue in the terminal to the target capacity value in response to the adjustment request.

13. A queue adjustment device based on thread pool, characterized in that: include: A first determining module is configured to obtain thread running parameters of the terminal when determining that a task queue running in the terminal triggers a rejection policy; wherein the thread running parameters represent the running status of threads in a thread pool in the terminal; and the task queue inherits the function of a blocking queue; A second determining module is used to determine a target capacity value of the task queue according to the thread running parameters; An adjustment module is used to send an adjustment request to a configuration center; wherein the adjustment request represents a request to adjust the capacity of the task queue to a target capacity value; the adjustment request is used to request the configuration center to adjust the capacity of the task queue in the terminal to the target capacity value in response to the adjustment request.

14. A queue adjustment device based on thread pool, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 12 when executed by a processor.

16. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 12 when executed by a processor.