Message queue bandwidth control method and device, electronic equipment and storage medium

By acquiring the business scenarios of message producers and consumers, determining the target bandwidth based on the volume of a single transmission, and adjusting it when the current bandwidth is insufficient, the problem of unequal network overhead between producers and consumers is solved, the accuracy of bandwidth prediction is improved, and the needs of message consumers are met.

CN122093264APending Publication Date: 2026-05-26INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610198500.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-11
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The lack of effective bandwidth assessment methods in existing technologies leads to a mismatch between network overhead for producers and consumers, low bandwidth prediction accuracy, and an inability to meet the needs of message consumers.

Method used

By acquiring the business and consumption scenarios of message producers and consumers, the target bandwidth is determined based on the amount of a single transmission, and adjustments are made when the current bandwidth is insufficient to ensure that the bandwidth meets the demand.

Benefits of technology

This achieves equivalence of network overhead for producers and consumers, improves the accuracy of bandwidth prediction, and ensures that bandwidth meets the needs of message consumers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122093264A_ABST
    Figure CN122093264A_ABST
Patent Text Reader

Abstract

This application relates to artificial intelligence technology, and more particularly to a message queue bandwidth control method, apparatus, electronic device, and storage medium. The method involves acquiring the business scenario of the message producer and the consumption scenario of the message consumer for the message queue to be evaluated; determining the target bandwidth based on the business scenario, consumption scenario, and single message transmission volume; determining whether the current bandwidth is greater than the target bandwidth; and adjusting either the target bandwidth or the current bandwidth if the determination result is negative. This application embodiment achieves equivalence of network overhead for producers and consumers, improves the accuracy of bandwidth prediction, and ensures that bandwidth meets the needs of message consumers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to artificial intelligence technology, and more particularly to a message queue bandwidth control method, apparatus, electronic device, and storage medium. Background Technology

[0002] Leveraging the high throughput and persistent storage capabilities of a distributed message queue system, real-time data synchronization across systems is achieved, reducing inter-system dependencies. Since data consumption into the message queue requires timeliness down to the minute level, and message queue data cannot be retained indefinitely, the network bandwidth requirements between downstream systems and the message queue need to be assessed to meet these timeliness requirements.

[0003] In the existing technology, there is no effective bandwidth assessment method, the network overhead of producers and consumers cannot be equated, the accuracy of bandwidth prediction cannot be guaranteed, and the bandwidth cannot be guaranteed to meet the needs of message consumers. Summary of the Invention

[0004] This application provides a message queue bandwidth control method, apparatus, electronic device, and storage medium to achieve equivalence of network overhead between producers and consumers, improve the accuracy of bandwidth prediction, and ensure that bandwidth meets the needs of message consumers.

[0005] In a first aspect, embodiments of this application provide a message queue bandwidth control method, which includes: Obtain the business scenarios of message producers and the consumption scenarios of message consumers for the message queue to be evaluated; Determine the target bandwidth based on the business scenario, consumption scenario, and single transmission volume; Determine if the current bandwidth is greater than the target bandwidth, and if the result is negative, adjust either the target bandwidth or the current bandwidth.

[0006] Secondly, embodiments of this application also provide a message queue bandwidth control device, which includes: The scenario information acquisition module is used to acquire the business scenario of the message producer and the consumption scenario of the message consumer of the message queue to be evaluated. The target bandwidth determination module is used to determine the target bandwidth based on the business scenario, consumption scenario, and single transmission volume; The bandwidth adjustment module is used to determine whether the current bandwidth is greater than the target bandwidth, and if the result is negative, adjust the target bandwidth or the current bandwidth.

[0007] Thirdly, embodiments of this application also provide an electronic device, which includes: One or more processors; Storage device for storing one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement any of the message queue bandwidth control methods provided in the embodiments of this application.

[0008] Fourthly, embodiments of this application also provide a storage medium including computer-executable instructions, which, when executed by a computer processor, are used to perform any of the message queue bandwidth control methods provided in embodiments of this application.

[0009] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements any of the message queue bandwidth control methods provided in embodiments of this application.

