Message queue resource determination method, device and resource intelligent scheduling system
By allocating resources according to the priority and resource demand of the message queue, the problem of unbalanced message processing is solved, and the message processing efficiency is improved and the system stability is improved.
Patent Information
- Application Number
- CN202311113825.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-08-30
AI Technical Summary
The existing technology cannot flexibly configure the message delivery rate of the message queue according to the priorities of different types of messages, resulting in unbalanced message processing or low efficiency in processing certain types of messages.
By obtaining the queue priority of the message queue, group the message queue, determine the target resource allocation amount according to the group priority and resource demand, and use different allocation strategies for resource allocation to ensure that high-priority message queues obtain resources first.
It improves the efficiency of message processing, ensures that different types of messages are processed smoothly according to priority, and improves the stability and resource utilization of the system.
Smart Images

Figure CN117176672B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a message queue resource determination method, device and resource intelligent scheduling system. Background Art
[0002] In the message subscription platform products, the amount of messages sent is large and the types of messages are diverse, so the message queues need to be managed and scheduled to support the stable operation of the platform. However, for the processing of composite type messages, the relevant technology cannot flexibly configure the message sending rate of different message queues according to the priority of different types of messages, resulting in problems such as unbalanced message processing or low efficiency in processing certain types of messages. Summary of the invention
[0003] The present application provides a message queue resource determination method, device and resource intelligent scheduling system, which can automatically determine the target resource allocation amount of message queues with different queue priorities based on the queue priority of the message queue, and can effectively improve the efficiency of message processing.
[0004] In a first aspect, an embodiment of the present application provides a method for determining message queue resources, the method comprising: obtaining queue priorities of multiple message queues; grouping each of the message queues according to the queue priorities of the message queues to obtain at least one group; wherein any of the groups has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority; according to the queue priorities corresponding to each of the groups, determining the target resource allocation amount of each of the target message queues based on the resource demand of each of the target message queues in the corresponding group in the order of each group.
[0005] In an optional implementation, the target resource allocation of each target message queue is determined based on the queue priority corresponding to each of the groups and the resource demand of each of the target message queues in the corresponding group, including: sorting the groups in order of queue priority from high priority to low priority to obtain a sorted sequence; according to the sorted sequence, allocating the speed allocation resources to the polled target groups according to whether the channel to which each of the target message queues in the target group belongs is a trigger message channel or a mass message channel, using a corresponding allocation strategy to determine the target resource allocation of each of the target message queues according to the resource demand.
[0006] In an optional implementation, the target group to be polled is allocated pacing resources using a corresponding allocation strategy based on whether the channel to which each target message queue in the target group belongs is a trigger message channel or a mass message channel, so as to determine the target resource allocation of each target message queue according to the resource demand, including: determining the target region corresponding to each target message queue in the polled target group; wherein the target region includes the trigger message channel and / or the mass message channel; obtaining the allocatable resource amount of any target region; when the allocatable resource amount is greater than a first set threshold, determining a corresponding allocation strategy for the polled target group based on whether the channel to which each target message queue in the target group belongs is a trigger message channel or a mass message channel; and determining the target resource allocation of each target message queue in the target group using the allocation strategy according to the resource demand of each target message queue in the target group.
[0007] In an optional implementation, the target group does not include the first message queue belonging to the mass message channel and does not include the second message queue belonging to the trigger message channel; the target resource allocation amount of each target message queue is determined by using the allocation strategy based on the resource demand of each target message queue in the target group, including: based on the allocatable resources of any target area and the target resource allocation amount of each target message queue in the target area, a first allocation strategy is used to determine the target resource allocation amount of each target message queue in the target area.
[0008] In an optional implementation, the target resource allocation amount of each target message queue in the target area is determined by adopting a first allocation strategy based on the allocatable resource amount of any of the target areas and the target resource allocation amount of each target message queue in the target area, including: for any of the target areas, determining the average resource allocation amount of the target area based on the allocatable resource amount of the target area and the first number of the target message queues in the target area; in response to the resource demand amounts of each of the target message queues in the target area being not greater than the average resource allocation amount of the target area, determining the resource demand amount of any of the target message queues in the target area as the target resource allocation amount of the target message queue; in response to the resource demand amounts of each of the target message queues in the target area being greater than the average resource allocation amount of the target area, determining the average resource allocation amount of the target area as the target The target resource allocation amount of the target message queue in the target large area; in response to the existence of a third message queue and a fourth message queue in each of the target message queues in the target large area, the resource demand of any of the third message queues is determined as the target resource allocation amount of the third message queue; wherein the resource demand of the third message queue is not greater than the average resource allocation amount of the target large area, and the resource demand of the fourth message queue is greater than the average resource allocation amount of the target large area; based on the allocatable resources of the target large area and the target resource allocation amount of each of the third message queues, the allocatable resources of the target large area are redetermined; in response to the allocatable resources of the redetermined target large area being greater than the first set threshold, based on the allocatable resources of the redetermined target large area and the resource demand of each of the fourth message queues, the first allocation strategy is adopted to determine the target resource allocation amount of each of the fourth message queues.
[0009] In an optional implementation, the target group includes a first message queue belonging to the mass message channel and does not include a second message queue belonging to the trigger message channel; the target resource allocation amount of each target message queue in the target group is determined by using the allocation strategy, including: based on the platform resource threshold, the allocatable resources of each target region, and the resource demand of each target message queue in the target group, a second allocation strategy is used to determine the target resource allocation amount of each target message queue in the target group.
[0010] In an optional implementation, the second allocation strategy is adopted based on the platform resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group to determine the target resource allocation amount of each target message queue in the target group, including: according to the allocatable resource amount of any target region and the resource demand of each target message queue in the target region, the first allocation strategy is adopted to determine the first resource allocation amount of each target message queue in the target region; the first resource allocation amounts of each first message queue are added to obtain a first sum; in response to the first sum being greater than the platform resource threshold, a first coefficient is determined according to the ratio of the platform resource threshold and the first sum; for For any of the first message queues, determine the target resource allocation amount of the first message queue based on the product of the first coefficient and the first resource allocation amount of the first message queue; for any of the target large areas, redetermine the allocatable resource amount of the target large area based on the allocatable resource amount of the target large area and the target resource allocation amount of the first message queue in the target large area; in response to the allocatable resource amount of the redetermined target large area being greater than the first set threshold, determine the target resource allocation amount of each target message queue in the target large area except the first message queue based on the allocatable resource amount of the redetermined target large area and the resource demand of each target message queue in the target large area except the first message queue, adopt the first allocation strategy.
[0011] In an optional implementation, the message queue resource determination method further includes: in response to the first sum being not greater than the platform resource threshold, determining the first resource allocation amount of any target message queue in the target group as the target resource allocation amount of the target message queue.
[0012] In an optional implementation, the target group includes a second message queue belonging to the trigger message channel and does not include a first message queue belonging to the mass message channel; the target resource allocation amount of each target message queue is determined by using the allocation strategy based on the resource demand of each target message queue in the target group, including: based on the trigger resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group, a third allocation strategy is used to determine the target resource allocation amount of each target message queue in the target group.
[0013] In an optional implementation, the target resource allocation amount of each target message queue in the target group is determined by adopting a third allocation strategy based on the trigger resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group, including: according to the allocatable resource amount of any target region and the resource demand of each target message queue in the target region, adopting the first allocation strategy to determine the second resource allocation amount of each target message queue in the target region; adding the second resource allocation amount of each second message queue to obtain a second sum; in response to the second sum being greater than the trigger resource threshold, determining a second coefficient according to the ratio of the trigger resource threshold and the second sum; for For any of the second message queues, determine the target resource allocation amount of the second message queue according to the product of the second coefficient and the second resource allocation amount of the second message queue; for any of the target large areas, redetermine the allocatable resource amount of the target large area according to the allocatable resource amount of the target large area and the target resource allocation amount of the second message queue in the target large area; in response to the allocatable resource amount of the redetermined target large area being greater than the first set threshold, determine the target resource allocation amount of each target message queue in the target large area except the second message queue according to the redetermined allocatable resource amount of the target large area and the resource demand of each target message queue in the target large area except the second message queue, adopt the first allocation strategy.
[0014] In an optional implementation, the message queue resource determination method further includes: in response to the second sum being not greater than the trigger resource threshold, determining the first resource allocation amount of any of the target message queues in the target group as the target resource allocation amount of the target message queue. In response to the second sum being not greater than the trigger resource threshold, determining the first resource allocation amount of any of the target message queues in the target group as the target resource allocation amount of the target message queue.
[0015] In an optional implementation, the obtaining of the allocatable amount of resources for any of the target regions includes: for any of the target regions, determining the second number of the fifth message queue in the target region in the group that has not been polled and the third number of the sixth message queue; wherein the fifth message queue belongs to the group messaging channel, and the resource demand of the fifth message queue is not the second set threshold; the sixth message queue belongs to the trigger message channel; determining the target allocated amount of resources for the target region based on the target resource allocation amount of each of the target message queues in the target region in the group that has been polled; and determining the allocatable amount of resources for the target region based on the target total amount of resources for the target region, the target allocated amount of resources for the target region, the second number and the third number.
[0016] In an optional implementation, obtaining the target total amount of resources of the target zone includes: adding the allocated resource amounts of each message queue in the interactive message channel in the target zone to obtain the total amount of interactive resources of the target zone; and determining the target total amount of resources of the target zone based on the total amount of zone resources of the target zone and the total amount of interactive resources of the target zone.
[0017] In an optional implementation, the acquisition of the resource requirement of the target message queue includes: in response to the queue message backlog of the target message queue being 0 and the target message queue belonging to a group message channel, the resource requirement of the target message queue is a third set threshold; in response to the queue message backlog of the target message queue being 0 and the target message queue belonging to a trigger message channel, the resource requirement of the target message queue is a fourth set threshold; in response to the queue message backlog of the target message queue being not 0, determining the resource requirement of the target message queue according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold.
[0018] In an optional implementation, the resource demand of the target message queue is determined based on the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold, including: in response to the target message queue belonging to the mass messaging channel, determining a first ratio based on the ratio of the queue message backlog of the target message queue to the first set time interval; determining a first maximum value from the first ratio and the fourth set threshold; determining a first minimum value from the first maximum value, the queue resource threshold of the target message queue and the dynamically allocated resource threshold; and using the first minimum value as the resource demand of the target message queue.
[0019] In an optional implementation, the resource demand of the target message queue is determined based on the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold, including: in response to the target message queue belonging to the trigger message channel, determining a third coefficient based on the first set time interval; determining a second ratio based on the ratio of the queue message backlog of the target message queue to the third coefficient; determining a second maximum value from the second ratio and the fourth set threshold; determining a second minimum value from the second maximum value, the queue resource threshold of the target message queue and the dynamically allocated resource threshold; and using the second minimum value as the resource demand of the target message queue.
[0020] In an optional implementation, obtaining the queue resource threshold of the target message queue includes: obtaining a set resource threshold corresponding to the target message queue, and obtaining a minimum message processing rate when the subscription number Chatbot processes messages in the message queue; determining a third minimum value from the set resource threshold and the corresponding message processing rate corresponding to the target message queue; and using the third minimum value as the queue resource threshold of the target message queue.
[0021] In a second aspect, an embodiment of the present application provides a resource intelligent scheduling system, the system comprising a basic configuration module, a monitoring module, a resource determination module and a resource allocation module, wherein:
[0022] The basic configuration module is used to configure the message queue corresponding to any message and the queue priority of each message queue;
[0023] The monitoring module is used to monitor the queue message backlog of each message queue and the allocated resource amount of each message queue;
[0024] The resource determination module is used to determine the target resource allocation amounts corresponding to the multiple message queues by using the message queue resource determination method as described in the first aspect of the present application;
[0025] The resource allocation module is used to allocate speed resources to the message queue according to the target resource allocation amount of any of the message queues.
[0026] In the third aspect, an embodiment of the present application provides a message queue resource determination device, the device comprising: a first acquisition module, used to obtain the queue priority of multiple message queues; a grouping module, used to group each of the message queues according to the queue priority of each message queue to obtain at least one group; wherein any of the groups has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority; a first determination module, used to determine the target resource allocation amount of each target message queue based on the resource demand of each target message queue in the corresponding group according to the queue priority corresponding to each group.
[0027] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message queue resource determination method as described in the first aspect.
[0028] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium for storing instructions, which, when executed, enables the method described in the first aspect to be implemented.
[0029] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the message queue resource determination method as described in the first aspect.
[0030] The technical solution provided by the embodiments of the present application may include the following beneficial effects: based on the queue priority of the message queue, the target resource allocation amount of the message queues with different queue priorities can be automatically determined, which can effectively improve the efficiency of message processing. It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easy to understand through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0032] Figure 1 It is a schematic diagram of a message queue resource determination method provided in Example 1 of the present application;
[0033] Figure 2 It is a schematic diagram of a message queue resource determination method provided in Embodiment 2 of the present application;
[0034] Figure 3It is a schematic diagram of a message queue resource determination method provided in Embodiment 3 of the present application;
[0035] Figure 4 It is a schematic diagram of a message queue resource determination method provided in Embodiment 4 of the present application;
[0036] Figure 5 It is a schematic diagram of a message queue resource determination method provided in Embodiment 5 of the present application;
[0037] Figure 6 It is a structural diagram of an intelligent scheduling system provided in Example 6 of the present application;
[0038] Figure 7 It is a structural diagram of a message queue intelligent scheduling system provided by this application;
[0039] Figure 8 A flow chart of a dynamic speed matching method implemented by a resource demand calculation module provided in this application;
[0040] Fig. 9 It is a structural diagram of a message queue resource determination device provided by implementation seven of the present application;
[0041] Fig.10 is a schematic block diagram of an example electronic device that can be used to implement embodiments of the present application. DETAILED DESCRIPTION
[0042] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0043] In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The various numbers such as first and second involved in this application are only distinguished for the convenience of description, and are not used to limit the scope of the embodiments of this application, nor do they indicate the order of precedence.
[0044] In the related art, there are the following disadvantages when processing multi-priority composite type messages, multi-channels and multiple message queues:
[0045] (1) Unable to cope with the constraints of multiple types of messages: It is difficult to flexibly configure the message delivery rates of different channels and queues according to the constraints of different types of messages, resulting in the resource allocation of message delivery rates not being consistent with the actual situation, causing overspeed.
[0046] (2) Failure to consider the service characteristics of multi-channel messages: When processing multi-channel messages, the immediacy requirements of messages are not given priority. For example, the trigger message channel requires a relatively high immediacy, while the group message channel requires a relatively low immediacy. When allocating message delivery rate resources, it is necessary to give priority to allocating more resources to the trigger message channel. However, the defect of not giving priority to the immediacy requirements of messages leads to unbalanced message processing, affecting the overall business.
[0047] In response to at least one of the above problems, the present application proposes a message queue resource determination method, device and resource intelligent scheduling system.
[0048] The following describes the message queue resource determination method, device and resource intelligent scheduling system of the embodiments of the present application with reference to the accompanying drawings.
[0049] Figure 1 It is a schematic diagram of a message queue resource determination method provided in Example 1 of the present application.
[0050] The embodiment of the present application takes the method for determining message queue resources as an example in which the method is configured in a message queue resource determining device. The message queue resource determining device can be applied to any electronic device so that the electronic device can perform a message queue resource determining function.
[0051] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a server, etc. The mobile terminal can be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.
[0052] like Figure 1 As shown, the message queue resource determination method may include the following steps:
[0053] Step S101, obtaining queue priorities of multiple message queues.
[0054] In an embodiment of the present application, each message queue may have a corresponding queue priority.
[0055] It is understandable that the queue priority of the message queue can be represented by numbers, characters, etc. For example, the queue priority of the message queue is represented as level 0 to level 5 from high priority to low priority, and for another example, the queue priority of the message queue is represented as level A to level K from high priority to low priority. It should be noted that the above examples are only exemplary, and in actual applications, the queue priority of the message queue can be set as needed.
[0056] In an embodiment of the present application, queue priorities of multiple message queues may be obtained.
[0057] As a possible implementation manner, queue priorities of multiple message queues may be preconfigured, and the queue priorities of each message queue may be saved, so that the queue priorities of each message queue may be queried and read.
[0058] Step S102: grouping the message queues according to their queue priorities to obtain at least one group.
[0059] Among them, any group may have a corresponding queue priority, and any group may include a target message queue belonging to the corresponding queue priority.
[0060] It can be understood that the number of target message queues belonging to the corresponding queue priority in any group can be but is not limited to one, and the present application does not impose any limitation on this.
[0061] In the embodiment of the present application, each message queue may be grouped according to the queue priority of each message queue to obtain at least one group. It should be noted that the group may be one or more, and the present application does not limit this.
[0062] For example, suppose that multiple message queues are obtained, including message queue A1, message queue A2, message queue A3, message queue B1, and message queue B2, and the queue priorities of the above message queues are level 0, level 1, level 2, level 2, and level 3, respectively. After grouping the message queues according to their queue priorities, the obtained groups are:
[0063] Group 1 (corresponding queue priority is level 0): message queue A1
[0064] Group 2 (corresponding queue priority is level 1): message queue A2
[0065] Group 3 (corresponding queue priority is level 2): message queue A3, message queue B1
[0066] Group 4 (corresponding queue priority is level 3): message queue B2
[0067] Step S103 , according to the queue priority corresponding to each group, the target resource allocation amount of each target message queue is determined based on the resource demand of each target message queue in the corresponding group for each group order.
[0068] In the embodiment of the present application, each group may have a corresponding grouping order.
[0069] In the embodiment of the present application, the grouping order corresponding to each group can be determined according to the queue priority corresponding to each group.
[0070] Still using the above example to illustrate, according to the queue priority corresponding to each group, the grouping order of packet 4 is determined to be 1, the grouping order of packet 3 is 2, the grouping order of packet 2 is 3, and the grouping order of packet 1 is 4; for another example, according to the queue priority corresponding to each group, the grouping order of packet 1 is determined to be 1, the grouping order of packet 2 is 2, the grouping order of packet 3 is 3, the grouping order of packet 4 is 4, and so on.
[0071] It should be noted that the above examples of the grouping order of each group are only exemplary. In practical applications, there may be other examples, and this application does not impose any limitation on this.
[0072] In an embodiment of the present application, after determining the group order corresponding to each group according to the queue priority corresponding to each group, the target resource allocation amount of each target message queue in the corresponding group can be determined based on the resource demand of each target message queue in the corresponding group.
[0073] The message queue resource determination method of the embodiment of the present application obtains the queue priorities of multiple message queues; groups each message queue according to the queue priority of each message queue to obtain at least one group; wherein any group has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority; and determines the target resource allocation amount of each target message queue based on the resource demand of each target message queue in the corresponding group according to the queue priority corresponding to each group. Thus, the target resource allocation amount of message queues with different queue priorities can be automatically determined based on the queue priority of the message queue, which can effectively improve the efficiency of message processing.
[0074] In order to clearly explain how, in the above-mentioned embodiment of the present application, the target resource allocation amount of each target message queue is determined based on the queue priority corresponding to each group and the resource demand of each target message queue in the corresponding group, the present application also proposes a message queue resource determination method.
[0075] Figure 2 It is a schematic diagram of a message queue resource determination method provided in Example 2 of the present application.
[0076] like Figure 2 As shown, the message queue resource determination method may include the following steps:
[0077] Step S201, obtaining queue priorities of multiple message queues.
[0078] Step S202: grouping the message queues according to their queue priorities to obtain at least one group.
[0079] The execution process of step S201 to step S202 can refer to the execution process of any embodiment of the present application, and will not be repeated here.
[0080] Step S203, sorting the packets in order of queue priority from high priority to low priority to obtain a sorting sequence.
[0081] In an embodiment of the present application, each group may be sorted in order of queue priority from high priority to low priority to obtain a sorted sequence.
[0082] Still using the example in step S102 for explanation, when the queue priorities are in the order of 0 to 3 from high priority to low priority, the groups are sorted in the order of high priority to low priority, and the sorted sequence is group 1, group 2, group 3, and group 4.
[0083] Step S204, according to the sorting sequence, the target group polled is allocated speed resources according to the channel to which each target message queue in the target group belongs, whether it is a trigger message channel or a group message channel, and the corresponding allocation strategy is adopted to allocate the speed resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand.
[0084] It should be noted that the channel to which each target message queue in the target group belongs may be a trigger message channel or a group message channel.
[0085] In an embodiment of the present application, each group can be polled in turn according to the sorting sequence, so that for the polled target group, the corresponding allocation strategy can be used to allocate the speed resources according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a mass message channel, so as to determine the target resource allocation amount of each target message queue according to the resource demand.
[0086] Still using the above example for explanation, the sorting sequence is group 1, group 2, group 3, group 4. According to the sorting sequence, group 1, group 2, group 3, group 4 can be polled in turn; when group 3 is polled, group 3 can be used as the target group, and according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a mass message channel, the corresponding allocation strategy can be used to allocate the speed resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand.
[0087] The message queue resource determination method of the embodiment of the present application is to sort each group in the order of queue priority from high priority to low priority to obtain a sorting sequence; according to the sorting sequence, the target group polled is allocated speed resources according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel, and the corresponding allocation strategy is adopted to allocate the speed resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand. Thus, based on the order of queue priority from high priority to low priority, the target resource allocation amount of the target message queue corresponding to each queue priority can be determined sequentially, that is, resources are allocated to the target message queue with high priority first, and then resources are allocated to the target message queue with low priority, so as to meet the actual needs of the target message queues with different queue priorities.
[0088] In order to clearly explain in the above embodiment of the present application how the target groups polled are allocated speed resources according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a mass message channel, and a corresponding allocation strategy is adopted to allocate the speed resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand, the present application also proposes a message queue resource determination method.
[0089] Figure 3 It is a schematic diagram of a message queue resource determination method provided in Example 3 of the present application.
[0090] like Figure 3 As shown, based on the above embodiment of the present application, the message queue resource determination method may further include the following steps:
[0091] Step S301, determining the target region corresponding to each target message queue in the polled target group.
[0092] In the embodiment of the present application, the target region corresponding to each target message queue in the polled target group can be determined.
[0093] For example, assuming that the target group polled is group 1, the target message queues in the target group 1 include message queue a2, message queue a3, message queue b1, and message queue c1, wherein the target region corresponding to message queue a2 and message queue a3 is region A, the target region corresponding to message queue b1 is region B, and the target region corresponding to message queue c1 is region C.
[0094] It is understandable that in the field of communications, each target region may include a trigger message channel and / or a group message channel. That is, the target region may include a trigger message channel and a group message channel, or the target region may include a trigger message channel but not a group message channel, or the target region may include a group message channel but not a trigger message channel.
[0095] Step S302, obtaining the allocatable resource amount of any target region.
[0096] In the embodiment of the present application, the amount of allocatable resources of any target region may be obtained.
[0097] As a possible implementation method, for any target region, the second number of the fifth message queue in the target region in the group that has not been polled and the third number of the sixth message queue are determined; wherein the fifth message queue belongs to a group message channel, and the resource demand of the fifth message queue is not the second set threshold; the sixth message queue belongs to a trigger message channel; according to the target resource allocation amount of each target message queue in the target region in the group that has been polled, the target allocated resource amount of the target region is determined; based on the target total resource amount of the target region, the target allocated resource amount of the target region, the second number and the third number, the allocatable resource amount of the target region can be determined.
[0098] In an embodiment of the present application, the second set threshold may be pre-set, for example, 0, 1, etc., and the present application does not impose any limitation on this.
[0099] In the embodiment of the present application, the fifth message queue may be a message queue belonging to a group message channel, and the resource demand of the fifth message queue is not the second set threshold.
[0100] In the embodiment of the present application, the sixth message queue may be a message queue belonging to a trigger message channel.
[0101] In the embodiment of the present application, for any target zone, the second number of the fifth message queue and the third number of the sixth message queue in the target zone in the group that has not been polled can be determined.
[0102] As an example, assume that the groups to be polled in sequence are group 1, group 2, group 3, group 4, and group 5, the target group to be polled is group 3, and the groups not to be polled include group 4 and group 5, wherein the target regions corresponding to the target message queues in group 3 determined include region A and region C. For region A, the second number of the fifth message queue belonging to region A in groups 4 and 5 that have not been polled and the third number of the sixth message queue belonging to region A can be determined. For example, the number of the fifth message queue belonging to region A in group 4 that has not been polled is 3, and the number of the fifth message queue belonging to region A in group 5 that has not been polled is 1. If the number of columns is 0, it can be determined that the second number of the fifth message queue belonging to area A in the unpolled group 4 and group 5 is 3 (=3+0), the number of the sixth message queue belonging to area A in the unpolled group 4 is 1, and the number of the sixth message queue belonging to area A in the unpolled group 5 is 4, then it can be determined that the third number of the sixth message queue belonging to area A in the unpolled group 4 and group 5 is 5 (=1+4); and so on, for area C, the second number of the fifth message queue belonging to area C in the unpolled group 4 and group 5 and the third number of the sixth message queue belonging to area A can be determined.
[0103] In the embodiment of the present application, the target allocated resource amount of the target zone can be determined according to the target resource allocation amount of each target message queue in the target zone in the group that has been polled.
[0104] As a possible implementation manner, the target resource allocation amount of each target message queue in the target region in the group that has been polled may be added up to obtain the target allocated resource amount of the target region.
[0105] Still using the above example for explanation, assuming that the groups that need to be polled in sequence are group 1, group 2, group 3, group 4, and group 5, the target group to be polled is group 3, and the groups that have been polled include group 1 and group 2, wherein the target regions corresponding to the target message queues in group 3 include region A and region C; for region A, the target message queues belonging to region A in group 1 that has been polled include message queue a1, message queue a4, and message queue a5, and the target message queue belonging to region A in group 2 that has been polled does not exist. At this time, the target resource allocation amount of message queue a1, the target resource allocation amount of message queue a4, and the target resource allocation amount of message queue a5 can be added, and the result of the addition is determined as the target allocated resource amount of region A; and by analogy, the target allocated resource amount of region C can be obtained.
[0106] In the embodiment of the present application, the allocatable amount of resources of the target large area may be determined based on the target total amount of resources of the target large area, the target allocated amount of resources of the target large area, the second number, and the third number.
[0107] For example, the total target resource of target region A is S 总 , the target allocated resource amount of the target region A is S', the second number is m1, and the third number is m2. Then the allocable resource amount S of the target region can be determined according to the following formula: 可分配 :
[0108] S 可分配 =S 总 -S'-100(m1+m2); (1)
[0109] Therefore, on the one hand, the allocatable resource amount of each target area can be effectively obtained, and on the other hand, a certain amount of resources can be reserved in advance for the message queues belonging to the trigger message channel and the group message channel in the target area of the group that has not been polled, which is flexible.
[0110] In order to clearly illustrate how the target total amount of resources of the target zone is obtained, in a possible implementation method of an embodiment of the present application, the total amount of interactive resources of the target zone can be determined based on the sum of the allocated resources of each message queue in the interactive message channel in the target zone, and the target total amount of resources of the target zone can be determined based on the total amount of zone resources of the target zone and the total amount of interactive resources of the target zone.
[0111] In the embodiment of the present application, an interactive message channel different from the group message channel and the trigger message channel may exist in each target region.
[0112] In the embodiment of the present application, each target region may have a corresponding total amount of region resources.
[0113] For example, suppose the interactive message channel in the target region A includes n message queues, and the allocated resources of the i-th message queue are S 交i , where i∈[1,n] and i is a positive integer, the total amount of interactive resources S of the target region A can be determined according to the following formula: 交 :
[0114]
[0115] And it can be based on the total regional resources S of the target region and the total interactive resources S of the target region 交 The difference between the target resource amount S of the target area is determined 总 :
[0116] S 总 =SS 交; (3)
[0117] Therefore, based on the total amount of regional resources of the target region and the allocated amount of resources of each message queue belonging to the interactive message channel in the target region, the target total amount of resources of the target region can be effectively determined, that is, the total amount of resources used to allocate resources to each message queue in the trigger message channel and the group message channel in the target region can be determined.
[0118] Step S303, when the allocatable resource amount is greater than the first set threshold, for the polled target group, a corresponding allocation strategy is determined according to whether the message channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel.
[0119] In the embodiment of the present application, the first set threshold may be pre-set, such as 0, 100, etc., and the present application does not impose any limitation on this.
[0120] In an embodiment of the present application, when the amount of allocatable resources is greater than a first set threshold, a corresponding allocation strategy can be determined for the polled target group based on whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel.
[0121] Step S304: according to the resource demand of each target message queue in the target group, an allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group.
[0122] In the embodiment of the present application, the target resource allocation amount of each target message queue in the target group can be determined by adopting a corresponding allocation strategy according to the resource demand of each target message queue in the target group.
[0123] The message queue resource determination method of the embodiment of the present application is to determine the target region corresponding to each target message queue in the polled target group; wherein the target region includes a trigger message channel and / or a group message channel; obtain the allocatable resource amount of any target region; when the allocatable resource amount is greater than a first set threshold, for the polled target group, determine the corresponding allocation strategy based on whether the message channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel; and determine the target resource allocation amount of each target message queue in the target group using an allocation strategy based on the resource demand of each target message queue in the target group. Thus, it is possible to use different allocation strategies based on whether the message channel to which the target message queue belongs is a trigger message channel or a group message channel, so as to effectively determine the target resource allocation amount of each target message queue in the target group.
[0124] On the basis of the above-mentioned embodiments, the embodiments of the present application describe in detail the process of determining the target resource allocation amount of each target message queue by using an allocation strategy according to the resource demand of each target message queue in the target group.
[0125] Figure 4 It is a schematic diagram of a message queue resource determination method provided in Example 4 of the present application.
[0126] like Figure 4 As shown, based on the second embodiment of the present application, the message queue resource determination method may further include the following steps:
[0127] Step S401, determining the target region corresponding to each target message queue in the polled target group.
[0128] Step S402, obtaining the allocatable resource amount of any target region.
[0129] Step S403, when the allocatable resource amount is greater than the first set threshold, for the polled target group, a corresponding allocation strategy is determined according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel.
[0130] The execution process of step S401 to step S403 can refer to the execution process of any embodiment of the present application, and will not be repeated here.
[0131] Step S404, when the target group does not include the first message queue belonging to the mass message channel and does not include the second message queue belonging to the trigger message channel, a first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target area according to the allocatable resource amount of any target area and the resource demand of each target message queue in the target area.
[0132] In the embodiment of the present application, the first message queue may be a short 2.0 message queue belonging to a group messaging channel.
[0133] In the embodiment of the present application, the second message queue may be each message queue belonging to the trigger message channel. It should be noted that the present application does not limit the number of second message queues in the trigger message channel.
[0134] In the embodiment of the present application, the target group may not include the first message queue belonging to the group message channel, and may not include the second message queue belonging to the trigger message channel. For example, the target group may not include the short 2.0 message queue belonging to the group message channel, and may not include the second message queues belonging to the group message channel.
[0135] In an embodiment of the present application, when the target group does not include the first message queue belonging to the mass message channel and does not include the second message queue belonging to the trigger message channel, the first allocation strategy can be adopted to determine the target resource allocation amount of each target message queue in the target area based on the allocatable resource amount of any target area and the resource demand of each target message queue in the target area.
[0136] For example, when the target area A does not include the first message queue belonging to the mass message channel and does not include the second message queue belonging to the trigger message channel, the first allocation strategy can be adopted according to the allocatable resource amount of the target area A and the target resource allocation amount of each target message queue in the target area A to determine the target resource allocation amount of each target message queue in the target area.
[0137] As a possible implementation, when the target group does not include the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel, the following steps can be adopted to implement the process of determining the target resource allocation amount of each target message queue in the target area by adopting the first allocation strategy according to the allocatable resource amount of any target area and the resource demand amount of each target message queue in the target area:
[0138] Step S4041, for any target zone, determine the average resource allocation amount of the target zone according to the allocatable resource amount of the target zone and the first number of the target message queue in the target zone.
[0139] In the embodiment of the present application, for any target zone, the average resource allocation amount of the target zone can be determined according to the allocatable resource amount of the target zone and the first number of the target message queue in the target zone.
[0140] As an example, for any target zone, the ratio of the allocatable resource amount of the target zone to the first number of the target message queue in the target zone can be determined as the average resource allocation amount of the target zone.
[0141] For example, for target region A, assuming that the amount of resources that can be allocated to target region A is S 可分配 , the first number of the target message queue in the target region A is n, then the average resource allocation of the target region can be determined according to the following formula:
[0142]
[0143] Step S4042, in response to the resource demand of each target message queue in the target zone not being greater than the average resource allocation of the target zone, the resource demand of any target message queue in the target zone is determined as the target resource allocation of the target message queue.
[0144] In an embodiment of the present application, when the resource demand of each target message queue in the target zone is not greater than the average resource allocation of the target zone, the resource demand of any target message queue in the target zone can be determined as the target resource allocation of the target message queue.
[0145] That is to say, when the resource demand of each target message queue in the target region is not greater than the average resource allocation of the target region, the resource amount allocated to any target message queue in the target region can be equal to the corresponding resource demand.
[0146] For example, for target region A, assuming that the average resource allocation of target region A is The first number of target message queues in the target region A is n, where the resource demand of the i-th target message queue in the target region A is D i , i∈[1,n] and i is a positive integer; when And j is a positive integer, both Then the target resource allocation amount S of the i-th target message queue in the target region A is 目i Equal to D i .
[0147] Step S4043, in response to the resource demand of each target message queue in the target zone being not less than the average resource allocation of the target zone, the average resource allocation of the target zone is determined as the target resource allocation of the target message queue in the target zone.
[0148] In an embodiment of the present application, when the resource demand of each target message queue in the target zone is not less than the average resource allocation of the target zone, the average resource allocation of the target zone can be determined as the target resource allocation of the target message queue in the target zone.
[0149] Still using the above example to illustrate, when And j is a positive integer, both Then the target resource allocation amount S of the i-th target message queue in the target region A is 目i equal Where i∈[1,n] and i is a positive integer.
[0150] Step S4044, in response to the existence of a third message queue and a fourth message queue in each target message queue in the target region, the resource demand of any third message queue is determined as the target resource allocation of the third message queue; wherein the resource demand of the third message queue is not greater than the average resource allocation of the target region, and the resource demand of the fourth message queue is greater than the average resource allocation of the target region.
[0151] In the embodiment of the present application, the third message queue may be a target message queue whose resource demand in the target region is not greater than the average resource allocation in the target region.
[0152] In the embodiment of the present application, the fourth message queue may be a target message queue in which the resource demand in the target region is greater than the average resource allocation in the target region.
[0153] In an embodiment of the present application, when there are third message queues and fourth message queues in each target message queue in the target zone, the resource demand of any third message queue can be determined as the target resource allocation amount of the third message queue.
[0154] For example, for target region A, assuming that the average resource allocation of target region A is The first number of target message queues in the target region A is n, where the resource demand of the i-th target message queue in the target region A is D i , i∈[1,n] and i is a positive integer; when there are some target message queues in the target area A whose resource demand is not greater than And there is another part of the target message queue whose resource demand is greater than If the resource demand is not greater than Each target message queue is used as the third message queue, and the resource demand is greater than The target message queue is used as the fourth message queue; at this time, for any third message queue, the resource demand of the third message queue can be determined as the target resource allocation amount of the third message queue.
[0155] It should be noted that, for the fourth message queue in each target message queue in the target zone, the following steps S4045 to S4046 may be used to determine the target resource allocation amount of the fourth message queue.
[0156] Step S4045, re-determine the allocatable resource amount of the target large area according to the allocatable resource amount of the target large area and the target resource allocation amount of each third message queue.
[0157] In the embodiment of the present application, the allocatable resource amount of the target zone may be re-determined according to the allocatable resource amount of the target zone and the target resource allocation amount of each third message queue.
[0158] As an example, the target resource allocation amounts of the third message queues in the target zone may be summed to obtain a third sum, and the allocatable resource amount of the target zone may be re-determined as the difference between the allocatable resource amount of the target zone and the third sum.
[0159] Step S4046, in response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the target resource allocation amount of each fourth message queue is determined using the first allocation strategy based on the allocatable amount of resources in the re-determined target zone and the resource requirements of each fourth message queue.
[0160] It should be noted that the explanation of the first set threshold in any embodiment of the present application is also applicable to this embodiment and will not be repeated here.
[0161] In an embodiment of the present application, when the allocatable amount of resources in the re-determined target zone is greater than the first set threshold, the first allocation strategy can be adopted to determine the target resource allocation amount of each fourth message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each fourth message queue.
[0162] That is to say, when the allocatable amount of resources in the re-determined target area is greater than the first set threshold, a method similar to steps S4041 to S4046 can be used to determine the target resource allocation amount of each fourth message queue based on the allocatable amount of resources in the re-determined target area and the resource demand of each fourth message queue, which will not be repeated here.
[0163] It can be understood that when the allocatable resource amount of the re-determined target large area is not greater than the first set threshold, it indicates that the resource amount of the current target large area has been allocated, and the subsequent resource allocation process can be stopped.
[0164] It should be noted that the above description is only based on the sequential execution of step S4042, step S4043, and steps S4044-S4046. In actual application, you can choose to execute one by one.
[0165] As an example, when the queue priority of the polled target group is 1, the target message queues in the target group
[0166] Therefore, when the target group does not include the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel, the target resource allocation amount of each target message queue in the target group can be effectively determined.
[0167] Step S405, when the target group includes the first message queue belonging to the mass message channel but does not include the second message queue belonging to the trigger message channel, a second allocation strategy is adopted based on the platform resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group to determine the target resource allocation amount of each target message queue in the target group.
[0168] In an embodiment of the present application, the platform resource threshold may be pre-set and used to characterize the resource upper limit of the Short Small 2.0 platform. The present application does not impose any restrictions on the value of the platform resource threshold.
[0169] In an embodiment of the present application, the target group may include a first message queue belonging to a group message channel, and may not include a second message queue belonging to a trigger message channel. For example, the target group may include a short 2.0 message queue belonging to a group message channel, and may not include each second message queue belonging to the group message channel.
[0170] In an embodiment of the present application, when the target group includes a first message queue belonging to a mass message channel but does not include a second message queue belonging to a trigger message channel, a second allocation strategy can be adopted based on the platform resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group to determine the target resource allocation amount of each target message queue in the target group.
[0171] As a possible implementation, when the target group includes the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel, the following steps can be adopted to implement the process of determining the target resource allocation amount of each target message queue in the target group by adopting the second allocation strategy based on the platform resource threshold, the allocatable resource amount of each target region, and the resource demand amount of each target message queue in the target group:
[0172] Step S4051, according to the allocatable resource amount of any target zone and the resource demand amount of each target message queue in the target zone, a first allocation strategy is adopted to determine the first resource allocation amount of each target message queue in the target zone.
[0173] In an embodiment of the present application, when the target group includes a first message queue belonging to a group message channel and does not include a second message queue belonging to a trigger message channel, for any target area, a first allocation strategy can be adopted to determine the first resource allocation amount of each target message queue in the target area based on the allocatable resource amount of the target area and the resource demand of each target message queue in the target area.
[0174] That is to say, for any target zone, a method similar to steps S4041 to S4046 is first used to determine the first resource allocation amount of each target message queue in the target zone based on the allocatable resource amount of the target zone and the resource demand of each target message queue in the target zone.
[0175] Step S4052: sum the first resource allocation amounts of the first message queues in each target zone to obtain a first sum.
[0176] In the embodiment of the present application, the first resource allocation amounts of the first message queues in each target zone may be added to obtain a first sum.
[0177] Step S4053: In response to the first sum being greater than the platform resource threshold, a first coefficient is determined according to a ratio of the platform resource threshold and the first sum.
[0178] In the embodiment of the present application, when the first sum is greater than the platform resource threshold, the first coefficient can be determined according to the ratio of the platform resource threshold and the first sum.
[0179] For example, the first message queue is a short 2.0 message queue, and the platform resource threshold of the short 2.0 platform is S 短 , when the first sum S 和1 Greater than S 短 , indicating that the sum of the first resource allocations allocated to each first message queue in each target region by the first allocation strategy is greater than the platform resource threshold that can be allocated by the Short Small 2.0 platform. At this time, the first coefficient k1 can be determined according to the ratio of the platform resource threshold and the first sum according to the following formula:
[0180] k1=S 短 / S 和1 ; (5)
[0181] Step S4054: for any first message queue, determine the target resource allocation amount of the first message queue according to the product of the first coefficient and the first resource allocation amount of the first message queue.
[0182] In the embodiment of the present application, for any first message queue, the target resource allocation amount of the first message queue can be determined according to the product of the first coefficient and the first resource allocation amount of the first message queue.
[0183] Still using the above example to illustrate, for any first message queue, assuming that the first resource allocation amount of the first message queue is S 第一 , the first coefficient is k1, and the target resource allocation amount S of the first message queue can be determined according to the following formula: 目 :
[0184] S 目 =S 第一 *k1; (6)
[0185] Step S4055: for any target zone, the allocatable resource amount of the target zone is re-determined according to the allocatable resource amount of the target zone and the target resource allocation amount of the first message queue in the target zone.
[0186] In the embodiment of the present application, for any target zone, the allocatable resource amount of the target zone can be re-determined according to the allocatable resource amount of the target zone and the target resource allocation amount of the first message queue in the target zone.
[0187] For example, for the target region A, assuming that the amount of resources that can be allocated to the target region is S 可分配 , the target region A includes n first message queues, and the target resource allocation amount of the i-th first message queue is S 目i , i∈[1,n] and i is a positive integer, then the allocatable resource amount S' of the target region A can be re-determined according to the following formula: 可分配 :
[0188]
[0189] Step S4056, in response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, based on the allocatable amount of resources in the re-determined target zone and the resource requirements of each target message queue in the target zone except the first message queue, a first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target zone except the first message queue.
[0190] In an embodiment of the present application, when the allocatable amount of resources in the re-determined target zone is greater than the first set threshold, the first allocation strategy can be adopted to determine the target resource allocation amount of each target message queue in the target zone except the first message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each target message queue in the target zone except the first message queue.
[0191] For example, assuming that the target message queues in the target region A, except for the first message queue a1, include target message queue a3, target message queue a5, and target message queue a6, the re-determined allocatable resource amount of the target region is S' 可分配 , first set the threshold to 0, when S' 可分配 >0, the allocatable resources in the re-determined target region can be S' 可分配 , as well as the resource requirements of the target message queue a3, the resource requirements of the target message queue a5, and the resource requirements of the target message queue a6, the first allocation strategy is adopted to determine the target resource allocation amount of the target message queue a3, the target resource allocation amount of the target message queue a5, and the target resource allocation amount of the target message queue a6 in the target region, that is, a method similar to that in step S4041 to step S4046 is adopted, based on the re-determined allocatable resource amount of the target region as S' 可分配, as well as the resource requirements of the target message queue a3, the resource requirements of the target message queue a5, and the resource requirements of the target message queue a6, determine the target resource allocation of the target message queue a3, the target resource allocation of the target message queue a5, and the target resource allocation of the target message queue a6 in the target area.
[0192] It can be understood that when the allocatable resource amount of the re-determined target large area is not greater than the first set threshold, it indicates that the resource amount of the current target large area has been allocated, and the subsequent resource allocation process can be stopped.
[0193] Step S4057: In response to the first sum being not greater than the platform resource threshold, determining the first resource allocation amount of any target message queue in the target group as the target resource allocation amount of the target message queue.
[0194] That is to say, when the first sum is not greater than the platform resource threshold, it indicates that the sum of the first resource allocation amounts allocated to the first message queues in each target area using the first allocation strategy is not greater than the platform resource threshold. At this time, the first resource allocation amount of any target message queue in the target group can be determined as the target resource allocation amount of the target message queue.
[0195] Therefore, firstly, the first allocation strategy is adopted to determine the first resource allocation amount of each target message queue in the target group. Secondly, based on the platform resource threshold and the first resource allocation amount of each target message queue in the target group, the target resource allocation amount of each target message queue can be effectively and accurately determined.
[0196] It should be noted that the present application is only described in terms of the sequential execution of steps S4053 to S4056 and step S4057. In actual applications, one of them may be selected for execution.
[0197] Step S406, when the target group includes the second message queue belonging to the trigger message channel but does not include the first message queue belonging to the mass message channel, a third allocation strategy is adopted based on the trigger resource threshold, the allocatable resource amount of each target area, and the resource demand of each target message queue in the target group to determine the target resource allocation amount of each target message queue in the target group.
[0198] In an embodiment of the present application, the trigger resource threshold may be pre-set and used to trigger the resource upper limit of the message channel. The present application does not impose any restrictions on the value of the trigger resource threshold.
[0199] In an embodiment of the present application, the target group may include a second message queue belonging to a trigger message channel, but may not include a first message queue belonging to a group message channel.
[0200] In an embodiment of the present application, when the target group includes a second message queue belonging to a trigger message channel and does not include a first message queue belonging to a mass message channel, a third allocation strategy can be adopted based on the trigger resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group to determine the target resource allocation amount of each target message queue in the target group.
[0201] As a possible implementation, when the target group includes the second message queue belonging to the trigger message channel and does not include the first message queue belonging to the group message channel, the following steps can be adopted to implement the process of determining the target resource allocation amount of each target message queue in the target group by adopting the third allocation strategy based on the trigger resource threshold, the allocatable resource amount of each target region, and the resource demand amount of each target message queue in the target group:
[0202] Step S4061, according to the allocatable resource amount of any target zone and the resource demand of each target message queue in the target zone, a first allocation strategy is adopted to determine a second resource allocation amount of each target message queue in the target zone.
[0203] In an embodiment of the present application, when the target group includes a second message queue belonging to a trigger message channel and does not include a first message queue belonging to a group message channel, for any target area, a first allocation strategy can be adopted to determine the second resource allocation amount of each target message queue in the target area based on the allocatable amount of resources in the target area and the resource demand of each target message queue in the target area.
[0204] That is to say, for any target zone, a method similar to steps S4041 to S4046 is first used to determine the second resource allocation amount of each target message queue in the target zone based on the allocatable resource amount of the target zone and the resource demand of each target message queue in the target zone.
[0205] Step S4062, summing up the second resource allocation amounts of the second message queues in each target zone to obtain a second sum.
[0206] In the embodiment of the present application, the second resource allocation amounts of the second message queues in each target zone may be summed to obtain a second sum.
[0207] Step S4063, in response to the second sum being greater than the trigger resource threshold, determining a second coefficient according to a ratio of the trigger resource threshold and the second sum.
[0208] In an embodiment of the present application, when the second sum is greater than the trigger resource threshold, the second coefficient can be determined based on the ratio of the trigger resource threshold and the second sum.
[0209] For example, the trigger resource threshold is S 触 , when the second sum S 和2 Greater than S 触 When , it indicates that the sum of the second resource allocations allocated to each second message queue in each target region by the first allocation strategy is greater than the trigger resource threshold that can be allocated by the trigger message channel. At this time, the second coefficient k2 can be determined according to the ratio of the trigger resource threshold and the second sum according to the following formula:
[0210] k2=S 触 / S 和2 ; (8)
[0211] Step S4064: for any second message queue, determine the target resource allocation amount of the second message queue according to the product of the second coefficient and the second resource allocation amount of the second message queue.
[0212] In the embodiment of the present application, for any second message queue, the target resource allocation amount of the second message queue can be determined according to the product of the second coefficient and the second resource allocation amount of the second message queue.
[0213] Still using the above example to illustrate, for any second message queue, assuming that the second resource allocation amount of the second message queue is S 第二 , the second coefficient is k2, and the target resource allocation amount S of the second message queue can be determined according to the following formula: 目 :
[0214] S 目 =S 第二 *k2; (9)
[0215] Step S4065: for any target zone, the allocatable resource amount of the target zone is re-determined according to the allocatable resource amount of the target zone and the target resource allocation amount of the second message queue in the target zone.
[0216] In the embodiment of the present application, for any target zone, the allocatable resource amount of the target zone can be re-determined according to the allocatable resource amount of the target zone and the target resource allocation amount of the second message queue in the target zone.
[0217] For example, for the target region A, assuming that the amount of resources that can be allocated to the target region is S 可分配 , the target region A includes m second message queues, where the target resource allocation amount of the i-th second message queue is S 目i , i∈[1,m] and i is a positive integer, then the allocatable resource amount S' of the target region A can be re-determined according to the following formula: 可分配 :
[0218]
[0219] Step S4066, in response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, based on the allocatable amount of resources in the re-determined target zone and the resource requirements of each target message queue in the target zone except the second message queue, a first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target zone except the second message queue.
[0220] In an embodiment of the present application, when the allocatable amount of resources in the re-determined target zone is greater than the first set threshold, the first allocation strategy can be adopted to determine the target resource allocation amount of each target message queue in the target zone except the first message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each target message queue in the target zone except the first message queue.
[0221] For example, assuming that the target message queues in the target region B, except for the second message queue, include target message queue b1, target message queue b2, and target message queue b3, the re-determined allocatable resource amount of the target region is S' 可分配 , first set the threshold to 0, when S' 可分配 >0, the allocatable resources in the re-determined target region can be S' 可分配 , and the resource requirements of the target message queue b1, the resource requirements of the target message queue b2, and the resource requirements of the target message queue b3, the first allocation strategy is adopted to determine the target resource allocation amount of the target message queue b1, the target resource allocation amount of the target message queue b2, and the target resource allocation amount of the target message queue b3 in the target region, that is, a method similar to that in step S4041 to step S4046 is adopted, based on the re-determined allocatable resource amount of the target region as S' 可分配 , as well as the resource requirements of the target message queue b1, the resource requirements of the target message queue b2, and the resource requirements of the target message queue b3, determine the target resource allocation of the target message queue b1, the target resource allocation of the target message queue b2, and the target resource allocation of the target message queue b3 in the target area.
[0222] It can be understood that when the allocatable resource amount of the re-determined target large area is not greater than the first set threshold, it indicates that the resource amount of the current target large area has been allocated, and the subsequent resource allocation process can be stopped.
[0223] Step S4067: In response to the second sum being not greater than the trigger resource threshold, determining the first resource allocation amount of any target message queue in the target group as the target resource allocation amount of the target message queue.
[0224] That is to say, when the second sum is not greater than the trigger resource threshold, it indicates that the total amount of second resource allocation allocated to the second message queues in each target area using the first allocation strategy is not greater than the trigger resource threshold. At this time, the second resource allocation amount of any target message queue in the target group can be determined as the target resource allocation amount of the target message queue.
[0225] Therefore, firstly, the first allocation strategy is adopted to determine the second resource allocation amount of each target message queue in the target group. Secondly, based on the trigger resource threshold and the second resource allocation amount of each target message queue in the target group, the target resource allocation amount of each target message queue can be effectively and accurately determined.
[0226] It should be noted that the present application is only described in terms of the sequential execution of steps S4063-S4066 and step S4067. In actual applications, one of them may be selected for execution.
[0227] It should also be noted that the present application only uses the sequential execution of step S404, step S405 and step S406 as an example. In actual applications, one of them can be executed selectively.
[0228] The message queue resource determination method of the embodiment of the present application, when the target group does not include the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel, according to the allocatable resource amount of any target region and the resource demand of each target message queue in the target region, the first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target region; when the target group includes the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel, based on the platform resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group, the second allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group; when the target group includes the second message queue belonging to the trigger message channel and does not include the first message queue belonging to the group message channel, based on the trigger resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group, the third allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group. Thus, the determination of the target resource allocation amount of each target message queue in the target group can be realized, which is flexible.
[0229] In order to clearly explain how to obtain the resource demand of the target message queue in any embodiment of the present application, the present application also proposes a message queue resource determination method.
[0230] Figure 5 It is a schematic diagram of a message queue resource determination method provided in Example 5 of the present application.
[0231] like Figure 5 As shown, based on any embodiment of the present application, the message queue resource determination method may further include the following steps:
[0232] Step S501, in response to the queue message backlog of the target message queue being 0, and the target message queue belonging to a group messaging channel, the resource demand of the target message queue is a third set threshold.
[0233] In an embodiment of the present application, a message queue may have a corresponding message backlog, which is recorded as a queue message backlog in the present application.
[0234] In an embodiment of the present application, the third set threshold may be pre-set, for example, it may be 0, 10, etc., and the present application does not impose any limitation on this.
[0235] In an embodiment of the present application, when the queue message backlog of the target message queue is 0 and the target message queue belongs to a group message channel, the resource demand of the target message queue can be the third set threshold. For example, when the queue message backlog of the target message queue a is 0 and the target message queue a belongs to a group message channel, the resource demand of the target message queue a can be 0.
[0236] Step S501: In response to the queue message backlog of the target message queue being 0, and the target message queue belonging to a trigger message channel, the resource demand of the target message queue is a fourth set threshold.
[0237] In an embodiment of the present application, the fourth set threshold may be pre-set, for example, it may be 100, 200, etc., and the present application does not impose any limitation on this.
[0238] In the embodiment of the present application, when the queue message backlog of the target message queue is 0 and the target message queue belongs to the trigger message channel, the resource demand of the target message queue can be the fourth set threshold. For example, when the queue message backlog of the target message queue b is 0 and the target message queue b belongs to the trigger message channel, the resource demand of the target message queue b can be 100.
[0239] Step S501, in response to the queue message backlog of the target message queue being not zero, determining the resource demand of the target message queue according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamic resource allocation threshold, the first set time interval and the fourth set threshold.
[0240] In an embodiment of the present application, the target message queue may have a corresponding queue resource threshold.
[0241] In order to obtain the queue resource threshold of the target message queue, in a possible implementation method of an embodiment of the present application, the set resource threshold corresponding to the target message queue can be obtained, and the minimum message processing rate of the subscription number Chatbot in processing messages in the target message queue can be obtained; from the set resource threshold and the minimum message processing rate corresponding to the target message queue, a third minimum value can be determined, and the third minimum value can be used as the queue resource threshold of the target message queue.
[0242] In the embodiment of the present application, the set resource threshold may be a pre-set maximum speed value used to characterize the message queues in each major region, and the present application does not impose any restrictions on the set resource threshold. For example, the target message queue is an MMS message queue, and the maximum speed value of the MMS message queue in each major region (recorded as the set resource threshold in the present application) is 800, that is, the set resource threshold corresponding to the MMS message queue is 800.
[0243] It should be noted that the set resource thresholds corresponding to the target message queues may be the same or different, and this application does not impose any restrictions on this.
[0244] As an example, for the target message queue a, assuming that the set resource threshold corresponding to the target message queue a is L, and the minimum message processing rate of the subscription number Chatbot in the target message queue is M, the third minimum value can be determined as min{L, M} from the set resource threshold L and the minimum message processing rate M corresponding to the target message queue a. The third minimum value min{L, M} can be used as the queue resource threshold of the target message queue a.
[0245] Therefore, by combining the minimum message processing rate of the subscription account Chatbot in the target message queue and the highest speed value of the target message queue in each region, the queue resource threshold of the target message queue is obtained.
[0246] In the embodiment of the present application, the first set time interval may be pre-set, for example, 1 minute, 10 minutes, etc., and the present application does not impose any limitation on this.
[0247] In an embodiment of the present application, when the queue message backlog of the target message queue is not 0, the resource demand of the target message queue can be determined based on the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold.
[0248] As a possible implementation method, when the queue message backlog of the target message queue is not zero, when the target message queue belongs to a group message channel, a first ratio can be determined based on the ratio of the queue message backlog of the target message queue to a first set time interval; a first maximum value can be determined from the first ratio and a fourth set threshold; a first minimum value can be determined from the first maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; the first minimum value can be used as the resource demand of the target message queue.
[0249] As an example, assume that the queue backlog of the target message queue a is Q, the first set time interval is t, the fourth set threshold is 100, and the queue resource threshold of the target message queue a is S 队 , the threshold for dynamic resource allocation is S 动 , when the queue message backlog Q of the target message queue a is not 0, when the target message queue a belongs to a group messaging channel, the first ratio can be determined as Q / t according to the ratio of the queue message backlog Q of the target message queue to the first set time interval t; from the first ratio Q / t and the fourth set threshold 100, the first maximum value is determined as max{Q / t, 100}; then, from the first maximum value max{Q / t, 100}, the queue resource threshold S of the target message queue 队 and the dynamic allocation resource threshold S 动 In the above example, the first minimum value is determined as min{max{Q / t, 100}, S 队 , S 动}; Finally, the determined first minimum value can be used as the resource requirement of the target message queue a.
[0250] As another possible implementation method, when the queue message backlog of the target message queue is not zero, when the target message queue belongs to a triggered message channel, the third coefficient can be determined according to the first set time interval; the second ratio can be determined according to the ratio of the queue message backlog of the target message queue to the third coefficient; the second maximum value can be determined from the second ratio and the fourth set threshold; the second minimum value can be determined from the second maximum value, the queue resource threshold of the target message queue and the dynamically allocated resource threshold; the second minimum value can be used as the resource demand of the target message queue.
[0251] As an example, assume that the queue backlog of the target message queue a is Q, the first set time interval is t, the fourth set threshold is 100, and the queue resource threshold of the target message queue a is S 队 , the threshold for dynamic resource allocation is S 动, when the queue message backlog Q of the target message queue a is not 0, when the target message queue a belongs to the trigger message channel, the third coefficient can be determined as (t / 2) according to the first set time interval t; the second ratio can be determined as Q / (t / 2) according to the ratio of the queue message backlog Q of the target message queue to the third coefficient (t / 2); from the second ratio Q / (t / 2) and the fourth set threshold 100, the second maximum value is determined as max{Q / (t / 2), 100}; then from the second maximum value max{Q / (t / 2), 100} and the queue resource threshold S of the target message queue, the second maximum value is determined as max{Q / (t / 2), 100}. 队 and the dynamic allocation resource threshold S 动 In the equation, the second minimum value is determined as min{max{Q / (t / 2,100},S 队 , S 动}; Finally, the determined second minimum value can be used as the resource requirement of the target message queue a.
[0252] The message queue resource determination method of the embodiment of the present application is as follows: in response to the queue message backlog of the target message queue being 0 and the target message queue belonging to the group message channel, the resource demand of the target message queue is the third set threshold; in response to the queue message backlog of the target message queue being 0 and the target message queue belonging to the trigger message channel, the resource demand of the target message queue is the fourth set threshold; in response to the queue message backlog of the target message queue being not 0, the resource demand of the target message queue is determined according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamic resource allocation threshold, the first set time interval and the fourth set threshold. Thus, the resource demand of the message queue can be effectively determined based on the queue message backlog of the message queue, the message channel to which the message queue belongs, and in combination with the queue resource threshold of the message queue and the dynamic resource allocation threshold.
[0253] In order to more clearly illustrate the above embodiments, the present application also provides an intelligent scheduling system.
[0254] Figure 6 It is a structural diagram of an intelligent scheduling system provided in Example 6 of the present application.
[0255] like Figure 6 As shown, the intelligent scheduling system 600 may include a basic configuration module 601, a monitoring module 602, a resource determination module 603 and a resource allocation module 604.
[0256] Among them, the basic configuration module 601 can be used to configure the message queue corresponding to any type of message and the queue priority of each message queue.
[0257] Optionally, the message may include but is not limited to 5G messages, short 2.0 messages, MMS messages, text messages, etc., and this application does not impose any restrictions on this.
[0258] In some embodiments, the basic configuration module 601 may also be used to configure the initial rate of each message queue.
[0259] The monitoring module 602 may be used to monitor the queue message backlog of each message queue and the real-time rate of each message queue.
[0260] The resource determination module 603 is connected to the monitoring module 602 and can be used to adopt the message queue resource determination method of any of the aforementioned embodiments of the present application to determine the target resource allocation amounts corresponding to multiple message queues.
[0261] The resource allocation module 604 is connected to the resource determination module 603 and can be used to allocate resource to the message queue according to the target resource allocation amount of any message queue.
[0262] To facilitate understanding of the intelligent scheduling system of the present application, a detailed description is given below with reference to examples.
[0263] As an example, the intelligent scheduling system of the present application is applied to Figure 7 The message queue intelligent scheduling system shown is used as an example, wherein: Figure 7 The message queue intelligent scheduling system shown is a multi-priority, multi-channel, composite type message queue intelligent scheduling system driven by the Fair algorithm. Figure 7 As shown, the message queue intelligent scheduling system may include a basic configuration module (recorded as a basic configuration module in this application), a message queue real-time monitoring module (recorded as a monitoring module in this application), a resource demand calculation module (recorded as a resource determination module in this application) and a message queue resource allocation module (recorded as a resource allocation module in this application);
[0264] Among them, the basic configuration module can be used to configure the fallback direction of all subscription number Chatbots and the belonging message queues when all subscription number Chatbots send different types of messages; among them, the messages can include 5G messages, short 2.0 messages, MMS messages and text messages, etc., and the corresponding queue priority and initial rate can be configured for each message queue.
[0265] The message queue real-time monitoring module is used to monitor the queue message backlog of all message queues and the real-time rate of each message queue.
[0266] The resource demand calculation module can use the event information returned by the message queue real-time monitoring module as an input parameter, perform Fair operations on each queue priority according to the type of message channel (such as mass message channel, trigger message channel), queue priority of the message queue, and the allocatable resources of each region, and iterate and calculate the target resource allocation required for each message queue in real time.
[0267] The message queue resource allocation module can allocate and send speed distribution resources to the corresponding message queue in real time according to the results obtained by the resource demand calculation module, thereby realizing intelligent scheduling of the message queue.
[0268] The message queue intelligent scheduling system may include at least the following advantages:
[0269] 1. Flexible message scheduling based on the priorities of different message types, message channels and message queues;
[0270] 2. The fair scheduling strategy based on the Fair algorithm can ensure fair use of speed resources;
[0271] 3. It can improve the system's message transmission efficiency and resource utilization, thereby improving the overall system performance.
[0272] Among them, the resource demand calculation module implements a dynamic speed matching method (referred to as a message queue resource determination method in this application). Figure 8 The following is a flow chart of the dynamic speed matching method implemented by the resource demand calculation module provided in this application. Figure 8 As shown, the dynamic pace method may include the following processes:
[0273] It should be noted that the dynamic pace switch, dynamic pace timer and do not disturb time timer can be pre-configured; wherein the dynamic pace timer is configured with a dynamic pace time interval t, so as to execute dynamic pace within the set duration; wherein the do not disturb time timer can be used to set the do not disturb time period (for example, 0:00-6:00).
[0274] 1.1 In response to the dynamic speed matching switch being turned on, it can be determined whether the current moment belongs to the do not disturb time period according to the on / off status of the do not disturb time timer; if the current moment belongs to the do not disturb time period, the manual speed matching table is synchronized to the access layer to change the message queue speed; if the current moment does not belong to the do not disturb time period, the subsequent dynamic speed matching process is continued.
[0275] It should be noted that when the dynamic speed matching switch is turned off, the manual speed matching table can be synchronized to the access layer to change the message queue speed matching; among them, all message queue speed matchings are synchronized to the access layer, and the access layer can modify the speed matching value of the corresponding message queue. There is a delay from the successful synchronization of the manual speed matching table to the access layer to the successful change of the message queue speed matching value at the access layer.
[0276] 1.2 In response to the current moment not belonging to the do not disturb time period, the dynamic pacing timer is started, and it can be determined whether the current moment still belongs to the previous round of dynamic pacing process. If the current moment still belongs to the previous round of dynamic pacing process, it ends and skips the current round of dynamic pacing process; if the current moment does not belong to the previous round of dynamic pacing process, the current round of dynamic pacing process continues.
[0277] 1.3 Query the speed resource parameters
[0278] Among them, the speed resource parameters include the regional performance upper limit of each major region (recorded as the total amount of regional resources in this application), the allocated resource amount of each message queue in the interactive message channel in each major region, the queue backlog of each message queue, the maximum upper limit of dynamic speed matching (recorded as the dynamic allocation resource threshold in this application), the maximum limit of queue speed matching of each message queue (recorded as the queue resource threshold in this application), the dynamic speed matching time interval t (recorded as the first set time interval in this application), the short 2.0 platform upper limit (recorded as the platform resource threshold in this application), and the trigger resource upper limit (recorded as the trigger resource threshold in this application); wherein, the dynamic speed matching time interval t can be manually configured; the maximum limit of queue speed matching is the minimum value of the minimum rate of the subscription number Chatbot in the corresponding message queue (recorded as the minimum message processing rate in this application) and the corresponding set resource threshold. For example, when the message queue is a color enhancement queue (recorded as a MMS message queue in this application), the maximum limit of queue speed matching is min{minimum rate of the subscription number Chatbot in the queue, 800}, wherein 800 is the set resource threshold of the color enhancement queue.
[0279] 1.4 Execute multiple rounds of pace resource allocation process
[0280] The queue priorities of multiple message queues belonging to the mass messaging channel and the trigger message channel are obtained. According to the queue priorities, resources are allocated to the high-priority message queues first. After the high-priority message queues are satisfied, the remaining resources are allocated to other priority queues in turn. That is, according to the queue priorities, multiple rounds of speed-pacing resource allocation processes are performed from high priority to low priority, wherein each round of speed-pacing resource allocation process has a corresponding queue priority, and each round of speed-pacing resource allocation process has a corresponding target message queue to which resources need to be allocated; in each round of speed-pacing resource allocation process, the target resource allocation amount of each target message queue corresponding to the queue priority can be determined.
[0281] The calculation algorithm input parameters of the resource demand calculation module may include the following aspects:
[0282] First, calculate the resource requirements D of each message queue:
[0283] (1) When the queue backlog of a message queue is 0 and the message queue belongs to a group message channel, the resource demand D of the message queue is 0; when the queue backlog of a message queue is 0 and the message queue belongs to a trigger message channel, the resource demand D of the message queue is 100;
[0284] (2) The queue backlog is not 0:
[0285] When the message queue belongs to a group messaging channel, the resource requirement D of the message queue is:
[0286] D = min{max{queue backlog / t, 100}, dynamic speed upper limit, queue speed upper limit};
[0287] When a message queue belongs to a trigger message channel, the resource requirement D of the message queue is:
[0288] D=min{max{queue backlog / (t / 2), 100}, upper limit of dynamic speed pacing, upper limit of queue speed pacing}.
[0289] Second, in any round of speed resource allocation, the amount of allocatable resources in the target region corresponding to the target message queue in this round can be calculated:
[0290] In the first round of speed resource allocation, the amount of resources available for allocation in each target area in this round S 可分配 for:
[0291] S 可分配 =S 上 -S 已分配 ; (11)
[0292] S 已分配 =∑S 交 ; (12)
[0293] Among them, S 上 is the upper limit of the target region’s regional performance, S 交 The amount of resources allocated to the message queue in the interactive message channel in the target zone.
[0294] In any subsequent round of speed resource allocation, the amount of resources available for allocation in each target area in this round S 可分配 for:
[0295] S 可分配 =S 上 -S已分配 -100(m1+m2); (13)
[0296] S 已分配 =∑S 交 +∑X 目 ; (14)
[0297] Among them, S 上 is the upper limit of the target region’s regional performance, S 交 is the amount of allocated resources of the message queues in the interactive message channel in the target region, X is the target resource allocation amount of each target message queue in the target region in the executed speed resource allocation process; m1 is the number of message queues belonging to the trigger message channel in the unexecuted speed resource allocation process (i.e., the remaining priority), and m2 is the number of message queues belonging to the group message channel and with non-zero resource demand in the unexecuted speed resource allocation process.
[0298] It should be noted that, in order to reduce the complexity of the algorithm, the inventor makes the queue priority of any message queue belonging to the trigger message channel (recorded as the second message queue in this application) and the queue priority of the short 2.0 queue belonging to the group message channel (recorded as the first message queue in this application) different, that is, in any round of speed resource allocation process, it is impossible for the message queue belonging to the trigger message channel and the short 2.0 queue belonging to the group message channel to exist at the same time in each target message queue corresponding to this round of speed resource allocation process.
[0299] For example, the message queues belonging to the trigger message channel include the ordinary interactive message queues; the message queues belonging to the group message channel include the short 2.0 queues, the ordinary interactive message queues, and the MMS message queues. In any round of speed resource allocation, it is impossible for the ordinary interactive message queues belonging to the trigger message channel and the short 2.0 queues belonging to the group message channel to exist in each target message queue corresponding to this round of speed resource allocation process at the same time. However, there may be ordinary interactive message queues belonging to the trigger message channel and ordinary interactive message queues and MMS message queues belonging to the group message channel.
[0300] 1.4.1 For any round of speed resource allocation process, determine the target region corresponding to each target message queue corresponding to the current round of speed resource allocation process, i.e., the current round of queue priority; use the above calculation method to obtain the allocatable resource amount of each target region;
[0301] 1.4.2 When the target message queues corresponding to the current round of speed resource allocation process do not include the short 2.0 queue belonging to the group message channel and the message queue belonging to the trigger message channel, the first Fair algorithm can be used to determine the target resource allocation amount of each target message queue in this round based on the resource demand D of each target message queue in this round and the allocatable resource amount of each target region in this round;
[0302] Specifically:
[0303] 1.4.2.1 For any target region, according to the amount of resources available for allocation S in the target region 可分配 and the first number n of the target message queue in the target region to determine the average resource allocation of the target region for:
[0304]
[0305] 1.4.2.2 Compare the resource allocation amount D of each target message queue with the average resource allocation amount X in turn:
[0306] If all message queues in the target region meet That is, the needs of all target message queues cannot be met and there are no extra resources to share. Then the target resource allocation of all target message queues is The algorithm ends;
[0307] If all message queues in the target region meet That is, the needs of all target message queues can be met without sharing resources. Then, the target resource allocation of all target message queues is set to their corresponding resource demand D, and the algorithm ends.
[0308] If there are some target message queues that satisfy And there are other target message queues This means that some target message queues have more resources available for allocation than meeting their own needs, and some target message queues have less resources available for allocation than meeting their own needs. The excess resources of the target message queue are shared with The target message queue;
[0309] Specifically, to meet The target message queues are referred to as the third message queues in this application, and the target resource allocation amounts of these target message queues are equal to their corresponding resource requirements; according to the allocatable resource amount S of the target region 可分配 and satisfy The target resource allocation amount of each target message queue is re-determined to determine the allocatable resource amount of the target region, that is, the allocatable resource amount of the target region can be re-determined according to the following formula:
[0310] S' 可分配 =S 可分配 -∑S 目 ; (16)
[0311] Among them, S' 可分配 S is the amount of allocatable resources in the re-determined target region. 目 To meet the target area The target resource allocation amount of the target message queue;
[0312] For this target area Each target message queue, recorded as the fourth message queue in this application, is based on the re-determined allocatable resource amount of the target region and The resource demand of the target message queue is determined, and the first Fair algorithm is used again, that is, a method similar to 1.4.2.1-1.4.2.2 is used to reallocate resources.
[0313] 1.4.3 When the target message queues corresponding to the current round of speed resource allocation process include the short 2.0 queue belonging to the group message channel but do not include the message queue belonging to the trigger message channel, the target resource allocation amount of each target message queue in this round can be determined by using the second Fair algorithm based on the resource demand D of each target message queue in this round and the allocatable resource amount of each target region in this round;
[0314] Specifically:
[0315] 1.4.3.1 For any target region, according to the amount of resources available for allocation S in the target region 可分配 and the resource demand D of each target message queue in the target region, first use the first Fair algorithm to determine the first resource allocation amount of each target message queue in this round;
[0316] 1.4.3.2 Determine the first sum according to the sum of the first resource allocation amounts of each short 2.0 queue in each target message queue in this round;
[0317] 1.4.3.3 Determine whether the first sum is greater than the upper limit of the short 2.0 platform. When the first sum is not greater than the upper limit of the short 2.0 platform, determine the target resource allocation amount of any target message queue in this round as the corresponding first resource allocation amount;
[0318] 1.4.3.4 When the first sum is greater than the upper limit of the short 2.0 platform, the first coefficient is determined according to the ratio of the upper limit of the short 2.0 platform and the first sum; for any short 2.0 queue, the product of the first coefficient and the first resource allocation amount of the short 2.0 queue is determined as the target resource allocation amount of the short 2.0 queue;
[0319] 1.4.3.5 For the message queues that are not short 2.0 queues in each target message queue in this round:
[0320] For any target region, the allocatable resource amount of the target region is redetermined according to the allocatable resource amount of the target region and the target resource allocation amount of the short 2.0 queues in the target region; based on the redetermined allocatable resource amount of the target region and the resource demand of each message queue that is not a short 2.0 queue in each target message queue in this round, the first Fair algorithm is used again, that is, a method similar to 1.4.2.1-1.4.2.2 is used to reallocate resources.
[0321] 1.4.4 When the target message queues corresponding to the current round of speed resource allocation process do not include the short 2.0 queue belonging to the group message channel but include the message queue belonging to the trigger message channel, the target resource allocation amount of each target message queue in this round can be determined by using the third Fair algorithm based on the resource demand D of each target message queue in this round and the allocatable resource amount of each target region in this round;
[0322] Specifically:
[0323] 1.4.4.1 For any target region, according to the amount of resources available for allocation S in the target region 可分配 and the resource demand D of each target message queue in the target region, first use the first Fair algorithm to determine the second resource allocation amount of each target message queue in this round;
[0324] 1.4.4.2 determining a second sum number according to the sum of the second resource allocation amounts of each message queue belonging to the triggering message channel in each target message queue in this round;
[0325] 1.4.4.3 Determine whether the second sum is greater than the trigger resource upper limit. When the second sum is not greater than the trigger resource upper limit, determine the target resource allocation amount of any target message queue in this round as the corresponding second resource allocation amount;
[0326] 1.4.4.4 When the second sum is greater than the trigger resource upper limit, determine the second coefficient according to the ratio of the trigger resource upper limit to the second sum; for any message queue belonging to the trigger message channel in each target message pair of this round, multiply the second coefficient by the second resource allocation amount of the message queue to determine the target resource allocation amount of the message queue;
[0327] 1.4.3.4 For the message queues that do not belong to the triggering message channel in each target message pair of this round:
[0328] For any target region, the allocatable resource amount of the target region is redetermined according to the allocatable resource amount of the target region and the target resource allocation amount of each message queue belonging to the trigger message channel in the target region; based on the redetermined allocatable resource amount of the target region and the resource demand of the message queues that do not belong to the trigger message channel in each target message pair in this round, the first Fair algorithm is used again, that is, a method similar to 1.4.2.1-1.4.2.2 is used to reallocate resources.
[0329] For example, suppose that in a round of speed resource allocation, the target regions of this round include region A and region B, the target message queues in region A include queue a1 belonging to the trigger message channel and queue a2 belonging to the trigger message channel, the target message queues in region B include queue b1 belonging to the trigger message channel and queue b2 belonging to the group message channel (wherein queue b2 is not a short 2.0 queue), the allocatable resource amount of region A is 20, and the allocatable resource amount of region B is 25; the resource demand of queue a1 is 5, the resource demand of queue a2 is 10, the resource demand of queue b1 is 5, the resource demand of queue b2 is 30, and the trigger resource upper limit is 10;
[0330] First, according to the allocatable resources of each target region and the resource requirements of each target message queue, the first Fair algorithm is used to determine the second resource allocation of each target message queue in this round: the second resource allocation of queue a1 is 5, the second resource allocation of queue a2 is 10, the second resource allocation of queue b1 is 5, and the second resource allocation of queue b2 is 20;
[0331] Since queue a1, queue a2, and queue b1 all belong to the trigger message channel, the sum of the second resource allocation amount of queue a1, the second resource allocation amount of queue a2, and the second resource allocation amount of queue b1 is the second sum 20, and the second sum 20 is greater than the trigger resource upper limit of 10. Therefore, according to the ratio of the trigger resource upper limit 10 to the second sum 20, the second coefficient is determined to be 1 / 2 (=10 / 20); for any message queue belonging to the trigger message channel in each target message pair of this round, the product of the second coefficient and the second resource allocation amount of the message queue is determined as the target resource allocation amount of the message queue, that is, the target resource allocation amount of queue a1 is 2.5, and the target resource allocation amount of queue b1 is 2.5. The target resource allocation amount of queue a2 is 5, and the target resource allocation amount of queue b1 is 2.5; at this time, the corresponding target resource allocation amounts of the two target message queues in region A have been determined, and the corresponding target resource allocation amount of queue b2 in region B that does not belong to the trigger message channel has not been determined; and for queue b2 that does not belong to the trigger message channel in each target message pair in this round, the allocatable resource amount of region B is first redetermined, that is, the allocatable resource amount of the region is redetermined to be 22.5 (=25-2.5), and according to the allocatable resource amount of the region and the resource demand of queue b2, the first Fair algorithm is adopted to determine the target resource allocation amount of queue b2 to be 22.5.
[0332] In summary, the advantages of the message queue intelligent scheduling system include at least the following aspects:
[0333] 1. This system can support dynamic allocation of speed resources of different message queues according to the real-time system resource status, which can optimize resource utilization and improve system processing performance.
[0334] 2. This system can first configure different queue priorities for all message queues, and then adjust the resource allocation priority of the message queue according to the priority of the message queue.
[0335] 3. This system can dynamically adjust the pacing method according to different types of messages. Since different types of messages have different business characteristics, personalized scheduling and allocation can be performed according to the business characteristics, so that configuration and adjustment can be achieved according to business needs and system resource conditions.
[0336] 4. The system can also dynamically adjust resource allocation according to messages of different message channel types. For trigger messages and interactive messages with high message immediacy requirements, the system can dynamically adjust and allocate more resources to high-immediacy message channels even when the queue priorities are the same.
[0337] Compared with related technologies, the message queue intelligent scheduling system of this application has the following advantages:
[0338] First of all, the application covers a wider range of uses. The message queue intelligent scheduling system described in this application can be applied to more scenarios, including but not limited to fields that require large-scale message delivery, such as telecommunications operators, logistics companies, and financial institutions; at the same time, the message queue intelligent scheduling system described in this application can support different types of messages, such as 5G messages, short 2.0 messages, video MMS messages, and text messages, etc., making it more flexible and diversified.
[0339] Secondly, the present application can support multi-dimensional message scheduling. The message queue intelligent scheduling system described in the present application can not only schedule according to the priority of the message, but also allocate resources according to the composite type of the message and the characteristics of the multi-channel message. For example, for messages with low immediacy requirements, they can be assigned to the group message channel; for messages with high immediacy requirements, they can be assigned to the trigger message channel; for messages that communicate with users, they can be assigned to the interactive message channel. At the same time, the system supports mapping the queue priorities of different message types, message channels, and message queues to the corresponding sending rates, that is, the speed matching resources, according to the pre-configured queue priorities, so that messages of different priorities can be sent at a predetermined rate.
[0340] Finally, this application adopts a fair scheduling strategy. The message queue intelligent scheduling system described in this application adopts a fair scheduling strategy based on the Fair algorithm, so that the speed distribution resources are effectively and fairly utilized; and the use of the Fair algorithm can also improve the system's message transmission efficiency and resource utilization, thereby improving the overall performance of the system.
[0341] In summary, the message queue intelligent scheduling system described in this application can perform multi-dimensional message scheduling, has a fair scheduling strategy, and has strong adaptability.
[0342] With the above Figures 1 to 5 Corresponding to the message queue resource determination method provided in the embodiment, the present application also provides a message queue resource determination device. Since the message queue resource determination method device provided in the embodiment of the present application is consistent with the above Figures 1 to 5 The message queue resource determination method provided in the embodiment corresponds to the message queue resource determination method, so the implementation method of the message queue resource determination method is also applicable to the message queue resource determination device provided in the embodiment of the present application, and will not be described in detail in the embodiment of the present application.
[0343] Fig. 9 It is a structural diagram of a message queue resource determination device provided in Example 7 of the present application.
[0344] Reference Fig. 9 The message queue resource determination device 900 may include: a first acquisition module 901, a grouping module 902 and a first determination module 903.
[0345] The first acquisition module 901 is used to acquire queue priorities of multiple message queues.
[0346] The grouping module 902 is used to group the message queues according to the queue priorities of the message queues to obtain at least one group; wherein any group has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority.
[0347] The first determination module 903 is used to determine the target resource allocation amount of each target message queue based on the resource demand of each target message queue in the corresponding group according to the queue priority corresponding to each group.
[0348] In a possible implementation of an embodiment of the present application, the first determination module 903 is used to: sort each group in order of queue priority from high priority to low priority to obtain a sorting sequence; based on the sorting sequence, for the polled target group, according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel, a corresponding allocation strategy is used to allocate the pacing resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand.
[0349] In a possible implementation of an embodiment of the present application, a first determination module 903 is used to: determine a target region corresponding to each target message queue in a polled target group; wherein the target region includes a trigger message channel and / or a group message channel; obtain the amount of allocatable resources in any target region; when the amount of allocatable resources is greater than a first set threshold, for the polled target group, determine a corresponding allocation strategy based on whether the message channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel; and determine a target resource allocation amount for each target message queue in the target group using an allocation strategy based on the resource demand of each target message queue in the target group.
[0350] In a possible implementation of an embodiment of the present application, the target group does not include a first message queue belonging to a group message channel and does not include a second message queue belonging to a trigger message channel; the first determination module 903 is used to: determine the target resource allocation amount of each target message queue in the target area by adopting a first allocation strategy based on the allocatable resource amount of any target area and the resource demand of each target message queue in the target area.
[0351] In a possible implementation of the embodiment of the present application, the first determination module 903 is used to: for any target region, determine the average resource allocation amount of the target region according to the allocatable resource amount of the target region and the first number of the target message queues in the target region; in response to the resource demand of each target message queue in the target region not being greater than the average resource allocation amount of the target region, determine the resource demand of any target message queue in the target region as the target resource allocation amount of the target message queue; in response to the resource demand of each target message queue in the target region not being less than the average resource allocation amount of the target region, determine the average resource allocation amount of the target region as the target resource allocation amount of the target message queue in the target region; in response to the resource demand of each target message queue in the target region There are a third message queue and a fourth message queue in the target message queue, and the resource demand of any third message queue is determined as the target resource allocation of the third message queue; wherein the resource demand of the third message queue is not greater than the average resource allocation of the target area, and the resource demand of the fourth message queue is greater than the average resource allocation of the target area; according to the allocatable resources of the target area and the target resource allocation of each third message queue, the allocatable resources of the target area are redetermined; in response to the allocatable resources of the redetermined target area being greater than a first set threshold, according to the allocatable resources of the redetermined target area and the resource demand of each fourth message queue, the first allocation strategy is adopted to determine the target resource allocation of each fourth message queue.
[0352] In a possible implementation of an embodiment of the present application, the target group includes a first message queue belonging to a mass message channel and does not include a second message queue belonging to a trigger message channel; the first determination module 903 is used to: based on the platform resource threshold, the allocatable resource amount of each target area, and the resource demand of each target message queue in the target group, adopt a second allocation strategy to determine the target resource allocation amount of each target message queue in the target group.
[0353] In a possible implementation of the embodiment of the present application, the first determination module 903 is used to: determine the first resource allocation amount of each target message queue in the target region by adopting a first allocation strategy according to the allocatable resource amount of any target region and the resource demand amount of each target message queue in the target region; sum the first resource allocation amounts of the first message queues in each target region to obtain a first sum; in response to the first sum being greater than the platform resource threshold, determine a first coefficient according to the proportion of the platform resource threshold and the first sum; for any first message queue, determine the target resource allocation amount of the first message queue according to the product of the first coefficient and the first resource allocation amount of the first message queue; for any target region, re-determine the allocatable resource amount of the target region according to the allocatable resource amount of the target region and the target resource allocation amount of the first message queue in the target region; in response to the allocatable resource amount of the re-determined target region being greater than the first set threshold, determine the target resource allocation amount of each target message queue in the target region except the first message queue by adopting the first allocation strategy.
[0354] In a possible implementation of the embodiment of the present application, the message queue resource determination device 900 may include:
[0355] The second determining device, Yuou, is capable of determining the first resource allocation amount of any target message queue in the target group as the target resource allocation amount of the target message queue in response to the first sum being not greater than the platform resource threshold.
[0356] In a possible implementation of an embodiment of the present application, the target group includes a second message queue belonging to a trigger message channel and does not include a first message queue belonging to a group message channel; the first determination module 903 is used to: based on the trigger resource threshold, the amount of allocatable resources of each target area, and the resource demand of each target message queue in the target group, adopt a third allocation strategy to determine the target resource allocation amount of each target message queue in the target group.
[0357] In a possible implementation of the embodiment of the present application, the first determination module 903 is used to: determine the second resource allocation amount of each target message queue in the target area by adopting the first allocation strategy according to the allocatable resource amount of any target area and the resource demand amount of each target message queue in the target area; add the second resource allocation amounts of the second message queues in each target area to obtain a second sum; in response to the second sum being greater than the trigger resource threshold, determine the second coefficient according to the ratio of the trigger resource threshold and the second sum; for any second message queue, determine the target resource allocation amount of the second message queue according to the product of the second coefficient and the second resource allocation amount of the second message queue; for any target area, re-determine the allocatable resource amount of the target area according to the allocatable resource amount of the target area and the target resource allocation amount of the second message queue in the target area; in response to the allocatable resource amount of the re-determined target area being greater than the first set threshold, determine the target resource allocation amount of each target message queue in the target area except the second message queue according to the re-determined allocatable resource amount of the target area and the resource demand amount of each target message queue in the target area except the second message queue, using the first allocation strategy.
[0358] In a possible implementation of the embodiment of the present application, the message queue resource determination device 900 may include:
[0359] The third determining module is configured to determine, in response to the second sum being not greater than the trigger resource threshold, the first resource allocation amount of any target message queue in the target group as the target resource allocation amount of the target message queue.
[0360] In a possible implementation of an embodiment of the present application, the first determination module 903 is used to: determine, for any target region, the second number of the fifth message queue in the target region in the group that has not been polled and the third number of the sixth message queue; wherein the fifth message queue belongs to a group message channel, and the resource demand of the fifth message queue is not the second set threshold; the sixth message queue belongs to a trigger message channel; determine the target allocated resource amount of the target region according to the target resource allocation amount of each target message queue in the target region in the group that has been polled; determine the allocatable resource amount of the target region based on the total target resource amount of the target region, the target allocated resource amount of the target region, the second number and the third number.
[0361] In a possible implementation of the embodiment of the present application, the message queue resource determination device 900 may include:
[0362] The second acquisition module is used to add up the allocated resource amounts of each message queue in the interactive message channel in the target region to obtain the total interactive resource amount of the target region; and determine the target resource amount of the target region according to the total regional resource amount of the target region and the total interactive resource amount of the target region.
[0363] In a possible implementation of the embodiment of the present application, the message queue resource determination device 900 may include:
[0364] The third acquisition module is used to:
[0365] In response to a queue message backlog of the target message queue being 0, and the target message queue belonging to a group message channel, the resource demand of the target message queue being a third set threshold;
[0366] or,
[0367] In response to a queue message backlog of the target message queue being 0, and the target message queue belonging to a trigger message channel, the resource demand of the target message queue being a fourth set threshold;
[0368] or,
[0369] In response to the queue message backlog of the target message queue being not zero, the resource demand of the target message queue is determined according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamic resource allocation threshold, the first set time interval and the fourth set threshold.
[0370] In a possible implementation of an embodiment of the present application, a second acquisition module is used to: in response to the target message queue belonging to a group message channel, determine a first ratio based on the ratio of the queue message backlog of the target message queue to the first set time interval; determine a first maximum value from the first ratio and a fourth set threshold; determine a first minimum value from the first maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; and use the first minimum value as the resource demand of the target message queue.
[0371] In a possible implementation of an embodiment of the present application, a second acquisition module is used to: determine a third coefficient according to a first set time interval in response to the target message queue belonging to a trigger message channel; determine a second ratio according to the ratio of the queue message backlog of the target message queue to the third coefficient; determine a second maximum value from the second ratio and a fourth set threshold; determine a second minimum value from the second maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; and use the second minimum value as the resource demand of the target message queue.
[0372] In a possible implementation of the embodiment of the present application, the message queue resource determination device 900 may include:
[0373] The fourth acquisition module is used to obtain the set resource threshold corresponding to the target message queue, and obtain the minimum message processing rate of the subscription number Chatbot to process messages in the target message queue; determine the third minimum value from the set resource threshold and the minimum message processing rate corresponding to the target message queue; and use the third minimum value as the queue resource threshold of the target message queue.
[0374] The message queue resource determination device of the embodiment of the present application obtains the queue priorities of multiple message queues; groups each message queue according to the queue priority of each message queue to obtain at least one group; wherein any group has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority; and determines the target resource allocation amount of each target message queue based on the resource demand of each target message queue in the corresponding group according to the queue priority corresponding to each group. Thus, the automatic determination of the target resource allocation amount of message queues with different queue priorities can be realized based on the queue priority of the message queue, which can effectively improve the efficiency of message processing.
[0375] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0376] Based on the embodiments of the present application, the present application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message queue resource determination method of any of the aforementioned embodiments.
[0377] Based on the embodiments of the present application, the present application also provides a computer-readable storage medium, wherein computer instructions are used to enable a computer to execute the message queue resource determination method of any of the foregoing embodiments provided according to the embodiments of the present application.
[0378] See also Fig.10 ,like Fig.10 , is a schematic block diagram of an example electronic device that can be used to implement an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0379] like Fig.10As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 to a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0380] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0381] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as the message queue resource determination method. For example, in some embodiments, the message queue resource determination method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the message queue resource determination method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the message queue resource determination method in any other appropriate manner (eg, by means of firmware).
[0382] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0383] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0384] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0385] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0386] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN), the Internet, and blockchain networks.
[0387] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS (Virtual Private Server) services. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0388] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the present application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of the present application can be achieved, and this document does not limit this.
[0389] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for determining message queue resources, characterized in that: The method comprises: Get the queue priorities of multiple message queues; Grouping each of the message queues according to the queue priority of each of the message queues to obtain at least one group; wherein any of the groups has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority; According to the queue priority corresponding to each of the groups, the target resource allocation amount of each of the target message queues is determined based on the resource demand of each of the target message queues in the corresponding group for each of the grouping orders; The step of determining the target resource allocation amount of each target message queue based on the queue priority corresponding to each group and the resource demand amount of each target message queue in the corresponding group for each group order includes: Sorting the packets according to the queue priority order from high priority to low priority to obtain a sorted sequence; According to the sorting sequence, for the polled target group, according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel, a corresponding allocation strategy is adopted to allocate the speed resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand amount; The polled target group allocates the speed resources using a corresponding allocation strategy according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel, so as to determine the target resource allocation amount of each target message queue according to the resource demand, including: Determine a target region corresponding to each target message queue in the polled target group; wherein the target region includes the trigger message channel and / or the group message channel; Obtaining the amount of allocatable resources in any of the target regions; In the case where the amount of allocatable resources is greater than the first set threshold, for the polled target group, determining a corresponding allocation strategy according to whether the message channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel; According to the resource demand of each of the target message queues in the target group, the allocation strategy is adopted to determine the target resource allocation amount of each of the target message queues in the target group.
2. The method according to claim 1, characterized in that The target group does not include the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel; The step of determining the target resource allocation amount of each target message queue by using the allocation strategy according to the resource demand amount of each target message queue in the target group includes: According to the allocatable resource amount of any of the target large areas and the resource demand amount of each target message queue in the target large area, a first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target large area.
3. The method according to claim 2, characterized in that The method of adopting a first allocation strategy to determine a target resource allocation amount for each target message queue in the target region according to the allocatable resource amount of any target region and the resource demand amount of each target message queue in the target region comprises: For any of the target large areas, determining the average resource allocation amount of the target large area according to the allocatable resource amount of the target large area and the first number of the target message queue in the target large area; In response to the resource demand of each of the target message queues in the target large area not being greater than the average resource allocation of the target large area, determining the resource demand of any of the target message queues in the target large area as the target resource allocation of the target message queue; In response to the resource demand of each of the target message queues in the target large area being not less than the average resource allocation of the target large area, determining the average resource allocation of the target large area as the target resource allocation of the target message queues in the target large area; In response to the presence of a third message queue and a fourth message queue in each of the target message queues in the target region, determining a resource demand of any of the third message queues as a target resource allocation of the third message queue; wherein the resource demand of the third message queue is not greater than the average resource allocation of the target region, and the resource demand of the fourth message queue is greater than the average resource allocation of the target region; re-determining the allocatable amount of resources of the target large area according to the allocatable amount of resources of the target large area and the target resource allocation amount of each of the third message queues; In response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the first allocation strategy is adopted to determine the target resource allocation amount of each of the fourth message queues based on the allocatable amount of resources in the re-determined target zone and the resource demand of each of the fourth message queues.
4. The method according to claim 1, characterized in that: The target group includes a first message queue belonging to the group message channel and does not include a second message queue belonging to the trigger message channel; The step of determining the target resource allocation amount of each target message queue by using the allocation strategy according to the resource demand amount of each target message queue in the target group includes: Based on the platform resource threshold, the allocatable resource amount of each target zone, and the resource demand of each target message queue in the target group, a second allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group.
5. The method according to claim 4, characterized in that The method of using a second allocation strategy based on the platform resource threshold, the allocatable resource amount of each target region, and the resource demand of each target message queue in the target group to determine the target resource allocation amount of each target message queue in the target group includes: According to the allocatable resource amount of any of the target large areas and the resource demand amount of each of the target message queues in the target large area, a first allocation strategy is adopted to determine a first resource allocation amount of each of the target message queues in the target large area; Adding the first resource allocation amounts of the first message queues in each of the target regions to obtain a first sum; In response to the first sum being greater than the platform resource threshold, determining a first coefficient according to a ratio of the platform resource threshold and the first sum; For any of the first message queues, determining a target resource allocation amount of the first message queue according to a product of the first coefficient and a first resource allocation amount of the first message queue; For any of the target large areas, re-determine the allocatable resource amount of the target large area according to the allocatable resource amount of the target large area and the target resource allocation amount of the first message queue in the target large area; In response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target zone except the first message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each target message queue in the target zone except the first message queue.
6. The method according to claim 5, characterized in that The method further comprises: In response to the first sum being not greater than the platform resource threshold, a first resource allocation amount of any target message queue in the target group is determined as a target resource allocation amount of the target message queue.
7. The method according to claim 1, characterized in that The target group includes the second message queue belonging to the trigger message channel and does not include the first message queue belonging to the group message channel; The step of determining the target resource allocation amount of each target message queue by using the allocation strategy according to the resource demand amount of each target message queue in the target group includes: Based on the trigger resource threshold, the allocatable resource amount of each target zone, and the resource demand of each target message queue in the target group, a third allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group.
8. The method according to claim 7, characterized in that The method of using a third allocation strategy based on a trigger resource threshold, an allocatable amount of resources in each of the target regions, and a resource demand of each of the target message queues in the target group to determine a target resource allocation amount for each of the target message queues in the target group includes: According to the allocatable resource amount of any of the target large areas and the resource demand amount of each of the target message queues in the target large area, a first allocation strategy is adopted to determine the second resource allocation amount of each of the target message queues in the target large area; Adding the second resource allocation amounts of the second message queues in each of the target regions to obtain a second sum; In response to the second sum being greater than the trigger resource threshold, determining a second coefficient according to a ratio of the trigger resource threshold and the second sum; For any of the second message queues, determining a target resource allocation amount of the second message queue according to a product of the second coefficient and the second resource allocation amount of the second message queue; For any of the target large areas, re-determine the allocatable resource amount of the target large area according to the allocatable resource amount of the target large area and the target resource allocation amount of the second message queue in the target large area; In response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target zone except the second message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each target message queue in the target zone except the second message queue.
9. The method according to claim 8, characterized in that The method further comprises: In response to the second sum being not greater than the trigger resource threshold, the first resource allocation amount of any one of the target message queues in the target group is determined as the target resource allocation amount of the target message queue.
10. The method according to claim 1, characterized in that The obtaining of the allocatable resource amount of any target region includes: For any of the target regions, determine the second number of the fifth message queue and the third number of the sixth message queue in the target region in the group that has not been polled; wherein the fifth message queue belongs to the group messaging channel, and the resource demand of the fifth message queue is not the second set threshold; the sixth message queue belongs to the trigger message channel; Determine the target allocated resource amount of the target large area according to the target resource allocation amount of each target message queue in the target large area in the group that has been polled; The allocatable amount of resources for the target large zone is determined based on the target total amount of resources for the target large zone, the target allocated amount of resources for the target large zone, the second number, and the third number.
11. The method according to claim 10, characterized in that The acquisition of the total amount of target resources in the target region includes: Adding up the allocated resource amounts of each message queue in the interactive message channel in the target region to obtain the total interactive resource amount of the target region; The target total amount of resources of the target large area is determined according to the total amount of large area resources of the target large area and the total amount of interactive resources of the target large area.
12. The method according to claim 1, characterized in that The acquisition of the resource requirement of the target message queue includes: In response to a queue message backlog of the target message queue being 0, and the target message queue belonging to a group message channel, the resource demand of the target message queue being a third set threshold; In response to a queue message backlog of the target message queue being 0, and the target message queue belonging to a trigger message channel, a resource demand of the target message queue being a fourth set threshold; In response to the queue message backlog of the target message queue being not zero, the resource demand of the target message queue is determined according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold.
13. The method according to claim 12, characterized in that The determining the resource demand of the target message queue according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold includes: In response to the target message queue belonging to the group message channel, determining a first ratio according to a ratio of a queue message backlog of the target message queue to the first set time interval; determining a first maximum value from the first ratio and the fourth set threshold; Determine a first minimum value from the first maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; The first minimum value is used as the resource requirement of the target message queue.
14. The method according to claim 12, characterized in that The determining the resource demand of the target message queue according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold includes: In response to the target message queue belonging to the trigger message channel, determining a third coefficient according to the first set time interval; Determine a second ratio according to a ratio of a queue message backlog of the target message queue to the third coefficient; determining a second maximum value from the second ratio and the fourth set threshold; Determine a second minimum value from the second maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; The second minimum value is used as the resource requirement of the target message queue.
15. The method according to claim 12, characterized in that The acquisition of the queue resource threshold of the target message queue includes: Obtain the set resource threshold corresponding to the target message queue, and obtain the minimum message processing rate of the subscription number Chatbot for processing messages in the target message queue; Determining a third minimum value from the set resource threshold corresponding to the target message queue and the minimum message processing rate; The third minimum value is used as the queue resource threshold of the target message queue.
16. A resource intelligent scheduling system, characterized in that: The system includes a basic configuration module, a monitoring module, a resource determination module and a resource allocation module, wherein: The basic configuration module is used to configure the message queue corresponding to any message and the queue priority of each message queue; The monitoring module is used to monitor the queue message backlog of each message queue and the real-time rate of each message queue; The resource determination module is used to determine the target resource allocation amounts corresponding to the multiple message queues by using the message queue resource determination method according to any one of claims 1 to 15; The resource allocation module is used to allocate speed resources to the message queue according to the target resource allocation amount of any of the message queues.
17. A message queue resource determination device, characterized in that: The device comprises: A first acquisition module is used to obtain queue priorities of multiple message queues; A grouping module, used for grouping each of the message queues according to the queue priority of each of the message queues to obtain at least one group; wherein any of the groups has a corresponding queue priority, including a target message queue belonging to the corresponding queue priority; A first determination module is used to determine the target resource allocation amount of each target message queue based on the resource demand of each target message queue in the corresponding group according to the queue priority corresponding to each group; The first determining module is specifically configured to: Sorting the packets according to the queue priority order from high priority to low priority to obtain a sorted sequence; According to the sorting sequence, for the polled target group, according to whether the channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel, a corresponding allocation strategy is adopted to allocate the speed resources, so as to determine the target resource allocation amount of each target message queue according to the resource demand amount; The first determining module is specifically configured to: Determine a target region corresponding to each target message queue in the polled target group; wherein the target region includes the trigger message channel and / or the group message channel; Obtaining the amount of allocatable resources in any of the target regions; In the case where the amount of allocatable resources is greater than the first set threshold, for the polled target group, determining a corresponding allocation strategy according to whether the message channel to which each target message queue in the target group belongs is a trigger message channel or a group message channel; According to the resource demand of each of the target message queues in the target group, the allocation strategy is adopted to determine the target resource allocation amount of each of the target message queues in the target group.
18. The device according to claim 17, characterized in that The target group does not include the first message queue belonging to the group message channel and does not include the second message queue belonging to the trigger message channel; The first determining module is specifically configured to: According to the allocatable resource amount of any of the target large areas and the resource demand amount of each target message queue in the target large area, a first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target large area.
19. The device according to claim 18, characterized in that The first determining module is specifically configured to: For any of the target large areas, determining the average resource allocation amount of the target large area according to the allocatable resource amount of the target large area and the first number of the target message queue in the target large area; In response to the resource demand of each of the target message queues in the target large area not being greater than the average resource allocation of the target large area, determining the resource demand of any of the target message queues in the target large area as the target resource allocation of the target message queue; In response to the resource demand of each of the target message queues in the target large area being not less than the average resource allocation of the target large area, determining the average resource allocation of the target large area as the target resource allocation of the target message queues in the target large area; In response to the presence of a third message queue and a fourth message queue in each of the target message queues in the target region, determining a resource demand of any of the third message queues as a target resource allocation of the third message queue; wherein the resource demand of the third message queue is not greater than the average resource allocation of the target region, and the resource demand of the fourth message queue is greater than the average resource allocation of the target region; re-determining the allocatable amount of resources of the target large area according to the allocatable amount of resources of the target large area and the target resource allocation amount of each of the third message queues; In response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the first allocation strategy is adopted to determine the target resource allocation amount of each of the fourth message queues based on the allocatable amount of resources in the re-determined target zone and the resource demand of each of the fourth message queues.
20. The device according to claim 17, characterized in that The target group includes a first message queue belonging to the group message channel and does not include a second message queue belonging to the trigger message channel; The first determining module is specifically configured to: Based on the platform resource threshold, the allocatable resource amount of each target zone, and the resource demand of each target message queue in the target group, a second allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group.
21. The device according to claim 20, characterized in that The first determining module is specifically configured to: According to the allocatable resource amount of any of the target large areas and the resource demand amount of each of the target message queues in the target large area, a first allocation strategy is adopted to determine a first resource allocation amount of each of the target message queues in the target large area; Adding the first resource allocation amounts of the first message queues in each of the target regions to obtain a first sum; In response to the first sum being greater than the platform resource threshold, determining a first coefficient according to a ratio of the platform resource threshold and the first sum; For any of the first message queues, determining a target resource allocation amount of the first message queue according to a product of the first coefficient and a first resource allocation amount of the first message queue; For any of the target large areas, re-determine the allocatable resource amount of the target large area according to the allocatable resource amount of the target large area and the target resource allocation amount of the first message queue in the target large area; In response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target zone except the first message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each target message queue in the target zone except the first message queue.
22. The device according to claim 21, characterized in that The device also includes: The second determining module is configured to determine, in response to the first sum being not greater than the platform resource threshold, a first resource allocation amount of any target message queue in the target group as a target resource allocation amount of the target message queue.
23. The device according to claim 17, characterized in that The target group includes the second message queue belonging to the trigger message channel and does not include the first message queue belonging to the group message channel; The first determining module is specifically configured to: Based on the trigger resource threshold, the allocatable resource amount of each target zone, and the resource demand of each target message queue in the target group, a third allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target group.
24. The device according to claim 23, characterized in that The first determining module is specifically configured to: According to the allocatable resource amount of any of the target large areas and the resource demand amount of each of the target message queues in the target large area, a first allocation strategy is adopted to determine the second resource allocation amount of each of the target message queues in the target large area; Adding the second resource allocation amounts of the second message queues in each of the target regions to obtain a second sum; In response to the second sum being greater than the trigger resource threshold, determining a second coefficient according to a ratio of the trigger resource threshold and the second sum; For any of the second message queues, determining a target resource allocation amount of the second message queue according to a product of the second coefficient and the second resource allocation amount of the second message queue; For any of the target large areas, re-determine the allocatable resource amount of the target large area according to the allocatable resource amount of the target large area and the target resource allocation amount of the second message queue in the target large area; In response to the allocatable amount of resources in the re-determined target zone being greater than the first set threshold, the first allocation strategy is adopted to determine the target resource allocation amount of each target message queue in the target zone except the second message queue based on the allocatable amount of resources in the re-determined target zone and the resource demand of each target message queue in the target zone except the second message queue.
25. The device according to claim 24, characterized in that The device also includes: A third determination module is configured to determine, in response to the second sum being not greater than the trigger resource threshold, the first resource allocation amount of any target message queue in the target group as the target resource allocation amount of the target message queue.
26. The device according to claim 17, characterized in that The first acquisition module is specifically used to: For any of the target regions, determine the second number of the fifth message queue and the third number of the sixth message queue in the target region in the group that has not been polled; wherein the fifth message queue belongs to the group messaging channel, and the resource demand of the fifth message queue is not the second set threshold; the sixth message queue belongs to the trigger message channel; Determine the target allocated resource amount of the target large area according to the target resource allocation amount of each target message queue in the target large area in the group that has been polled; The allocatable amount of resources for the target large zone is determined based on the target total amount of resources for the target large zone, the target allocated amount of resources for the target large zone, the second number, and the third number.
27. The device according to claim 26, characterized in that The device also includes: The second acquisition module is specifically used for: Adding up the allocated resource amounts of each message queue in the interactive message channel in the target region to obtain the total interactive resource amount of the target region; The target total amount of resources of the target large area is determined according to the total amount of large area resources of the target large area and the total amount of interactive resources of the target large area.
28. The device according to claim 17, characterized in that The device also includes: The third acquisition module is specifically used for: In response to a queue message backlog of the target message queue being 0, and the target message queue belonging to a group message channel, the resource demand of the target message queue being a third set threshold; or, In response to a queue message backlog of the target message queue being 0, and the target message queue belonging to a trigger message channel, a resource demand of the target message queue being a fourth set threshold; or, In response to the queue message backlog of the target message queue being not zero, the resource demand of the target message queue is determined according to the queue message backlog of the target message queue, the queue resource threshold of the target message queue, the dynamically allocated resource threshold, the first set time interval and the fourth set threshold.
29. The device according to claim 28, characterized in that The third acquisition module is specifically used for: In response to the target message queue belonging to the group message channel, determining a first ratio according to a ratio of a queue message backlog of the target message queue to the first set time interval; determining a first maximum value from the first ratio and the fourth set threshold; Determine a first minimum value from the first maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; The first minimum value is used as the resource requirement of the target message queue.
30. The device according to claim 28, characterized in that The third acquisition module is specifically used for: In response to the target message queue belonging to the trigger message channel, determining a third coefficient according to the first set time interval; Determine a second ratio according to a ratio of a queue message backlog of the target message queue to the third coefficient; determining a second maximum value from the second ratio and the fourth set threshold; Determine a second minimum value from the second maximum value, the queue resource threshold of the target message queue, and the dynamically allocated resource threshold; The second minimum value is used as the resource requirement of the target message queue.
31. The device according to claim 28, characterized in that The device also includes: The fourth acquisition module is specifically used for: Obtain the set resource threshold corresponding to the target message queue, and obtain the minimum message processing rate of the subscription number Chatbot for processing messages in the target message queue; Determining a third minimum value from the set resource threshold corresponding to the target message queue and the minimum message processing rate; The third minimum value is used as the queue resource threshold of the target message queue.
32. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the message queue resource determination method described in any one of claims 1 to 15.
33. A computer-readable storage medium for storing instructions, characterized in that: When the instructions are executed, the method according to any one of claims 1 to 15 is implemented.
