Message backlog processing system and message backlog processing method
Patent Information
- Application Number
- TW113146930
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2024-09-30
- Filing Date
- 2024-12-04
- Publication Date
- 2026-10-01
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Message backlog in data-driven systems leads to delayed task processing, system performance degradation, and excessive resource consumption due to imbalanced consumer and producer capacities, with existing solutions either causing resource waste or negatively impacting user satisfaction.
A message backlog processing system that automatically adjusts processing strategies by collecting data, applying decision weights, and calculating suitable performance values to dynamically manage thread counts, consumer instances, and production speeds based on system performance indicators and scenario importance.
Effectively handles message backlogs by optimizing resource allocation, ensuring timely processing of critical tasks while preventing resource idleness and waste, thus maintaining system performance and user satisfaction.
Smart Images

Figure TWG2TB001913625_001 
Figure TWG2TB001913625_002 
Figure TWG2TB001913625_003
Abstract
Description
[Technical Field]
[0001] This invention relates to a message processing technology, and more particularly to a message backlog processing system and a message backlog processing method. [Previous Technology]
[0002] As the platform's user base and usage increase, message backlog can cause delays or even loss in data-driven task card distribution. When message production exceeds consumption, messages in the queue cannot be processed or consumed in a timely manner, leading to an excessive accumulation of messages. When message backlog is excessive, messages cannot be consumed / processed promptly, resulting in delayed task processing and the consumer having to handle a large number of message tasks, causing system performance degradation, increased latency, and excessive resource consumption. Therefore, to resolve message backlog, the processing capacity of the consumer can be increased or the speed at which producers generate messages can be limited. However, over-configuring consumer resources will lead to unnecessary resource waste, and excessively limiting the producer's production speed will affect user satisfaction during actual use. [Summary of the Invention]
[0003] The present invention provides a message backlog processing system and a message backlog processing method, which can automatically obtain a processing strategy suitable for resolving the current message backlog based on the system's processing data set.
[0004] The message backlog processing system of the present invention includes a storage device and a processor. The storage device is used to store a data detection module, a decision module, and a calculation module. The processor is coupled to the storage device and is used to execute the data detection module, the decision module, and the calculation module. The data detection module collects production logs, consumption logs, message queue data, and processing data sets in the processor. In response to a message backlog exceeding a message backlog threshold, the decision module obtains a processing strategy based on the decision weights in the decision table and the processing data sets. The calculation module calculates a suitable performance value based on the processing strategy and updates the message processing settings based on the suitable performance value. The processing strategy is one of a production speed limiting strategy, a thread count increasing strategy, and a consumer instance count increasing strategy. The suitable performance value is one of a suitable production speed, a suitable number of threads (i.e., execution threads), and a suitable number of consumer instances.
[0005] The message backlog processing method of the present invention includes the following steps: A processor executes a data detection module to collect production logs, consumption logs, message queue data, and a processing data group in the processor, wherein the processing data group includes the message backlog amount; when the message backlog amount exceeds a message backlog threshold, a processor executes a decision module to obtain a processing strategy based on the decision weights in the decision table and the processing data group; a processor executes a calculation module to calculate a suitable performance value based on the processing strategy, and updates the message processing settings based on the suitable performance value; wherein the processing strategy is one of a production speed limiting strategy, a thread count increasing strategy, and a consumer instance count increasing strategy, and the suitable performance value is one of a suitable production speed, a suitable thread count, and a suitable consumer instance count. The message processing settings relate to the message processing system's message production, thread count control, and message processing settings.
[0006] Based on the above, the message backlog processing system and message backlog processing method of the present invention can set a message backlog threshold according to performance data and the importance of the scenario, and adopt a suitable processing strategy according to the message backlog amount and system performance indicators to effectively and automatically handle the message backlog situation.
[0007] In order to make the above features and advantages of the present invention more apparent and understandable, specific embodiments are described below, and detailed descriptions are given in conjunction with the accompanying drawings.
Implementation Method
[0009] Reference will now be made in detail to exemplary embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same element symbols are used in the drawings and description to denote the same or similar parts.
[0010] Figure 1 is a schematic diagram of a message backlog processing system according to an embodiment of the present invention. Referring to Figure 1, the message backlog processing system 100 includes a processor 110 and a storage device 120. The processor 110 is coupled to the storage device 120 and the message processing system. The message backlog processing system 100 may also include a communication interface or a data transmission interface with actual circuit elements, so that the processor 110 can communicate with or transmit data to an external message processing system. In this embodiment, the message backlog processing system 100 and the message processing system may, for example, be implemented on a cloud server or a private server within an enterprise. The message processing system may also provide multiple application programming interfaces (APIs) to allow the message backlog processing system 100 to call data from the message processing system, such as production logs, consumption logs, message queue data, processing data groups, and performance data. In one embodiment, the message processing system may be integrated into the message backlog processing system 100, but this invention should not be limited thereto.
[0011] In this embodiment, the processor 110 of the message backlog processing system 100 may include, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable logic devices (PLDs), other similar processing circuits, or combinations of these devices.
[0012] The storage device 120 may also implement a remote cloud storage service or a local data storage service. The storage device 120 may include memory and / or a database, wherein the memory may be, for example, non-volatile memory (NVM). The storage device 120 may store related programs, modules, systems, or algorithms for implementing the embodiments of the present invention, for the processor 110 to access and execute to implement the related functions and operations described in the embodiments of the present invention. The storage device 120 may cache processing data, decision data, strategy algorithms, and setting information as described in the embodiments of the present invention.
[0013] Figure 2 is a flowchart of a message backlog processing method according to an embodiment of the present invention. Figure 3 is a flowchart of a message backlog processing method according to another embodiment of the present invention. Referring first to Figures 1 and 2, the storage device 120 can store a data detection module, a decision module, and a calculation module. The data detection module, decision module, and calculation module can be implemented, for example, in programming languages such as JSON (JavaScript Object Notation), Extensible Markup Language (XML), or YAML, and the present invention is not limited thereto. The data detection module can be used, for example, to detect production logs, consumption logs, message queue data, and processing data sets of the processor in the message processing system's database, thereby obtaining various data related to message production, message consumption, and message processing. The decision module stores decision tables, multiple strategy conditions, decision weights, parameter settings, weight values, and strategy algorithms. The calculation module dynamically calculates the corresponding data based on the current strategy calculation and strategy algorithm, such as processing settings like the number of threads, the number of instances, and the production speed. Furthermore, the data detection module can access the database in the message processing system, for example, through the HyperText Transfer Protocol (HTTP).
[0014] Referring again to Figures 1 and 2, the message backlog processing system 100 executes the following steps S210-S230. In step S210, the processor 110 executes a data detection module to collect production logs, consumption logs, message queue data, and processing data sets. The processing data set includes the message backlog amount. In this embodiment, the processor 110 executes the data detection module to perform a detection operation. During the detection operation, the data detection module uses a corresponding method to obtain the message backlog amount according to the type of the message queue. The method of obtaining the message backlog amount may be, for example, an application interface or other interface, and should not be limited to this. In step S220, in response to the message backlog amount being greater than the message backlog threshold, the processor 110 executes a decision module to obtain a processing strategy based on the decision weights in the decision table and the processing data set. The processing data set includes the message backlog amount, the message backlog threshold, system performance indicators, and performance indicator thresholds. The decision table includes settings for adopting different processing strategies based on the current message backlog and system performance indicators.
[0015] In step S230, the computing module calculates a suitable performance value based on the processing strategy and updates the message processing settings according to the suitable performance value. The processing strategy is one of the following: limiting the production speed strategy, increasing the number of threads strategy, and increasing the number of consumer instances strategy. The suitable performance value is one of the following: suitable production speed, suitable number of threads, and suitable number of consumer instances. In this embodiment, the computing module calculates the suitable performance value according to the processing strategy provided by the decision module in step S220 and the computing settings in the decision table. Then, the processor 110 updates the message processing settings of the message processing system for processing messages to the suitable performance value.
[0016] Referring next to Figures 1 and 3, the message backlog processing system 100 executes the following steps S210-S230. In step S310, the data detection module collects production logs, consumption logs, message queue data, and processing data groups to obtain data and processing settings related to message processing. In step S320, the calculation module calculates the current system performance indicators, production speed, and processing speed based on the data collected by the data detection module (e.g., message backlog, current number of threads, total number of messages generated, total number of messages consumed, processor utilization, memory utilization, disk utilization, bandwidth utilization, etc.).
[0017] In step S330, the decision module sets different message backlog thresholds, danger thresholds, and system performance alarm indicators for each of the multiple scenarios. Then, the calculation module sets different message backlog thresholds, danger thresholds, and performance indicator thresholds for each of the multiple scenarios. In this embodiment, the storage device 120 stores weight values for multiple scenarios. Thus, the calculation module calculates the performance indicator values for each scenario based on the weight values, processor utilization, memory utilization, disk utilization, bandwidth utilization in the processed data group, and the corresponding weight values.
[0018] For example, scenarios can be divided into important scenarios, less important scenarios, and general scenarios. Important scenarios could be task card issuance or driving core processes; less important scenarios could be message notifications and reminders; and general scenarios could be the recording of operational system logs. With this setup, system designers or users can set the weight values of scenarios according to their importance. Because important scenarios have high requirements for immediacy, their message backlog thresholds, danger thresholds, and system performance alarm indicators are set lower. Less important scenarios have slightly lower immediacy requirements than important scenarios and can accept a certain degree of delay; therefore, the message backlog alarm thresholds, danger thresholds, and system performance alarm indicators for less important scenarios are set higher than those for important scenarios. When data (i.e., messages) in general scenarios is delayed or even lost, it will not affect the overall process; therefore, the message backlog alarm thresholds, danger thresholds, and system performance alarm indicators for general scenarios are usually set at higher levels.
[0019] In step S340, when the message backlog exceeds the message backlog threshold for the current scenario, the processor 110 selects a corresponding strategy based on the decision table settings, and then executes the corresponding steps S350-S370. In step S350, the corresponding strategy is a production speed limiting strategy, therefore the processor 110 selects the production speed limiting strategy to reduce the message backlog. In step S360, the corresponding strategy is a thread count increasing strategy, therefore the processor 110 selects the thread count increasing strategy to resolve the message backlog. In step S370, the corresponding strategy is a consumer instance increasing strategy, therefore the processor 110 selects the consumer instance increasing strategy to resolve the message backlog.
[0020] In step S380, after the processor 110 adopts the corresponding processing strategy, the computing module dynamically calculates the appropriate number of threads, the number of consumer instances, or the production speed for each scenario based on the decision table. Specifically, when the processing strategy is to increase the number of threads, the computing module can calculate the appropriate number of threads based on the number of processor cores, the current number of threads, the current number of instances, the message backlog threshold, the message backlog amount, the performance index value, and the performance index threshold in the processing data group.
[0021] In this embodiment, the computing module calculates the appropriate number of threads according to the following formulas (1) and (2): ……(1)……(2)
[0022] is the maximum performance index threshold of the system, is the current system performance index, is the current number of threads, u is the number of CPU cores (i.e., the number of processor cores), m is the number of consumers (assuming that each consumer instance is configured the same), message backlog alarm threshold, is the current message backlog amount, is the suitable number of threads, k is a compensation parameter between 0 and 1, and ceil is the round-up function to ensure that the suitable number of threads is an integer. In this way, when, and there are messages to be processed in the message queue (>), the processor 110 can improve its consumption capacity by increasing the number of threads. Formula (2) is to take the maximum number of threads as the suitable number of threads when the suitable number of threads (i.e., the recommended total number of threads) is higher than the maximum number of threads, otherwise the number of threads in formula (1) is taken as the suitable number of threads.
[0023] In one embodiment, multiple performance indicators of the system include CPU utilization, memory utilization, disk utilization, and bandwidth utilization, which are the main factors affecting system performance. In one embodiment, the computing module can obtain the performance indicators of the message processing system in real time through a shell script, and then calculate the performance indicator value of the message processing system using the following formula (3): a = × + × + × + ×……(3)
[0024] represents the average CPU utilization per unit time, the average memory utilization per unit time, the average disk utilization per unit time, and the bandwidth utilization per unit time, with corresponding weight values of , , , , respectively. All weight values are between 0 and 1, i.e., 0 ≤ ≤ 1, +++ = 1. 'a' is the weighted performance index value, 0 ≤ a ≤ 1. A larger 'a' value indicates worse system performance.
[0025] In this embodiment, the calculation module calculates the number of suitable consumer instances based on the current number of instances in the processing data group, the average processing speed, the total production speed, and the speed multiple of the new instances to the current instances. First, the number of suitable instances must satisfy that the total consumption speed is greater than or equal to the total production speed, so the following formula (4) can be derived: (m * e) + (* k * e) >= d……(4)
[0026] m is the current number of consumers, e is the average consumption rate of a single consumer, d is the total production rate of producers, k is the multiple of the average consumption rate of the added instance to be expanded compared to the current existing instances, and n is the number of consumers to be added (i.e., the number of consumer instances). Then, the following formula (5) can be derived: …(5)
[0027] represents the number of instances that need to be added, where i is the compensation parameter, ensuring that it is the current total consumption rate. For example, if the maximum total number of instances that can be accommodated in the current environment is , then the maximum number of instances to be added is . Therefore, considering the maximum total number of instances that can be accommodated, the total number of instances that can be added (i.e., the suitable number of instances) is , = min().
[0028] In one embodiment, the calculation module calculates the suitable production speed based on the relevant scenario list, scenario weight value, scenario message backlog, maximum weight value, scenario speed reduction ratio, and minimum speed value in the message queue. The scenario message backlog is the total message backlog of all scenarios. The scenario speed reduction ratio is related to the ratio between the current backlog and the scenario message backlog, as well as the difference between the scenario weight value and the threshold weight. Specifically, this system sets different scenario weight values for scenarios of different importance. For example, firstly, it obtains the scenario list of all scenarios involving message queues in the current system, divides the scenario list according to importance level, involving n levels, and assigns weight values to the n levels. The scenario weight values are set to ,,,,,., and the corresponding message backlogs are ,,,,,,,,>>>...>, and...=1.
[0029] Next, the limiting factor is calculated based on the current backlog and the weight of the scenario using the following formula (6): f_i = ( / Σm_c)*(max_weight-) / (max_weight-w_threshold)……(6)
[0030] w_threshold is the threshold value, which is the scene weight value. Σm_c is the sum of message backlogs for all scenes. max_weight is the threshold weight, which is the backlog for the current scene. f_i is a value between 0 and 1, indicating the proportion by which the producer of scene i should reduce its message generation rate. For each scene i (i ranges from 1 to n), the threshold weight is related to the largest weight value among all production scenes in the current system. When calculating the threshold weight max_weight, it is necessary to first obtain a list of all scenes involving message queues in the current system and divide the scene list according to importance level. For example, if the weight values in the scene list involve n levels, then the weight values of the n levels are divided into m_w_1, m_w_2, m_w_3, m_w_4, ..., m_w_n, and the largest weight value is the threshold weight max_weight.
[0031] Next, the suitable production speed for the current scenario is obtained according to the following formula (7): rate_new_i = max(min_rate, y_i * rate_original_i * (1 - f_i))……(7)
[0032] Assume that rate_original_i is the original message generation rate, rate_new_i is the new suitable production rate, min_rate is the minimum rate threshold, and y_i is the compensation parameter for the current scenario, which can be flexibly adjusted according to the system environment, 0 < y_i <= 1. In this way, the calculation module can calculate the suitable production rate for the current scenario, thereby reducing message backlog, while maintaining message flow for various business scenarios through the minimum rate threshold.
[0033] Figure 4 is a schematic diagram of a producer, message queue, consumer, and database according to an embodiment of the present invention. Figure 5 is a flowchart of a message backlog processing method according to another embodiment of the present invention. Referring first to Figure 4, when a user performs user interaction 401 through the system interaction interface, the user inputs the command to the message producer 403 in the message processing system. The producer 403 then transmits the message to the message consumer 405 (i.e., message processing end) through the message queue 404, and then processes the message through the consumer 405 and its thread. In this way, the message processing system processes the message into corresponding operation logic or program code and stores it in the database 407. The message backlog processing system 100 performs system detection 402 through the data detection module to obtain production logs, consumption logs, message queue types (i.e., message queue data), and processing data groups. The processing data group is the data of the message processing system when processing messages. Referring again to Figures 1, 3, 4, and 5, the message backlog processing system 100 can perform the following steps S501 to S515.
[0034] In step S501, during the process of the data detection module detecting data in the message processing system, if the data detection module detects a message backlog, then steps S502-S504 are executed. In step S503, the decision module determines whether the message backlog amount is greater than the message backlog threshold. When the message backlog amount is greater than the message backlog threshold, the decision module then determines whether the message backlog amount is greater than the backlog danger threshold. In response to the message backlog amount being less than the backlog danger threshold, the decision module then determines whether the system performance index is lower than the performance index threshold. In response to the system performance index being lower than the performance index threshold, the decision module adopts the strategy of increasing the number of threads as the current processing strategy according to the decision table, that is, executes step S509.
[0035] In step S509, the decision-making module adopts a strategy of increasing the number of threads, and then determines the system indicator threshold, current system performance indicator, current number of threads, number of processor cores, number of instances, message backlog threshold, and message backlog amount through data collection by the data detection module and calculation by the calculation module. In step S510, the calculation module calculates the suggested number of threads (i.e., the suitable number of threads) according to the above formulas (1) and (2). Furthermore, the calculation module inputs the suitable number of threads to the message processing system so that the message processing system adjusts the number of threads to the suitable number of threads.
[0036] In step S511, the data detection module collects production logs and consumption logs from the message processing system in real time to determine whether the current message processing status of the message processing system satisfies the condition that the production speed is less than the consumption speed. If the production speed is greater than the processing speed, and if the processing strategy is to increase the number of threads, the decision module updates the processing strategy to increase the number of consumer instances. That is, in step S511, if the production speed is still greater than the consumption speed, then step S512 is executed.
[0037] In step S504, the decision module determines whether the message backlog is greater than the message backlog threshold and whether the performance index is greater than the performance index threshold. In response to the system performance index being higher than the performance index threshold, the decision module adopts the strategy of increasing the number of consumer instances as the processing strategy according to the decision table, that is, executes step S512.
[0038] In step S512, the decision module adopts an increase in the number of instances strategy, and then determines the number of consumer instances, the average consumption speed of a single consumer, and the total production speed of the producer through data collection by the data detection module and calculation by the calculation module. Next, step S513 is executed. In step S513, the calculation module calculates the appropriate number of consumer instances based on the processed data group, and then updates the number of consumer instances in the message processing settings of the message processing system. In step S514, the data detection module collects the production logs and consumption logs of the message processing system in real time, and then determines whether the current message processing status of the message processing system satisfies the condition that the production speed is less than the consumption speed. In response to the production speed being greater than the processing speed, and in response to the processing strategy being an increase in the number of consumer instances strategy, the decision module updates the processing strategy to a production speed restriction strategy. That is, in step S514, if the message production speed is still greater than the consumption speed after the processing settings of the message processing system are updated to an appropriate number of consumer instances, then step S505 is executed.
[0039] In step S502, in response to the message backlog exceeding the backlog danger threshold, the decision module determines whether the message backlog exceeds the backlog danger threshold (i.e., the backlog danger threshold) by K times, where K is a positive integer. Then, in response to the message backlog exceeding the backlog danger threshold by K times, the decision module adopts a production speed limitation strategy as the processing strategy, i.e., executes step S505. In step S505, the decision module adopts a production speed limitation strategy, and then determines the backlog for each scenario through data collection by the data detection module and calculation by the calculation module, and calculates the limiting factor. In step S506, the calculation module calculates the message production speed for each scenario (i.e., the suitable production speed for each scenario) based on the above formulas (4) and (5) and according to the processing data set. Then, the message backlog processing system 100 inputs the suitable production speed for each scenario into the message processing system, thereby updating the production speed in the message processing settings of the message processing system.
[0040] In step S507, the data detection module collects the production logs and consumption logs of the message processing system in real time, and then determines whether the current message processing status of the message processing system meets the condition that the production speed is less than the consumption speed. In other words, the data detection module detects the production logs and consumption logs after the message processing settings are updated to determine whether the production speed is less than the processing speed.
[0041] The processing strategy further includes a fallback strategy, wherein in response to the production speed exceeding the processing speed, and in response to the processing strategy being a production speed limiting strategy, the decision module executes step S508 to update the processing strategy to a fallback strategy. In step S508, the decision module adopts the fallback strategy, and the calculation module proportionally reduces the production speed according to the processed data group until the production speed is less than the processing speed. Furthermore, in step S508, when the production speed is less than the processing speed, step S515 is then executed. During the judgment process in steps S506, S510, and S513, when the production speed of the message processing system is less than the consumption speed, step S515 is then executed. In step S515, the process ends.
[0042] In another embodiment, in response to a message backlog exceeding a danger value but not exceeding K times the backlog danger threshold, the decision module sequentially applies a strategy of increasing the number of threads and then a strategy of increasing the number of consumer instances until the message backlog falls below the message backlog threshold. In other words, when the message backlog in the message processing system exceeds a danger value but does not exceed K times the backlog danger threshold, the decision module first adopts the strategy of increasing the number of threads. If, after increasing the number of threads, the message backlog still cannot fall below the danger value, the decision module then adopts the strategy of increasing the number of instances.
[0043] In summary, the message backlog processing system and method of the present invention can effectively reduce message backlog by setting various processing strategies according to different scenarios, different message backlog volumes, and system performance indicators. This ensures that important scenarios / instructions can be processed smoothly, effectively preventing the loss of important messages due to message backlog or production speed limitations. In other words, the message backlog processing system of the present invention automatically increases or decreases consumption resources (i.e., the number of threads, the number of consumption instances, or the production speed) based on the real-time load of the message processing system / platform, the message backlog volume, the production speed, and the consumption speed. This ensures that corresponding processing capacity is provided during peak task card issuance periods (i.e., peak message generation periods), while avoiding resource idleness during off-peak message generation periods, thereby solving the message backlog problem and achieving efficient resource utilization.
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention. [Simplified Explanation of the Diagram]
[0008] Figure 1 is a schematic diagram of a message backlog processing system according to an embodiment of the present invention. Figure 2 is a flowchart of a message backlog processing method according to an embodiment of the present invention. Figure 3 is a flowchart of a message backlog processing method according to another embodiment of the present invention. Figure 4 is a schematic diagram of a producer, message queue, consumer, and database according to an embodiment of the present invention. Figure 5 is a flowchart of a message backlog processing method according to another embodiment of the present invention.
Claims
1. A message backlog processing system, comprising: Storage device for storing data detection module, decision module and computing module; The system includes a processor coupled to the storage device and configured to execute the data detection module, the decision module, and the computing module. The data detection module collects production logs, consumption logs, message queue data, and processing data sets, where the processing data sets include message backlog. In response to a message backlog exceeding a message backlog threshold, the decision module obtains a processing strategy based on decision weights in a decision table and the processing data sets. The computing module calculates a suitable performance value based on the processing strategy and updates message processing settings based on the suitable performance value. The processing strategy is one of limiting production speed, increasing thread count, and increasing consumer instance count. The suitable performance value is one of suitable production speed, suitable thread count, and suitable consumer instance count. The data detection module detects the updated production logs and consumption logs to determine if the production speed is less than the processing speed. In response to a production speed greater than the processing speed and the processing strategy being the increasing thread count strategy, the decision module updates the processing strategy to the increasing consumer instance count strategy. The computing module calculates the appropriate number of consumer instances based on the processed data set, and then updates the number of consumer instances in the message processing settings.
2. The message backlog processing system as described in claim 1, wherein the storage device stores weight values for multiple scenarios, wherein the computing module calculates performance index values based on the weight values, processor utilization, memory utilization, disk utilization, bandwidth utilization, and corresponding weight values in the processing data group, wherein the computing module sets different message backlog thresholds, danger thresholds, and performance index thresholds for the multiple scenarios respectively.
3. The message backlog processing system as described in Request 1, wherein the computing module calculates the appropriate number of threads based on the number of processor cores, the current number of threads, the current number of instances, the message backlog threshold, the message backlog amount, the performance index value, and the performance index threshold in the processing data group.
4. The message backlog processing system as described in claim 1, wherein when the message backlog amount is greater than the message backlog threshold, the decision module determines whether the message backlog amount is greater than a backlog danger threshold; in response to the message backlog amount being less than the backlog danger threshold, the decision module determines whether the system performance index is lower than a performance index threshold; in response to the system performance index being lower than the performance index threshold, the decision module uses the increase thread count strategy as the processing strategy according to the decision table; in response to the system performance index being higher than the performance index threshold, the decision module uses the increase consumer instance count strategy as the processing strategy according to the decision table; in response to the message backlog amount being greater than the backlog danger threshold, the decision module determines whether the message backlog amount is greater than K times the backlog danger threshold, where K is a positive integer; in response to the message backlog amount not being greater than K times the backlog danger threshold, the decision module sequentially uses the increase thread count strategy and the increase consumer instance count strategy as the processing strategies until the message backlog amount is less than the message backlog threshold. In response to the message backlog exceeding K times the backlog danger threshold, the decision module adopts the production speed restriction strategy as the processing strategy.
5. The message backlog processing system as described in claim 1, wherein the processing strategy further includes a fallback strategy, wherein in response to the production speed being greater than the processing speed, and in response to the processing strategy being the production speed limiting strategy, the decision module updates the processing strategy to the fallback strategy, wherein the computing module reduces the production speed proportionally according to the processed data set until the production speed is less than the processing speed.
6. The message backlog processing system as described in Request 1, wherein the computing module calculates the number of suitable consumer instances based on the current number of instances in the processing data group, the average processing speed, the total production speed, and the speed multiple of adding new instances to the current instances.
7. The message backlog processing system as described in claim 1, wherein in response to the production rate being greater than the processing rate, and in response to the processing strategy being the strategy of increasing the number of consumer instances, the decision module updates the processing strategy to the strategy of limiting the production rate, wherein the calculation module calculates the suitable production rate based on the processing data set, and then updates the production rate in the message processing settings.
8. The message backlog processing system as described in claim 7, wherein the calculation module calculates the suitable production speed based on the relevant scenario list, scenario weight value, scenario message backlog amount, maximum weight value, scenario speed reduction ratio, and minimum speed value in the message pair queue, wherein the scenario message backlog amount is the total message backlog amount of all scenarios, wherein the scenario speed reduction ratio is related to the ratio between the current backlog amount and the scenario message backlog amount and the difference between the scenario weight value and the threshold weight.
9. A message backlog processing method, comprising: The processor executes a data detection module to collect production logs, consumption logs, message queue data, and processing data groups, wherein the processing data groups include message backlog. When the message backlog exceeds a message backlog threshold, the processor executes a decision module to obtain a processing strategy based on decision weights in a decision table and the processing data groups. The processor executes a calculation module to calculate a suitable performance value based on the processing strategy and updates the message processing settings based on the suitable performance value. After updating the message processing settings, the data detection module detects the updated production logs and consumption logs to determine whether the production speed is less than the processing speed. The processing strategy is one of a production speed limiting strategy, a thread count increasing strategy, and a consumer instance increasing strategy. The suitable performance value is one of a suitable production speed, a suitable thread count, and a suitable consumer instance count. The steps in response to the production speed exceeding the processing speed and in response to the thread count increasing strategy include: The decision module updates the processing strategy to the strategy of increasing the number of consumer instances; and the calculation module calculates the appropriate number of consumer instances based on the processing data set, thereby updating the number of consumer instances in the message processing settings.
10. The method as described in claim 9, wherein the storage device stores weight values for multiple scenarios, and the method further includes the following steps: calculating performance index values by the computing module based on the weight values, processor utilization, memory utilization, disk utilization, bandwidth utilization, and corresponding weight values in the processing data group; and setting different message backlog thresholds, danger thresholds, and performance index thresholds by the computing module for each of the multiple scenarios.
11. The method as described in request item 9, further comprising the following steps: calculating the appropriate number of threads by means of the computing module based on the number of processor cores, the current number of threads, the current number of instances, the message backlog threshold, the message backlog amount, the performance index value, and the performance index threshold in the processing data group.
12. The method as described in request item 9, comprising the following steps: When the message backlog is greater than the message backlog threshold, the decision module determines whether the message backlog is greater than a backlog danger threshold; In response to the message backlog being less than the backlog danger threshold, the decision module determines whether a system performance indicator is lower than a performance indicator threshold; In response to the system performance indicator being lower than the performance indicator threshold, the decision module uses the strategy of increasing the number of threads as the processing strategy according to the decision table; In response to the system performance indicator being higher than the performance indicator threshold, the decision module uses the strategy of increasing the number of consumer instances as the processing strategy according to the decision table; In response to the message backlog being less than the backlog danger threshold, the decision module determines whether the message backlog is greater than K times the backlog danger threshold, where K is a positive integer; In response to the message backlog not being greater than K times the backlog danger threshold, the decision module sequentially adopts the strategy of increasing the number of threads and the strategy of increasing the number of consumer instances as the processing strategy until the message backlog is less than the message backlog threshold; and in response to the message backlog being greater than K times the backlog danger threshold, the decision module adopts the strategy of limiting production speed as the processing strategy.
13. The method of claim 9, wherein the processing strategy further includes a fallback strategy, the steps of responding to the production rate being greater than the processing rate, and responding to the processing strategy being the production rate limiting strategy, comprising: The decision module updates the processing strategy to the fallback strategy. And the production speed is reduced proportionally by the computing module according to the processed data set until the production speed is less than the processing speed.
14. The method as described in claim 9, further comprising the following steps: calculating the number of suitable consumer instances using the calculation module based on the current number of instances in the processing data group, the average processing speed, the total production speed, and the speed multiple of adding new instances to the current instances.
15. The method of claim 9, wherein the steps of responding to the production rate being greater than the processing rate, and responding to the processing strategy being the strategy of increasing the number of consumer instances, include: The decision module updates the processing strategy to the production speed restriction strategy. The computing module calculates the appropriate production speed based on the processed data set, and then updates the production speed in the message processing settings.
16. The method of claim 15, wherein the step of calculating the suitable production speed based on the processing data set includes: The calculation module calculates the suitable production speed based on the relevant scenario list, scenario weight value, scenario message backlog, maximum weight value, scenario speed reduction ratio, and minimum speed value in the message pair column. The scenario message backlog is the total message backlog of all scenarios. The scenario speed reduction ratio is related to the ratio between the current backlog and the scenario message backlog, as well as the difference between the scenario weight value and the threshold weight.
Citation Information
Patent Citations
Dynamic rebalance scheduling method of message queue
CN116560881A
Method and device for calling message consumption priority based on message middleware
CN116909781A
Consumer cluster management method and device, storage medium and electronic equipment
CN117992254A
Method and system for monitoring and processing message backlog of message queue
CN118503044A