[0010] This application obtains the business scenario of the message producer and the consumption scenario of the message consumer in the message queue to be evaluated; based on the business scenario, consumption scenario, and single-transmission volume, it determines the target bandwidth. By considering the business scenario and consumption scenario, it can achieve equivalence of network overhead between the producer and consumer; by considering the single-transmission volume, it improves the accuracy of the predicted target bandwidth; it determines whether the current bandwidth is greater than the target bandwidth, and if the result is no, it adjusts the target bandwidth or the current bandwidth. By adjusting the target bandwidth or the current bandwidth, it considers both the target bandwidth and the current bandwidth to ensure that the bandwidth meets the needs of the message consumer. Therefore, the technical solution of this application solves the problems of the lack of an effective bandwidth evaluation method, the inability to equivalence the network overhead between the producer and consumer, the inability to guarantee the accuracy of bandwidth prediction, and the inability to guarantee that the bandwidth meets the needs of the message consumer. It achieves the effects of equivalence of network overhead between the producer and consumer, improving the accuracy of bandwidth prediction, and ensuring that the bandwidth meets the needs of the message consumer. Attached Figure Description

[0011] Figure 1 This is a flowchart of a message queue bandwidth control method according to Embodiment 1 of this application; Figure 2 This is a flowchart of a message queue bandwidth control method according to Embodiment 2 of this application; Figure 3 This is a flowchart of a message queue bandwidth control method according to Embodiment 3 of this application; Figure 4 This is a schematic diagram of the structure of a message queue bandwidth control device according to Embodiment 4 of this application; Figure 5 This is a schematic diagram of the structure of an electronic device according to Embodiment 5 of this application. Detailed Implementation

[0012] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0013] It should be noted that the terms "first" and "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] Example 1 Figure 1 This is a flowchart of a message queue bandwidth control method provided in Embodiment 1 of this application. This embodiment is applicable to situations where the bandwidth of a message queue needs to be controlled. The method can be executed by a message queue bandwidth control device, which can be implemented in software and / or hardware and specifically configured in the message queue system.

[0015] See Figure 1 The message queue bandwidth control method shown includes the following steps: S110. Obtain the business scenarios of message producers and consumption scenarios of message consumers for the message queue to be evaluated.

[0016] The message queue to be evaluated can be one whose bandwidth needs to be assessed. For example, the message queue to be evaluated can be a distributed message queue. A distributed message queue system, based on a publish-subscribe model, supports high throughput and persistent storage, and achieves horizontal scaling and fault tolerance through partitioning and replication, used for real-time data stream processing. The message producer can be the producer of data in the message queue, writing messages generated by the message producer into the message queue. The business scenario can be the business scenario in which information is generated by the message producer, used to determine the periodicity of information generation. For example, the periodicity can include peaks and troughs in message generation. The message consumer can be the consumer of data in the message queue, consuming information from the message queue. The consumption scenario can be the consumption scenario in which the message consumer reads information, used to determine the timeliness requirements for information consumption. For example, the timeliness requirements can include acceptable message latency. The business scenario of the message producer and the consumption scenario of the message consumer can be obtained by acquiring historical information and relevant configuration information of the message producer and message consumer.

[0017] S120. Determine the target bandwidth based on the business scenario, consumption scenario, and single transmission volume.

[0018] The target bandwidth can be defined as the network bandwidth required to ensure data generation is not lost and to meet the timeliness of data consumption in the business scenario. It is used to determine whether the current bandwidth meets the requirements of both the business and consumption scenarios. The single transmission volume can be defined as the amount of data transmitted in each transmission, used to determine the target bandwidth. Because data consumption into the lake has minute-level timeliness requirements, and message queue data cannot be retained indefinitely, it is necessary to assess the network bandwidth requirements between the downstream system and the message queue system to meet the timeliness requirements for consumption.

[0019] Assessing bandwidth presents several challenges: Firstly, the writing of data to the message queue by message producers exhibits peaks and troughs, and downstream message consumers also have performance limitations. When there is a large backlog of data in the message queue, consumption lag occurs, making it impossible to equate the network overhead for message producers and consumers. Secondly, the significant differences in message data size make it difficult to accurately determine the network bandwidth required for data consumption. Assessing based on peak times leads to resource waste; assessing based on trough times results in data not being consumed in a timely manner during non-peak periods, leading to data loss if the retention period is exceeded. Assessing based on average values ​​is unreliable because peaks and troughs are not sinusoidally distributed and exhibit irregularities, making average values ​​insufficient for accurately assessing bandwidth requirements.

