Method, device and equipment for dynamically adjusting message priority
By establishing a shared resource pool in the message queue and dynamically adjusting message priority according to multiple adjustment configuration items, the problem of low resource utilization in the existing technology is solved, efficient message sending and resource sharing is achieved, and business continuity is improved Sex and user satisfaction.
Patent Information
- Application Number
- CN202411318382.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In the prior art, the judgment dimension of the message sending priority adjustment strategy is single, resulting in low resource utilization and inability to effectively share message sending resources, resulting in waste of some resources.
By receiving multiple types of messages and sending them to the corresponding message queue, a shared resource pool is established, and the initial processing resources are dynamically allocated to each consumer node based on the resource dynamic allocation algorithm, and the parameter values of the configuration items are adjusted in real time according to the multiple configuration items. Determine whether priority adjustment is made and increase processing resources for high-priority messages.
It realizes dynamic adjustment of message priority based on multiple judgment dimensions, improves the accuracy and resource utilization of message priority adjustment, ensures business continuity and timeliness during peak periods, and improves user satisfaction and message delivery rate.
Smart Images

Figure CN119232791A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of business system message push technology, and in particular to a method, device and equipment for dynamically adjusting message priority. Background Art
[0002] At present, when various business systems push messages, they need to be scheduled through a message push scheduling system. In related technologies, the message push scheduling system first receives the message request sent by the user through the gateway server, and then sends it to the server message queue for caching. Then the third-party message push cluster obtains the message from the message queue for parsing, and can obtain the recipient information according to the message type, and then adjust the message sending priority according to the priority scheduling algorithm.
[0003] However, the adjustment strategy of message sending priority in the related art has a relatively single dimension of adjustment judgment. For example, the sending order is adjusted based on only one factor, the message type, which may result in the priority scheduling result not meeting the actual needs. Moreover, the above adjustment strategy can only switch the sending node when the resources are insufficient, resulting in low utilization of message sending resources and waste of some resources. Summary of the invention
[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the first purpose of the present application is to propose a method for dynamically adjusting the priority of a message, which can dynamically adjust the priority of a message according to multiple judgment dimensions and realize the sharing of message sending resources, thereby improving the accuracy of message priority adjustment and resource utilization.
[0006] The second object of the present application is to provide a device for dynamically adjusting message priority;
[0007] The third object of the present application is to provide an electronic device;
[0008] A fourth objective of the present application is to provide a computer-readable storage medium.
[0009] To achieve the above object, the first aspect of the present application is to propose a method for dynamically adjusting message priority, the method comprising the following steps:
[0010] Receive various types of messages sent by the business system, and send each message to the corresponding message queue according to the message type;
[0011] The message sending resources of each message sending node are concentrated into a shared resource pool, and based on a dynamic resource allocation algorithm, initial processing resources are dynamically allocated from the shared resource pool to each consumer node, wherein the consumer node corresponds to the message in the message queue;
[0012] Processing each message according to the initial processing resources, and collecting parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and determining whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items;
[0013] For the adjusted high-priority message, the processing resources of the consumer node corresponding to the high-priority message are increased.
[0014] Optionally, according to one embodiment of the present application, the dynamic allocation of initial processing resources from the shared resource pool to each consumer node includes: constructing initial configuration data of the shared resource pool so that different message sending programs share the resources in the shared resource pool; determining the initial processing resources allocated to the consumer node corresponding to each message based on the initial configuration data and the business conditions corresponding to each message.
[0015] Optionally, according to one embodiment of the present application, the initial configuration data for constructing the shared resource pool includes: constructing an SMS consumer configuration and an information object definition IOD account resource configuration; wherein the IOD account resource configuration includes an IOD account name, an account configuration, and a resource group to which the account belongs, and the IOD account resource configuration is used to attribute different IOD accounts to the shared resource pool; the SMS consumer configuration includes a consumer name, a consumer detailed configuration, and a consumer group, and the SMS consumer configuration is used to associate a consumer program with an IOD account resource group.
[0016] Optionally, according to one embodiment of the present application, the initial processing resources allocated to the consumer node corresponding to each message are determined based on the initial configuration data and the business conditions corresponding to each message, including: loading the initial configuration data into the memory library, and configuring a distributed lock for the target consumer node currently to be processed; calculating the required number of concurrent connections based on the peak business volume corresponding to the current message to be processed, and reading the number of shared connections in the IOD account resource group from the memory library, and judging whether the resource quota is sufficient by comparing the number of concurrent connections with the number of shared connections; if the resource quota is sufficient, allocating corresponding initial processing resources to the target consumer node, updating the processing resource allocation information in the memory library, and releasing the distributed lock; if the resource quota is insufficient, reapplying for the IOD account and the corresponding number of connections, and adding the reapplied IOD account and the corresponding number of connections to the IOD account resource group, and re-judging the resource quota.
[0017] Optionally, according to one embodiment of the present application, the multiple adjustment configuration items include: default priority, business timeliness sensitivity, message queue backlog status, IOD account resource idle status and end-user reception policy, and the determination of whether to dynamically adjust the priority of each message based on the parameter values of the multiple adjustment configuration items includes: based on the parameter value and preset weight of each adjustment configuration item, performing weighted operation on the multiple adjustment configuration items to obtain a weighted value; comparing the weighted value with a preset adjustment threshold, and adjusting the priority of the message whose weighted value is greater than the adjustment threshold to a high priority.
[0018] Optionally, according to one embodiment of the present application, increasing the processing resources of the consumer node corresponding to the high-priority message includes: sending a request to the service platform to increase the minimum deployment unit pod of the high-priority message, dynamically increasing the number of pod copies of the consumer processing node corresponding to the high-priority message through the service platform, and locking the IOD account connection number of the consumer processing node; after the priority of the high-priority message decreases, reducing the number of pod copies of the consumer processing node through the service platform, and releasing the IOD account connection number resources of the consumer processing node.
[0019] Optionally, according to one embodiment of the present application, the receiving of multiple types of messages sent by the business system includes: accepting real-time interface call message data through a real-time interface call, and obtaining directory file data through a file scanning program; before sending each message to the corresponding message queue, it also includes: encrypting the multiple types of messages, and judging whether the multiple types of messages have passed authentication based on the encryption results.
[0020] To achieve the above purpose, the second aspect of the present application further proposes a device for dynamically adjusting message priority, comprising the following modules:
[0021] The receiving module is used to receive various types of messages sent by the business system and send each message to the corresponding message queue according to the message type;
[0022] A first allocation module, configured to centrally incorporate message sending resources of each message sending node into a shared resource pool, and dynamically allocate initial processing resources to each consumer node from the shared resource pool based on a dynamic resource allocation algorithm, wherein the consumer node corresponds to a message in the message queue;
[0023] A dynamic adjustment module, used to process each message according to the initial processing resources, and collect parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and determine whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items;
[0024] The second allocation module is used to increase the processing resources of the consumer node corresponding to the high-priority message obtained by adjustment.
[0025] To achieve the above-mentioned purpose, the third aspect of the present application further proposes an electronic device, comprising:
[0026] processor;
[0027] a memory for storing instructions executable by the processor;
[0028] The processor is configured to execute the instructions to implement the method for dynamically adjusting the message priority as described in any one of the first aspects above.
[0029] To achieve the above-mentioned purpose, the fourth aspect of the present application further proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for dynamically adjusting the message priority described in any one of the above-mentioned first aspects is implemented.
[0030] The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: In the message sending priority adjustment strategy of the present application, the adjustment configuration items can be dynamically added and the real-time configuration item parameter values can be obtained. By adopting a weighted algorithm for the configuration item parameter values, it is determined whether there is a business bottleneck in the real-time message sending, thereby dynamically adjusting the priority of the message template. The consumer node processing resources corresponding to the high-priority message are increased by the priority scheduler, including adjusting the number of connections and the number of concurrent connections in the fusion gateway resource pool, etc., so as to ensure that high-priority messages match advanced resources during peak hours and low-priority short messages match ordinary resources, thereby ensuring the continuity and timeliness of the business and improving user satisfaction. In addition, the present application also concentrates the scattered message sending resources into a unified shared resource pool through a resource allocation algorithm, and different sending programs can share the resources of the resource pool. Idle IOD connections can be used when busy, which can avoid the situation where some sending nodes are busy and some sending nodes are idle, and improve the utilization rate of scarce IT resources, which is conducive to maximizing the delivery rate and timeliness of business messages. Therefore, the present application can dynamically adjust the priority of the message according to multiple judgment dimensions, and realize the sharing of message sending resources, thereby improving the accuracy of message priority adjustment and resource utilization.
[0031] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0033] Figure 1 A flowchart of a method for dynamically adjusting message priority level proposed in an embodiment of the present application;
[0034] Figure 2 A schematic diagram of the principle of executing a message processing service proposed in an embodiment of the present application;
[0035] Figure 3 A flowchart of a method for dynamically allocating processing resources proposed in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of a principle for dynamically allocating initial processing resources to multiple nodes proposed in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of a message priority adjustment process proposed in an embodiment of the present application;
[0038] Figure 6 A schematic diagram of the structure of a device for dynamically adjusting message priority level proposed in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of the structure of an electronic device proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0040] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0041] It should be noted that the message push priority adjustment scheme in the related technology adjusts the message sending priority according to the relevant priority scheduling algorithm, and the program can dynamically adjust the message processing node according to the message delivery rate, thereby achieving the effect of improving the message delivery rate to a certain extent. However, the priority adjustment scheme in the related technology has the following problems: First, the message sending strategy adjustment dimension is single, and the sending order is only adjusted according to the message type, and the sending target node is dynamically adjusted according to the idleness of the sending target node. It is impossible to make judgments based on multiple dimensions such as business timeliness sensitivity, server-side message queue backlog, target node resource pool idleness, and end-user receiving strategy, and it is impossible to dynamically increase the judgment dimension.
[0042] Second, the adjustment scheme in the related technology can only switch the target node when resources are insufficient, but cannot share the sending resources of multiple target nodes. During business peak hours, some message sending target nodes may be idle while others are busy. Resource utilization cannot reach the optimal level, which poses a bottleneck to improving the message delivery rate.
[0043] Third, the adjustment scheme in the related art only schedules storage resources and cannot share other types of resources such as IOD peripheral interface connection resources. In addition, there is no dynamic scheduling program for resource usage.
[0044] To this end, this application proposes a method for dynamically adjusting message priority. This method selects relevant parameters for weighted algorithm judgment based on the business characteristics of the communication business support system. The priority of messages that are sensitive to high business timeliness can be dynamically increased, and the back-end sending resources can be coordinated to increase timeliness and success rate, thereby improving customer satisfaction. In addition, the scattered message sending resources are concentrated into a shared resource pool through a resource allocation algorithm, and idle IOD connections can be used during busy hours, thereby improving the utilization rate of scarce IT resources and the message delivery rate and timeliness.
[0045] It should be noted that the method for dynamic adjustment of message priority implemented in the present application is configured in a dynamic adjustment device for message priority for illustration. The method for dynamic adjustment of message priority can be applied to any electronic device so that the electronic device can perform the function of dynamically adjusting the message priority of the business system.
[0046] The electronic device may be any device with computing capability, such as a personal computer (PC) and various terminals, and the various terminals may be hardware devices with various operating systems and input / output devices.
[0047] It should also be noted that in order to more clearly illustrate the implementation process of the method for dynamically adjusting the message priority of the present application, the various modules, programs and various technologies involved in the method for dynamically adjusting the message priority of the present application are first explained below.
[0048] Message receiving program: Its function is to receive messages at a unified entrance. The system carries the receiver module through the container pod, receives text messages sent by the front-end business system, performs preliminary authentication and processing, and then sends them to the message queue.
[0049] Message queue: After the message receiving program receives the front-end message, it sends the message to the Kafka cluster, and then puts it into different Kafka queues for buffering according to different businesses to facilitate subsequent processing.
[0050] Priority intelligent scheduling: Based on various configuration items, such as message priority, business timeliness sensitivity, message queue backlog, IOD account resource pool idleness, and end-user receiving strategy, the intelligent scheduling algorithm prioritizes message templates, dynamically allocates high-priority message sending module resources, and adjusts resource pool connections and concurrency numbers to ensure that there is no backlog of real-time high-priority messages during peak hours, that back-end fusion gateway resources are not blocked, and that low-priority text messages are released smoothly.
[0051] Dynamic resource allocation: Message sending resources, such as the number of IOD connections and the number of concurrent processing of message sending programs, are uniformly managed in a resource pool and can be dynamically allocated when sending, so as to achieve optimal utilization of message sending resources during business peak periods.
[0052] Production-side scanner: The production-side application supports scanning directories and dynamic adaptation of sending queues.
[0053] Consumer-side sending program: The consumer-side application supports dynamic adaptation of consumption queues and IOD accounts.
[0054] A method, apparatus and device for dynamically adjusting message priority levels according to an embodiment of the present invention will be described below with reference to the accompanying drawings.
[0055] Figure 1 A flowchart of a method for dynamically adjusting message priority level proposed in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps:
[0056] Step S101: receiving multiple types of messages sent by the business system, and sending each message to a corresponding message queue according to the message type.
[0057] Specifically, multiple types of messages sent by the front-end business system are received through the message receiving program, and then each type of message is sent to a preset message queue corresponding to the type of message to wait for subsequent processing according to the type of the message.
[0058] The business system for pushing messages applicable to the present application may be various business systems at the front end, such as a communication business support system, etc. The received message may include multiple types, which are specifically determined according to the business system for pushing messages.
[0059] For example, for a communication business support system, receiving various types of messages sent by the business system includes: receiving real-time interface call message data through a real-time interface call, and obtaining directory file data through a file scanning program.
[0060] In this embodiment, if Figure 2 As shown in the figure, the communication service support system supports receiving two types of messages. The first type is through the real-time interface call method, where the receiver-service application receives the real-time interface call message data and stores it in the kafka queue corresponding to the real-time interface call message data. The second type is receiving file data, where the scanning program schedule-service obtains the directory file data transmitted by the peer sftp, scans it, and transmits it to the kafka queue corresponding to the file data.
[0061] Among them, the Kafka cluster (Kafka Cluster) includes multiple broker modules, and each broker module includes multiple partitions (Partition).
[0062] In one embodiment of the present application, before each message is sent to the corresponding message queue, it also includes: encrypting multiple types of messages, and judging whether the multiple types of messages have passed the authentication according to the encryption results.
[0063] Specifically, in this embodiment, after the message receiving program receives the message, the sender first encrypts the message and the private key to obtain a digital signature. Then, after the message center obtains the signature, it encrypts it with the original text and the public key, and then compares it with the obtained digital signature. If the two are consistent, it is determined that the authentication is passed. Then, the authenticated message is sent to the corresponding Kafka message queue according to different message types. This embodiment can ensure the accuracy and reliability of subsequent messages to be processed through preliminary authentication processing.
[0064] Step S102: The message sending resources of each message sending node are centralized into a shared resource pool, and based on a dynamic resource allocation algorithm, initial processing resources are dynamically allocated from the shared resource pool to each consumer node, wherein the consumer node corresponds to the message in the message queue.
[0065] Specifically, the present application dynamically allocates corresponding initial processing resources for each message in the processing queue of multiple message processing programs through a dynamic resource allocation algorithm. Among them, when the present application allocates processing resources, it first incorporates the sending resources of the target node that sends the message, such as the number of information object definition (IOD) links and the number of concurrency, into a unified shared resource pool. This allows different sending programs to share the resources of the resource pool, which can avoid the situation where some sending nodes are busy and some sending nodes are idle when sending messages, thereby maximizing the message delivery rate.
[0066] In one embodiment of the present application, initial processing resources are dynamically allocated to each consumer node from a shared resource pool, including: constructing initial configuration data of the shared resource pool so that different message sending programs can share resources in the shared resource pool; and determining the initial processing resources allocated to the consumer node corresponding to each message based on the initial configuration data and the business conditions corresponding to each message.
[0067] Specifically, in this embodiment, the initial data configuration is first performed. The initial configuration data of the shared resource pool is constructed, including: constructing SMS consumer configuration and IOD account resource configuration. Among them, the IOD account resource configuration includes the IOD account name, account configuration and the resource group to which the account belongs. The IOD account resource configuration is used to attribute different IOD accounts to the shared resource pool. The SMS consumer configuration includes the consumer name, consumer detailed configuration and consumer group. The SMS consumer configuration is used to associate the consumer program with the IOD account resource group.
[0068] Among them, IOD account resource configuration realizes resource sharing by assigning different IOD accounts to the same resource group. SMS consumer configuration associates the consumer program with the IOD account resource group to obtain shared resources.
[0069] For example, the specific data of the constructed SMS consumer configuration is shown in the following Table 1.
[0070] Table 1 SMS consumer configuration table
[0071]
[0072] Among them, the first column in Table 1 is the consumer name, the second column is the consumer detailed configuration, and the third column is the consumer group. The second column of consumer detailed configuration (DICTNAME) currently consists of 5 fields, each field is separated by "~", and the meanings of each field are as follows:
[0073] The first field indicates the number of consumer instances, which is equivalent to how many of the total PODs belong to this consumer group. The second field indicates the consumer queue. The third field indicates the IOD account group to which it belongs, corresponding to the "IOD account group dictionary". The fourth field indicates the number of IOD connections required, which is used to allocate a certain connection quota from the IOD account group. The fifth field indicates the speed limit for each IOD connection.
[0074] The specific data of the constructed IOD account resource configuration is shown in Table 2 below.
[0075] Table 2 IOD account resource configuration
[0076]
[0077] The first column in Table 2 is the IOD account name, the second column is the account configuration, and the third column is the resource group to which the account belongs. The second column of account configuration (DICTNAME) consists of 5 fields, each of which is separated by "~". The meanings of each field are as follows:
[0078] The first field indicates the maximum number of connections of the IOD account. The second field indicates the IOD connection address. The third field indicates the IOD connection port. The fourth field indicates the sourceAddr provided by the IOD. The fifth field indicates the sharedSecret provided by the IOD.
[0079] Furthermore, after configuring the above data, based on the obtained initial configuration and in combination with the real-time business conditions, dynamic allocation of processing resources to multiple nodes is achieved.
[0080] In order to more clearly illustrate the specific implementation process of allocating initial processing resources to the consumer node corresponding to each message according to the initial configuration data and the business conditions corresponding to each message, a processing resource allocation method proposed in an embodiment of the present application is exemplified below.
[0081] Figure 3A flowchart of a method for dynamically allocating processing resources proposed in an embodiment of the present application. Figure 4 The schematic diagram of the implementation principle of the allocation method is as follows: Figure 3 As shown, the method comprises the following steps:
[0082] Step S301, loading the initial configuration data into the memory library, and configuring a distributed lock for the target consumer node to be processed.
[0083] Specifically, when the message processing program starts, it will apply for resources from the resource sharing program. The resource sharing program algorithm implements resource allocation as follows: Figure 4 As shown in the figure, first load the obtained initial configuration data into the Redis memory library, and enable the consumer node to obtain the distributed lock.
[0084] The consumer node corresponding to the current message to be processed is the target consumer node, that is, this method allocates processing resources to the target consumer node.
[0085] Step S302, calculate the required number of concurrent connections according to the peak business volume corresponding to the current pending message, read the number of shared connections in the IOD account resource group from the memory library, and determine whether the resource quota is sufficient by comparing the number of concurrent connections with the number of shared connections.
[0086] Specifically, Figure 4 As shown, the allocated IOD account resource group information is obtained from the redis memory library. The resource group information is obtained when the IOD account resource configuration is performed above. The required number of concurrent connections is then calculated based on the peak business volume during busy business hours and other business conditions.
[0087] For example, assuming that the business to which the currently processed business message belongs requires a business volume of 1,000 transactions per second during peak hours, it can be calculated that the number of concurrent connections required to achieve this peak business volume is 200.
[0088] Furthermore, based on the calculated number of concurrent connections, check whether the shared connection resource quota in the IOD account resource group is sufficient, and compare the calculated number of concurrent connections with the shared connection number in the IOD account resource group. If the shared connection number in the IOD account resource group is greater than the required number of concurrent connections, it indicates that the remaining quota of the shared connection resource is sufficient to allocate the required processing resources to the current target consumer node.
[0089] Step S303, when the resource quota is sufficient, allocate the corresponding initial processing resources to the target consumer node, update the processing resource allocation information in the memory library, and release the distributed lock.
[0090] Specifically, if sufficient resources can be obtained from the IOD account resource group, the quota allocated to the consumer node is recorded and the required processing resources are allocated to the consumer node. Figure 4 As shown, the allocated resource information in the redis memory library is updated, the remaining quota in the current IOD account resource group is determined, and the judgment in step S302 is performed on the next consumer node according to the updated remaining quota to prevent the next consumer node from obtaining the wrong quota.
[0091] Furthermore, after the entire allocation process for the current target consumer node is completed, the distributed lock is released for subsequent processing.
[0092] Step S304: if the resource quota is insufficient, reapply for the IOD account and the corresponding number of connections, add the reapplied IOD account and the corresponding number of connections to the IOD account resource group, and re-judge the resource quota.
[0093] Specifically, if the shared connection number resources in the resource group are insufficient, that is, the shared connection number in the IOD account resource group is less than the required concurrent connection number mentioned above, you need to reapply for the account and the corresponding number of connections from the IOD, and allocate the account and the corresponding number of connections to the resource group.
[0094] Further, the above step S302 is repeatedly executed, and whether the resource quota is sufficient is re-determined according to the method described in the above step S302 with the updated number of connections in the IOD account resource group, until the entire resource allocation process is completed.
[0095] Therefore, the present application allocates a corresponding initial processing resource to each consumer node, and the message processing program initiates a connection to the IOD according to the number of connections applied for, and performs formal message sending and other processing.
[0096] Step S103: Process each message according to the initial processing resources, and collect parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and determine whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items.
[0097] Specifically, in the process of processing messages by the message processing program according to the initial processing resources, problems in the operation of the business system will be encountered, such as artificial adjustment of message priority and time sensitivity, or a large increase in business volume leading to queue backlogs. Therefore, the priority intelligent scheduling program of the present application will dynamically adjust the priority of each message according to the real-time parameter values of multiple judgment dimensions (ie, configuration items), and achieve the purpose of peak shaving and valley flattening and ensuring the smooth operation of various businesses by real-time scheduling of the sending priority of each message.
[0098] Among them, multiple adjustment configuration items are determined according to factors such as the type of business system that pushes messages. For example, in the embodiment of the present application for a communication business support system, the multiple adjustment configuration items based on intelligent scheduling include: default priority, business timeliness sensitivity, message queue backlog status, IOD account resource idle status, and end-user receiving strategy.
[0099] In one embodiment of the present application, whether to dynamically adjust the priority of each message is determined based on the parameter values of multiple adjustment configuration items, including: first, based on the parameter value and preset weight of each adjustment configuration item, a weighted operation is performed on the multiple adjustment configuration items to obtain a weighted value; the weighted value is compared with a preset adjustment threshold, and the priority of the message whose weighted value is greater than the adjustment threshold is adjusted to a high priority.
[0100] Specifically, when the priority is dynamically adjusted in this embodiment, the dimension parameter value can be configured in real time according to the actual detection result and dynamic addition of configuration items can be supported. The message priority adjustment is determined according to several or all of the multiple adjustment configuration items, for example, Figure 5 As shown, the default priority, business timeliness sensitivity, message queue backlog status and IOD account resource idle status are selected from multiple configuration items. Among them, the parameter values of the default priority, business timeliness sensitivity and IOD account resource idle status can be read from the redis memory library, and the message queue backlog status can be obtained by detecting the kafka message queue where the message is located.
[0101] Furthermore, by adopting a weighted algorithm for the obtained configuration item parameter values, it is determined whether there is a business bottleneck in the sending of the real-time message, and then the priority of the real-time message template is dynamically adjusted to dynamically adjust the priority of the message with the business bottleneck.
[0102] For example, the priority intelligent scheduler obtains the default priority of the message configuration from the database configuration table, and then obtains the current backlog value and time sensitivity of the message queue, and performs weighted operations on the three configuration items of default priority, time sensitivity, and average queue backlog. For example, assuming that the default priority is 3, the time sensitivity is 100, and the average queue backlog is 100, then obtain the preset weights corresponding to each dimension, multiply the real-time parameter value of each configuration item by the corresponding weight to calculate the weighted value, that is, the weighted value is (3*2+100*7+100*1) / (2+7+1)=80.6.
[0103] Continue to refer to Figure 5In the example shown, since the currently calculated weighted value is greater than the preset adjustment threshold (80), for the message template with a weighted value greater than 80, the dynamic priority of the message template is adjusted in real time, that is, the sending priority of the current real-time message is increased, and the adjustment result is sent to the consumer management node, so that the consumer management node can subsequently adjust and add the message processing program according to the general algorithm for dynamic resource allocation, and process the consumer queue corresponding to the message template with the previously dynamically adjusted priority, thereby increasing the message processing capability and improving the message delivery rate and timeliness.
[0104] It should be noted that the configuration items added during the above judgment can be determined according to the current actual situation, and the weights corresponding to each configuration item can be determined according to factors such as the message adjustment needs of different business systems and the characteristics of the current business messages. This application does not impose any restrictions on this.
[0105] Step S104: For the adjusted high-priority message, increase the processing resources of the consumer node corresponding to the high-priority message.
[0106] Specifically, for messages adjusted to high priority, a dynamic resource allocation algorithm is used through the priority scheduler to increase the consumer node processing resources corresponding to the high priority messages, such as the number of IOD links and concurrent resources, to ensure business continuity and timeliness, and to achieve no backlog of high priority messages during peak hours.
[0107] As a possible implementation method, the resource dynamic allocation process of increasing the processing resources of high priority messages is as follows: Figure 5 As shown. Assuming that according to the SMS consumer configuration: 2~online~IOD_GROUP_ONLINE~6~100, the message processing program resource dynamic allocation algorithm configures 2 consumer processing nodes to process messages in the ONLINE queue according to the default configuration. When the business volume increases, if the queue backlog increases, the business priority is increased when the weighted value is greater than 80. When the dynamic resource task perceives in real time that the business needs to increase resource processing, it first detects whether the resources in the shared resource pool are sufficient. If sufficient, it can increase consumer processing nodes to process messages in the ONLINE queue. If insufficient, it will increase the processing resources of the consumer node corresponding to the high-priority message by applying for more processing resources.
[0108] In one embodiment of the present application, the processing resources of the consumer node corresponding to the high-priority message are increased by applying for more processing resources, including: sending a request to the service platform to increase the minimum deployment unit pod of the high-priority message, dynamically increasing the number of pod copies of the consumer processing node corresponding to the high-priority message through the service platform, and locking the IOD account connection number of the consumer processing node; after the priority of the high-priority message decreases, reducing the number of pod copies of the consumer processing node through the service platform, and releasing the IOD account connection number resources of the consumer processing node.
[0109] Specifically, in this embodiment, the task of applying for increasing dynamic resources sends an application to the PaaS (Platform as a Service) platform to increase the application's minimum deployment unit (pod). After receiving the application, the PaaS platform dynamically increases the number of pod copies of the message processing node, where a pod can contain multiple containers, and the number of pod copies represents the number of instances of the Pod running in the cluster.
[0110] At the same time, after allocating the required number of IOD account connections to the consumer processing node, the number of IOD account connections of the consumer processing node will be locked to avoid a reduction in the number of IOD account connections due to various reasons and ensure that the number of IOD account connections meets the demand.
[0111] Furthermore, the above operations improve the processing capacity of the consumer processing node. In actual applications, when the priority of the high-priority message decreases due to factors such as a decrease in backlog, the PaaS platform can also be notified to reduce the number of pod copies of the message processing node, and release the connection resources of the consumer processing node to allocate resources to other high-priority messages.
[0112] Therefore, the present application realizes the dynamic adjustment of the message sending priority, can efficiently process message templates with different timeliness requirements separately, and timely allocate IOD resources for message sending during business peak periods, thereby improving the timeliness and success rate of message sending services, improving user experience, and can be applied to messages of various business systems in actual applications, enriching the application scenarios.
[0113] In summary, the dynamic adjustment method of the message priority of the embodiment of the present application can dynamically add and adjust the configuration item and obtain the real-time configuration item parameter value. By adopting a weighted algorithm for the configuration item parameter value, it is determined whether there is a business bottleneck in the real-time message sending, thereby dynamically adjusting the priority of the message template. The consumer node processing resources corresponding to the high-priority message are increased by the priority scheduler, including adjusting the number of connections and the number of concurrent connections in the fusion gateway resource pool, etc., so as to ensure that the high-priority message matches the advanced resources during the peak period and the low-priority short message matches the ordinary resources, thereby ensuring the continuity and timeliness of the business and improving the user satisfaction. In addition, the method also concentrates the scattered message sending resources into a unified shared resource pool through a resource allocation algorithm, and different sending programs can share the resources of the resource pool. The idle IOD connection can be used when busy, which can avoid the situation that some sending nodes are busy and some sending nodes are idle, and improves the utilization rate of scarce IT resources, which is conducive to maximizing the delivery rate and timeliness of business messages. Therefore, the method can dynamically adjust the priority of the message according to multiple judgment dimensions, and realize the sharing of message sending resources, thereby improving the accuracy of message priority adjustment and resource utilization.
[0114] In order to implement the above embodiment, the present application also proposes a device for dynamically adjusting message priority. Figure 6 A schematic diagram of a structure of a device for dynamically adjusting message priority level proposed in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device includes a receiving module 100 , a first allocation module 200 , a dynamic adjustment module 300 and a second allocation module 400 .
[0115] The receiving module 100 is used to receive various types of messages sent by the business system, and send each message to a corresponding message queue according to the message type.
[0116] The first allocation module 200 is used to centralize the message sending resources of each message sending node into a shared resource pool, and dynamically allocate initial processing resources to each consumer node from the shared resource pool based on a dynamic resource allocation algorithm, wherein the consumer node corresponds to the message in the message queue.
[0117] The dynamic adjustment module 300 is used to process each message according to the initial processing resources, and collect parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and determine whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items.
[0118] The second allocation module 400 is used to increase the processing resources of the consumer node corresponding to the high-priority message obtained by adjustment.
[0119] In one embodiment of the present application, the first allocation module 200 is specifically used to: construct initial configuration data of a shared resource pool so that different message sending programs can share resources in the shared resource pool; and determine the initial processing resources allocated to the consumer node corresponding to each message based on the initial configuration data and the business conditions corresponding to each message.
[0120] In one embodiment of the present application, the first allocation module 200 is specifically used to: construct an SMS consumer configuration and an information object definition IOD account resource configuration; wherein the IOD account resource configuration includes the IOD account name, account configuration and the resource group to which the account belongs, and the IOD account resource configuration is used to attribute different IOD accounts to the shared resource pool; the SMS consumer configuration includes the consumer name, consumer detailed configuration and consumer group, and the SMS consumer configuration is used to associate the consumer program with the IOD account resource group.
[0121] In one embodiment of the present application, the first allocation module 200 is specifically used to: load the initial configuration data into the memory library, configure a distributed lock for the target consumer node currently to be processed; calculate the required number of concurrent connections based on the peak business volume corresponding to the current message to be processed, and read the number of shared connections in the IOD account resource group from the memory library, and judge whether the resource quota is sufficient by comparing the number of concurrent connections with the number of shared connections; when the resource quota is sufficient, allocate the corresponding initial processing resources to the target consumer node, update the processing resource allocation information in the memory library, and release the distributed lock; when the resource quota is insufficient, re-apply for the IOD account and the corresponding number of connections, and add the re-applied IOD account and the corresponding number of connections to the IOD account resource group, and re-judge the resource quota.
[0122] In one embodiment of the present application, the dynamic adjustment module 300 is specifically used to: perform weighted operations on multiple adjustment configuration items based on the parameter value and preset weight of each adjustment configuration item to obtain a weighted value; compare the weighted value with a preset adjustment threshold, and adjust the priority of the message whose weighted value is greater than the adjustment threshold to a high priority.
[0123] In one embodiment of the present application, the second allocation module 400 is specifically used to: send a request to the service platform to add a minimum deployment unit pod for high-priority messages, dynamically increase the number of pod copies of the consumer processing node corresponding to the high-priority message through the service platform, and lock the IOD account connection number of the consumer processing node; after the priority of the high-priority message decreases, reduce the number of pod copies of the consumer processing node through the service platform, and release the IOD account connection number resources of the consumer processing node.
[0124] In one embodiment of the present application, the receiving module 100 is specifically used to: accept real-time interface call message data through real-time interface call, and obtain directory file data through a file scanning program; encrypt multiple types of messages, and determine whether multiple types of messages have passed authentication based on the encryption results.
[0125] It should be noted that the explanation of the embodiment of the method for dynamically adjusting the message priority level described above is also applicable to the device of this embodiment, and will not be repeated here.
[0126] To sum up, the dynamic adjustment device of the message priority of the embodiment of the present application can dynamically adjust the priority of the message according to multiple judgment dimensions, and realize the sharing of message sending resources, thereby improving the accuracy of message priority adjustment and resource utilization.
[0127] In order to implement the above embodiments, the present application also proposes an electronic device, such as Figure 7 As shown, the electronic device 700 includes: a processor 710; a memory 720 for storing instructions executable by the processor 710; wherein the processor 710 is configured to execute instructions to implement a method for dynamically adjusting message priority as described in any one of the embodiments of the first aspect above.
[0128] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for dynamically adjusting the message priority as described in any one of the above first aspect embodiments is implemented.
[0129] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0130] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0131] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0133] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0134] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0135] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0136] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for dynamically adjusting message priority, characterized in that: The following steps are involved: Receive various types of messages sent by the business system, and send each message to the corresponding message queue according to the message type; The message sending resources of each message sending node are concentrated into a shared resource pool, and based on a dynamic resource allocation algorithm, initial processing resources are dynamically allocated from the shared resource pool to each consumer node, wherein the consumer node corresponds to the message in the message queue; Processing each message according to the initial processing resources, and collecting parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and determining whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items; For the adjusted high-priority message, the processing resources of the consumer node corresponding to the high-priority message are increased.
2. The method according to claim 1, characterized in that The dynamically allocating initial processing resources from the shared resource pool to each consumer node comprises: Constructing initial configuration data of the shared resource pool so that different message sending programs can share resources in the shared resource pool; The initial processing resources allocated to the consumer node corresponding to each message are determined according to the initial configuration data and the service status corresponding to each message.
3. The method according to claim 2, characterized in that The initial configuration data for constructing the shared resource pool includes: Construct SMS consumer configuration and information object definition IOD account resource configuration; among them, The IOD account resource configuration includes an IOD account name, an account configuration, and a resource group to which the account belongs, and the IOD account resource configuration is used to attribute different IOD accounts to the shared resource pool; The SMS consumer configuration includes a consumer name, a consumer detailed configuration and a consumer group, and the SMS consumer configuration is used to associate a consumer program with an IOD account resource group.
4. The method according to claim 3, characterized in that: Determining the initial processing resources allocated to the consumer node corresponding to each message according to the initial configuration data and the service status corresponding to each message includes: Load the initial configuration data into the memory library, and configure a distributed lock for the target consumer node to be processed; Calculate the required number of concurrent connections according to the peak traffic volume corresponding to the current pending messages, read the number of shared connections in the IOD account resource group from the memory library, and determine whether the resource quota is sufficient by comparing the number of concurrent connections with the number of shared connections; When the resource quota is sufficient, allocate corresponding initial processing resources to the target consumer node, update the processing resource allocation information in the memory library, and release the distributed lock; In the case where the resource quota is insufficient, the IOD account and the corresponding number of connections are reapplied for, and the reapplied IOD account and the corresponding number of connections are added to the IOD account resource group, and the resource quota is re-determined.
5. The method according to claim 1, characterized in that The multiple adjustment configuration items include: default priority, service time sensitivity, message queue backlog status, IOD account resource idle status and end-user receiving strategy, and judging whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items includes: Based on the parameter value and the preset weight of each of the adjustment configuration items, a weighted operation is performed on the multiple adjustment configuration items to obtain a weighted value; The weighted value is compared with a preset adjustment threshold, and the priority of the message whose weighted value is greater than the adjustment threshold is adjusted to a high priority.
6. The method according to claim 5, characterized in that The increasing the processing resources of the consumer node corresponding to the high priority message includes: Send a request to the service platform to increase the minimum deployment unit pod of the high-priority message, dynamically increase the number of pod copies of the consumer processing node corresponding to the high-priority message through the service platform, and lock the number of IOD account connections of the consumer processing node; After the priority of the high priority message decreases, the number of pod copies of the consumer processing node is reduced through the service platform, and the IOD account connection number resources of the consumer processing node are released.
7. The method according to claim 1, characterized in that The receiving service system sends multiple types of messages, including: By means of real-time interface calling, the real-time interface calling message data is received, and the directory file data is obtained through the file scanning program; Before sending each message to the corresponding message queue, the method further includes: The multiple types of messages are encrypted, and whether the multiple types of messages are authenticated is determined based on the encryption results.
8. A device for dynamically adjusting message priority, characterized in that: include: The receiving module is used to receive various types of messages sent by the business system and send each message to the corresponding message queue according to the message type; A first allocation module, configured to centrally incorporate message sending resources of each message sending node into a shared resource pool, and dynamically allocate initial processing resources to each consumer node from the shared resource pool based on a dynamic resource allocation algorithm, wherein the consumer node corresponds to a message in the message queue; A dynamic adjustment module, used to process each message according to the initial processing resources, and collect parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and determine whether to dynamically adjust the priority of each message according to the parameter values of the multiple adjustment configuration items; The second allocation module is used to increase the processing resources of the consumer node corresponding to the high-priority message obtained by adjustment.
9. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement a method for dynamically adjusting message priority as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for dynamically adjusting the message priority level according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Message processing method, device and equipment
CN115550284A
Message asynchronous processing method, system and device and storage medium
CN117909096A
Method and device for dynamically adjusting application priority configuration in off-line mixed part
CN118093209A
Multi-functional domain resource scheduling method and device, computer equipment, readable storage medium and program product
CN118660345A
Processing method, device and system for user service provision
WO2016033979A1
Cited By
Message controllable optimization method and system based on kafka
CN120336370A
A message controllable optimization method and system based on Kafka
CN120336370B
Information issuing method and system capable of dynamically adjusting priority
CN121217690A
Dynamically adjusting priority in message queue
WO2026196121A1