[0020] Based on the above issues, the message fluctuation cycle where the peaks and troughs of message generation are located is determined according to the business scenario, the time limit requirement for message consumption is determined according to the consumption scenario, the network overhead of message producers and message consumers is made equivalent, and the information volume of a message is determined according to the single transmission volume, thereby accurately determining the information transmission bandwidth of message queues and message consumers to meet the network bandwidth required for data consumption.

[0021] Specifically, the message fluctuation cycle can be divided into time periods based on consumption time limits to obtain various statistical periods. The number of messages in each statistical period is then counted. The statistical quantity is determined based on the data volume fluctuation range within the message fluctuation cycle. Based on the statistical quantity, the number of messages in each statistical period, and the transmission volume per message, the bandwidth required by the message consumer within the consumption time limit is determined. For example, if the statistical quantity is 10, then the average, median, or mode of the 10 largest data points from the number of messages in each statistical period is taken as the number of data messages required to be transmitted within the consumption time limit. This represents the messages produced by the message producer within the time limit, and also the messages consumed by the message consumer within the consumption time limit. This achieves network overhead equivalence between message producers and message consumers, and allows the target bandwidth to be determined based on the transmission volume per message and the number of data messages.

[0022] S130. Determine whether the current bandwidth is greater than the target bandwidth, and if the determination result is negative, adjust the target bandwidth or the current bandwidth.

[0023] The process involves determining whether the current bandwidth exceeds the target bandwidth. If the result is negative, it indicates that the current bandwidth does not meet the message consumer's consumption needs. In this case, the current bandwidth, or its related parameters, needs to be adjusted to ensure it meets the target bandwidth requirement. This ensures that the current bandwidth exceeds the target bandwidth, preventing information loss in the message queue and satisfying the message consumer's consumption timeliness. For example, the current bandwidth can be expanded, or the amount of information written by the message consumer or the message consumer's consumption time limit can be adjusted to reduce the target bandwidth, thus ensuring that the current bandwidth exceeds the target bandwidth.

[0024] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant regions.

[0025] Leveraging the high throughput and persistent storage capabilities of a distributed message queue system, real-time data synchronization across systems can be achieved, reducing inter-system dependencies. Data replication technology writes data change records from the upstream source system into the distributed message queue and retains them for a certain period. The downstream real-time data import engine subscribes to and consumes data from the message queue, but consumption must be completed within the data retention period; otherwise, data loss will occur. The consumption capacity of the real-time data import engine is limited not only by the engine's own technical requirements but also by the network resources between the distributed message queue system and the real-time data import engine system. Therefore, it is necessary to assess the network bandwidth requirements between the downstream system and the message queue system.

[0026] The technical solution of this embodiment obtains the business scenario of the message producer and the consumption scenario of the message consumer in the message queue to be evaluated; determines the target bandwidth based on the business scenario, consumption scenario, and single-transmission volume; by considering the business scenario and consumption scenario, the network overhead of the producer and consumer can be made equivalent; by considering the single-transmission volume, the accuracy of the predicted target bandwidth is improved; it determines whether the current bandwidth is greater than the target bandwidth, and if the result is negative, adjusts the target bandwidth or the current bandwidth; by adjusting the target bandwidth or the current bandwidth, considering both the target bandwidth and the current bandwidth, the bandwidth is ensured to meet the needs of the message consumer. Therefore, the technical solution of this application solves the problems of the lack of an effective bandwidth evaluation method, the inability to make the network overhead of the producer and consumer equivalent, the inability to guarantee the accuracy of bandwidth prediction, and the inability to guarantee that the bandwidth meets the needs of the message consumer, thus achieving the effects of making the network overhead of the producer and consumer equivalent, improving the accuracy of bandwidth prediction, and ensuring that the bandwidth meets the needs of the message consumer.

[0027] Example 2 Figure 2 This is a flowchart of a message queue bandwidth control method provided in Embodiment 2 of this application. The technical solution of this embodiment is further refined based on the above technical solution.

[0028] Furthermore, the phrase "determine the target bandwidth based on business scenarios, consumption scenarios, and single transmission volume" is further refined into: "determine the evaluation time period based on business scenarios, and determine the allowable delay duration based on consumption scenarios; the evaluation time period includes data peak periods and data trough periods; determine the predicted number of consumption transactions based on the evaluation time period and the allowable delay duration; and determine the target bandwidth based on the allowable delay duration, the predicted number of consumption transactions, and the single transmission volume," thus determining the target bandwidth.

[0029] See Figure 2 The message queue bandwidth control method shown includes: S210. Obtain the business scenarios of message producers and consumption scenarios of message consumers for the message queue to be evaluated.

[0030] S220. Determine the assessment period interval based on the business scenario and the allowable delay duration based on the consumption scenario; the assessment period interval includes data peak periods and data trough periods.

[0031] The evaluation period can be a data range used to assess the data production volume of a business scenario. The evaluation period can be determined based on the data distribution. For example, if the daily data is evenly distributed, the evaluation period can be 7 days; if the data distribution is uneven, the evaluation period needs to cover the peak and trough periods, such as a larger data volume at the beginning of the month and a smaller volume in the middle, in which case the evaluation period can be 30 days.

[0032] Since evaluating target bandwidth based on peak periods leads to resource waste, while evaluating it based on trough periods results in data loss during non-trough periods due to the inability to consume data in a timely manner and exceeding the retention period, the evaluation period includes both data peak and data trough periods.

[0033] The delay duration can be set by the consumer based on the time limit requirements of the data, and can be obtained through the message consumer's system settings.

[0034] S230. Determine the predicted number of transactions based on the assessment period and the available delay time.

[0035] The predicted number of consumption transactions can be calculated based on the number of transactions generated within each available latency period in the historical evaluation time interval, and is used to determine the target bandwidth. For example, the predicted number of consumption transactions can be obtained by statistically analyzing the historical records for each available latency period within the evaluation time interval, and then using this data to make a prediction.

[0036] In one optional embodiment, determining the number of historical consumption transactions based on the evaluation time period interval and the allowable delay duration includes: obtaining the number of consumption transactions to be sorted within the time period corresponding to each allowable delay duration within the evaluation time period interval; sorting each number of consumption transactions to be sorted to obtain a consumption transaction sequence; selecting a preset number of consumption transactions to be sorted from the consumption transaction sequence to obtain an evaluation sequence; and obtaining the predicted number of consumption transactions based on the evaluation sequence.

[0037] The number of data transactions to be sorted can be the number of transactions consumed within each time period corresponding to each delay duration within the evaluation period interval, which can be obtained from the message consumer's historical logs. The unsorted data transactions are then sorted in ascending order to obtain a sequence of transaction counts. For example, the unsorted data transactions can be sorted in descending order to obtain a sequence of transaction counts.

[0038] The preset quantity can be the number of data points in the consumption transaction sequence that need to be used to determine the predicted number of transactions. The preset quantity can be determined based on the data span in the consumption transaction sequence. For example, it can be determined based on the variance of the data in the consumption transaction sequence. For instance, the preset quantity could be 10.

[0039] A preset number of transactions are selected from the transaction count sequence to be sorted. The predicted transaction count is determined based on the average, median, or mode of the selected transactions. For example, the transactions are sorted in descending order to obtain a transaction count sequence. The first 10 data points in the transaction count sequence are selected, and the average of the selected data points is used as the predicted transaction count.

[0040] The number of transactions to be sorted can be represented as follows: ; in, Y represents the number of pending consumption transactions within the time period corresponding to the available delay duration, X represents the number of seconds corresponding to the available delay duration, and X represents the number of days corresponding to the evaluation time period interval.

[0041] The predicted number of transactions can be determined using the following formula: ; Where S is the predicted number of transactions, AVARAGE is the average value, and TOP((N[i]),10) is the 10 largest values ​​after sorting.

[0042] For example, suppose the consumption system has a delay time of 1 hour (Y=3600 seconds) and the data generated daily varies little. Therefore, the evaluation period is taken as the last 7 days (X=7), and a total of 86400×X / Y=168 values ​​are collected. The 10 largest data points are then averaged to obtain the predicted number of consumption transactions.

[0043] By obtaining the number of pending consumption transactions within each time period corresponding to the available delay duration within the evaluation period, the network overhead of producers and consumers is made equivalent. The pending consumption transactions are sorted to obtain a consumption transaction sequence. A preset number of pending consumption transactions are selected from the consumption transaction sequence to obtain an evaluation sequence. Based on the evaluation sequence, the predicted consumption transaction number is obtained. Based on the network overhead equivalence of producers and consumers, the accuracy of bandwidth prediction is improved, so that the predicted consumption transaction number meets the business scenarios of message producers and the consumption scenarios of message consumers.

[0044] S240. Determine the target bandwidth based on the delay duration, the predicted number of consumption transactions, and the amount of data transmitted per transaction.

[0045] Based on the predicted number of consumption transactions and the amount of data transmitted per transaction, the total amount of data that needs to be transmitted within the available latency period can be determined. Therefore, based on the available latency period, the predicted number of consumption transactions, and the amount of data transmitted per transaction, the target bandwidth can be determined.

[0046] In one optional embodiment, the target bandwidth is determined based on the delay duration, the predicted number of consumption transactions, and the single transmission volume, including: determining the single transmission volume based on the information compression rate and the single data volume in the business scenario; and determining the target bandwidth based on the delay duration, the predicted number of consumption transactions, and the single transmission volume to be transmitted.

[0047] The single data size refers to the original data size pushed by the message producer to the message queue, used to determine the single transmission volume. The information compression ratio is the compression ratio used by the message queue to compress the original data. Message queues support data compression to reduce message body size and decrease storage and transmission network usage. Whether data is compressed and the type of compression algorithm are determined by the message producer system configuration of the message queue. Different compression algorithms have different information compression ratios; for example, Gzip compression has a compression ratio of 2:1 to 5:1. The compression ratio is highly dependent on the data structure, and the information compression ratio should be determined based on actual performance testing. The single data size / information compression ratio represents the actual data size transmitted when the message consumer retrieves data. The single transmission volume can be determined by the following formula: ; The target bandwidth can be determined by the following formula: ; By determining the single-transmission volume based on the information compression rate and single data volume in the business scenario, and determining the target bandwidth based on the delay duration, predicted number of consumptions, and single-transmission volume, and taking into account the single data volume and compression rate of the message producer's information, this approach overcomes the problem of large differences in the size of different message data, making it difficult to accurately consume the network bandwidth required for data, and improves the accuracy of the target bandwidth.

[0048] S250. Determine whether the current bandwidth is greater than the target bandwidth, and if the determination result is negative, adjust the target bandwidth or the current bandwidth.

[0049] The technical solution of this embodiment determines the evaluation time period based on the business scenario and the allowable delay duration based on the consumption scenario. The evaluation time period includes data peaks and data troughs. Considering the peaks and troughs ensures that the subsequently determined target bandwidth will not lead to resource waste and message backlog. Based on the evaluation time period and the allowable delay duration, the predicted number of consumption transactions is determined. Considering the evaluation time period of the message producer and the allowable delay duration of the message consumer, the network overhead of the producer and consumer is equivalent. Based on the allowable delay duration, the predicted number of consumption transactions, and the transmission volume of a single message, the target bandwidth is determined. Considering the transmission volume of a single data message, the accuracy of the target bandwidth is improved.

[0050] Example 3 Figure 3 This is a flowchart of a message queue bandwidth control method provided in Embodiment 3 of this application. The technical solution of this embodiment is further refined based on the above technical solution.

[0051] Furthermore, the statement "when the judgment result is negative, adjust the target bandwidth or the current bandwidth" is refined to: "when the judgment result is negative, determine whether the current bandwidth is expandable; if yes, expand the current bandwidth to the target bandwidth; otherwise, adjust the relevant parameters in the business scenario or consumption scenario according to the current bandwidth so that the current bandwidth is greater than the target bandwidth" so that the current bandwidth meets the target bandwidth requirement.

[0052] See Figure 3 The message queue bandwidth control method shown includes: S310. Obtain the business scenarios of message producers and consumption scenarios of message consumers for the message queue to be evaluated.

[0053] S320. Determine the target bandwidth based on the business scenario, consumption scenario, and single transmission volume.

[0054] S330: Determine if the current bandwidth is greater than the target bandwidth.

[0055] S340. If the result is negative, determine whether the current bandwidth is scalable.

[0056] If the result is negative, meaning the current bandwidth is not greater than the target bandwidth, then the target bandwidth cannot meet the message consumer's bandwidth requirements. Therefore, it is necessary to adjust either the target bandwidth or the current bandwidth to make the current bandwidth greater than the target bandwidth. Next, determine if the current bandwidth can be expanded, i.e., whether the current bandwidth can be increased. If so, directly increase the current bandwidth to make it greater than the target bandwidth.

[0057] S350, if so, then expand the current bandwidth to the target bandwidth.

[0058] If so, meaning the current bandwidth is scalable, then the current bandwidth will be expanded to the target bandwidth so that the current bandwidth meets the bandwidth requirements of the message consumer.

[0059] S360. Otherwise, adjust the relevant parameters in the business or consumption scenario based on the current bandwidth to make the current bandwidth greater than the target bandwidth.

[0060] Otherwise, if the current bandwidth is not scalable, the target bandwidth needs to be reduced. Therefore, it is necessary to adjust the relevant parameters in the business or consumption scenarios so that the current bandwidth is greater than the target bandwidth.

[0061] In one optional embodiment, otherwise, based on the current bandwidth, the relevant parameters in the business scenario or consumption scenario are adjusted so that the target bandwidth is less than the current bandwidth, including: determining whether the relevant parameters in the business scenario or consumption scenario can be dynamically adjusted; if so, based on the current bandwidth, the corresponding parameters in the business scenario or consumption scenario are adjusted so that the current bandwidth is greater than the target bandwidth.

[0062] Determining whether relevant parameters in a business or consumption scenario can be dynamically adjusted can be done by judging based on the settings parameters of the business or consumption scenario, or by querying.

[0063] For example, a request to increase the delay duration can be sent to the message consumer. If the response is "agree", the delay duration that satisfies the current bandwidth can be determined as the target delay duration. The delay duration of the message consumer can then be adjusted to the target delay duration so that the current bandwidth is greater than the target bandwidth.

[0064] For example, the system configuration of the message producer can be used to determine whether the information compression rate can be increased. If so, the information compression rate that meets the current bandwidth can be determined as the target information compression rate. The information compression rate can then be adjusted to the target information compression rate so that the current bandwidth is greater than the target bandwidth.

[0065] By determining whether relevant parameters in the business or consumption scenario can be dynamically adjusted, if so, the corresponding parameters in the business or consumption scenario are adjusted according to the current bandwidth to make the current bandwidth greater than the target bandwidth. When the current bandwidth cannot be expanded, the parameters affecting the target bandwidth are adjusted to make the current bandwidth greater than the target bandwidth, ensuring that the current bandwidth meets the consumption needs of message consumers and ensuring the timeliness of information consumption.

[0066] The technical solution of this embodiment determines whether the bandwidth is scalable when the determination result is negative. First, it considers expanding the current bandwidth to reduce the impact on message producers and consumers while meeting the consumption needs of message consumers, thus improving the efficiency of bandwidth adjustment. If the result is positive, the current bandwidth is expanded to the target bandwidth to ensure that the current bandwidth meets the consumption needs of message consumers. Otherwise, based on the current bandwidth, relevant parameters in the business or consumption scenario are adjusted to make the current bandwidth greater than the target bandwidth. Adjustments are made from the perspective of reducing the target bandwidth to ensure that the current bandwidth meets the consumption needs of message consumers. Even when the current bandwidth cannot be expanded, it still ensures that the current bandwidth meets the consumption needs of message consumers, improving the flexibility of message queue bandwidth control.

[0067] Example 4 Figure 4 The diagram shown is a schematic representation of a message queue bandwidth control device according to Embodiment 4 of this application. This embodiment is applicable to situations where the bandwidth of a message queue is controlled, and is configured in a message queue system. The specific structure of the message queue bandwidth control device is as follows: The scenario information acquisition module 410 is used to acquire the business scenario of the message producer and the consumption scenario of the message consumer of the message queue to be evaluated. The target bandwidth determination module 420 is used to determine the target bandwidth based on the business scenario, consumption scenario, and single transmission volume; The bandwidth adjustment module 430 is used to determine whether the current bandwidth is greater than the target bandwidth, and if the determination result is negative, adjust the target bandwidth or the current bandwidth.

[0068] The technical solution of this embodiment obtains the business scenario of the message producer and the consumption scenario of the message consumer in the message queue to be evaluated; determines the target bandwidth based on the business scenario, consumption scenario, and single-transmission volume; by considering the business scenario and consumption scenario, the network overhead of the producer and consumer can be made equivalent; by considering the single-transmission volume, the accuracy of the predicted target bandwidth is improved; it determines whether the current bandwidth is greater than the target bandwidth, and if the result is negative, adjusts the target bandwidth or the current bandwidth; by adjusting the target bandwidth or the current bandwidth, considering both the target bandwidth and the current bandwidth, the bandwidth is ensured to meet the needs of the message consumer. Therefore, the technical solution of this application solves the problems of the lack of an effective bandwidth evaluation method, the inability to make the network overhead of the producer and consumer equivalent, the inability to guarantee the accuracy of bandwidth prediction, and the inability to guarantee that the bandwidth meets the needs of the message consumer, thus achieving the effects of making the network overhead of the producer and consumer equivalent, improving the accuracy of bandwidth prediction, and ensuring that the bandwidth meets the needs of the message consumer.

[0069] Optionally, the target bandwidth determination module 420 includes: The scenario parameter determination unit is used to determine the evaluation period interval based on the business scenario and the allowable delay duration based on the consumption scenario; the evaluation period interval includes data peak periods and data trough periods; The predicted number of transactions unit is used to determine the predicted number of transactions based on the assessment period and the available delay time. The target bandwidth determination unit is used to determine the target bandwidth based on the delay duration, the predicted number of consumption transactions, and the amount of data transmitted per transaction.

[0070] Optionally, the predictive consumption number determination unit includes: The unsorted consumption count acquisition sub-unit is used to obtain the unsorted consumption count within the time period corresponding to each delay duration within the evaluation time period interval; The unsorted consumption count sorting subunit is used to sort each unsorted consumption count to obtain a consumption count sequence; The sequence to be evaluated is divided into sub-units, which are used to select a preset number of consumption transactions to be sorted from the consumption transaction count sequence to obtain the sequence to be evaluated; The predicted number of transactions is obtained as a sub-unit, which is used to obtain the predicted number of transactions based on the sequence to be evaluated.

[0071] Optionally, the target bandwidth determination unit includes: The single transmission volume determination subunit is used to determine the single transmission volume based on the information compression rate and the single data volume in the business scenario; The target bandwidth determination subunit is used to determine the target bandwidth based on the delay duration, the predicted number of consumption transactions, and the amount of data to be transmitted per transaction.

[0072] Optional, the bandwidth adjustment module 430 includes: The bandwidth expansion determination unit is used to determine whether the current bandwidth is expandable when the determination result is negative. The current bandwidth expansion unit is used to expand the current bandwidth to the target bandwidth if the condition is met. The parameter adjustment unit is used to adjust relevant parameters in the business or consumption scenario based on the current bandwidth, so that the current bandwidth is greater than the target bandwidth.

[0073] Optional parameter adjustment unit, including: The relevant parameter judgment subunit is used to determine whether relevant parameters in business or consumption scenarios can be dynamically adjusted. The relevant parameter adjustment subunit is used to adjust the corresponding parameters in the business scenario or consumption scenario according to the current bandwidth, so that the current bandwidth is greater than the target bandwidth.

[0074] The message queue bandwidth control device provided in this application embodiment can execute the message queue bandwidth control method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the message queue bandwidth control method.

[0075] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0076] Example 5 Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application, as shown below. Figure 5 As shown, the electronic device includes a processor 510, a memory 520, an input device 530, and an output device 540; the number of processors 510 in the electronic device can be one or more. Figure 5 Taking a processor 510 as an example; the processor 510, memory 520, input device 530, and output device 540 in the electronic device can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.

[0077] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the message queue bandwidth control method in this embodiment (e.g., scene information acquisition module 410, target bandwidth determination module 420, and bandwidth adjustment module 430). The processor 510 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 520, thereby implementing the aforementioned message queue bandwidth control method.

[0078] The memory 520 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 520 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include memory remotely located relative to the processor 510, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0079] Input device 530 can be used to receive input character information and generate key signal inputs related to user settings and function control of the electronic device. Output device 540 may include display devices such as a display screen.

[0080] Example 6 Embodiment 6 of this application also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute a message queue bandwidth control method. The method includes: obtaining the business scenario of the message producer and the consumption scenario of the message consumer of the message queue to be evaluated; determining the target bandwidth based on the business scenario, the consumption scenario, and the single transmission volume; determining whether the current bandwidth is greater than the target bandwidth, and adjusting the target bandwidth or the current bandwidth if the determination result is negative.

[0081] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the method operations described above, but can also execute related operations in the message queue bandwidth control method provided in any embodiment of this application.

[0082] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0083] It is worth noting that in the above-described embodiments of the message queue bandwidth control device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.

[0084] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.

Claims

1. A message queue bandwidth control method, characterized by, The method comprises: acquiring a business scenario of a message producer and a consumption scenario of a message consumer of a message queue to be evaluated; determining a target bandwidth according to the business scenario, the consumption scenario, and a single-transmission quantity; judging whether a current bandwidth is greater than the target bandwidth, and adjusting the target bandwidth or the current bandwidth when the judgment result is no.

2. The method of claim 1, wherein, The method of determining the target bandwidth according to the business scenario, the consumption scenario, and the single-transmission quantity comprises: determining an evaluation time interval according to the business scenario, and determining a delayable time length according to the consumption scenario; the evaluation time interval comprises a data peak period and a data valley period; determining a predicted consumption pen number according to the evaluation time interval and the delayable time length; determining the target bandwidth according to the delayable time length, the predicted consumption pen number, and the single-transmission quantity.

3. The method of claim 2, wherein, The method of determining the predicted consumption pen number according to the evaluation time interval and the delayable time length comprises: acquiring a to-be-sequenced consumption pen number in each time interval corresponding to the delayable time length in the evaluation time interval; sequencing the to-be-sequenced consumption pen numbers to obtain a consumption pen number sequence; selecting a preset number of the to-be-sequenced consumption pen numbers from the consumption pen number sequence to obtain a to-be-evaluated sequence; obtaining the predicted consumption pen number according to the to-be-evaluated sequence.

4. The method of claim 2, wherein, The method of determining the target bandwidth according to the delayable time length, the predicted consumption pen number, and the single-transmission quantity comprises: determining the single-transmission quantity according to an information compression rate in the business scenario and a single-data quantity; determining the target bandwidth according to the delayable time length, the predicted consumption pen number, and the single-transmission quantity.

5. The method of claim 1, wherein, The method of adjusting the target bandwidth or the current bandwidth when the judgment result is no comprises: judging whether the current bandwidth is expandable when the judgment result is no; if yes, expanding the current bandwidth to the target bandwidth; otherwise, adjusting a related parameter in the business scenario or the consumption scenario according to the current bandwidth, so that the current bandwidth is greater than the target bandwidth.

6. The method of claim 5, wherein, The method of adjusting the related parameter in the business scenario or the consumption scenario according to the current bandwidth, so that the target bandwidth is less than the current bandwidth, comprises: judging whether the related parameter in the business scenario or the consumption scenario is dynamically adjustable; if yes, adjusting a corresponding parameter in the business scenario or the consumption scenario according to the current bandwidth, so that the current bandwidth is greater than the target bandwidth.

7. A message queue bandwidth control apparatus characterized by comprising: The method comprises: a scenario information acquisition module, configured to acquire a business scenario of a message producer and a consumption scenario of a message consumer of a message queue to be evaluated; a target bandwidth determination module, configured to determine a target bandwidth according to the business scenario, the consumption scenario, and a single-transmission quantity; a bandwidth adjustment module, configured to judge whether a current bandwidth is greater than the target bandwidth, and adjust the target bandwidth or the current bandwidth when the judgment result is no.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the message queue bandwidth control method in any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the message queue bandwidth control method in any one of claims 1-6.

10. A computer program product, characterised in that, The computer program product includes a computer program that, when executed by a processor, implements the message queue bandwidth control method as described in any one of claims 1-6.