Method, apparatus and device for dynamic adjustment of message priority
By constructing a shared resource pool and employing a multi-dimensional dynamic adjustment strategy, the problem of a single dimension in message sending priority adjustment in existing technologies is solved, achieving efficient resource utilization and timely message delivery, thus improving the user experience.
Patent Information
- Application Number
- CN202411318382.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In existing technologies, message sending priority adjustment strategies have a single adjustment dimension, resulting in low resource utilization. They cannot dynamically adjust priorities based on multiple dimensions and cannot share resources, leading to some resource waste.
By building a shared resource pool, message priorities are dynamically adjusted based on multiple judgment dimensions, including default priority, business timeliness sensitivity, message queue backlog status, and IOD account resource idle status, to dynamically allocate resources to improve the processing resources of high-priority messages, thereby achieving resource sharing and optimized utilization.
It improved the accuracy of message priority adjustment and resource utilization, ensured message timeliness and business continuity during peak periods, and enhanced user satisfaction.
Smart Images

Figure CN119232791B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of message push technology for business systems, and in particular to a method, apparatus and device for dynamically adjusting message priority. Background Technology
[0002] Currently, when various business systems push messages, they need to use a message push scheduling system to schedule the pushed messages. In related technologies, the message push scheduling system first receives the message request sent by the user through the gateway server, then sends it to the server message queue for caching. Then, a third-party message push cluster retrieves the message from the message queue, parses it, 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 message sending priority adjustment strategies in related technologies rely on a relatively singular judgment dimension. For example, they may adjust the sending order based solely on message type, potentially leading to priority scheduling results that do not meet actual needs. Furthermore, these adjustment strategies can only switch sending nodes when resources are insufficient, resulting in low utilization of message sending resources and wasted resources. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art.
[0005] Therefore, the first objective of this application is to propose a dynamic message priority adjustment method that can dynamically adjust message priority based on 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 objective of this application is to propose a dynamic adjustment device for message priority;
[0007] The third objective of this application is to propose an electronic device;
[0008] The fourth objective of this application is to provide a computer-readable storage medium.
[0009] To achieve the above objectives, the first aspect of this application is to propose a method for dynamically adjusting message priority, the method comprising the following steps:
[0010] Receive various types of messages from the business system and send each type of message to the corresponding message queue according to the message type;
[0011] The message sending resources of each message sending node are centrally incorporated into a shared resource pool. Based on a dynamic resource allocation algorithm, initial processing resources are dynamically allocated to each consumer node from the shared resource pool, wherein each consumer node corresponds to a message in the message queue.
[0012] Each message is processed according to the initial processing resources, and the parameter values of multiple adjustment configuration items corresponding to each message are collected in real time during the processing. Based on the parameter values of the multiple adjustment configuration items, it is determined whether to dynamically adjust the priority of each message.
[0013] For high-priority messages obtained through adjustment, increase the processing resources of the consumer node corresponding to the high-priority message.
[0014] Optionally, according to one embodiment of this application, the step of dynamically allocating initial processing resources from the shared resource pool to each consumer node includes: constructing initial configuration data for the shared resource pool so that different message sending programs can share the resources in the shared resource pool; and determining the initial processing resources allocated to each consumer node corresponding to each message based on the initial configuration data and the business status corresponding to each message.
[0015] Optionally, according to one embodiment of this application, the initial configuration data for constructing the shared resource pool includes: constructing SMS consumer configuration and message object definition (IOD) account resource configuration; wherein, the IOD account resource configuration includes IOD account name, account configuration, and resource group to which the account belongs, and the IOD account resource configuration is used to assign different IOD accounts to the shared resource pool; the SMS consumer configuration includes consumer name, consumer detailed configuration, and consumer group, and the SMS consumer configuration is used to associate consumer programs with IOD account resource groups.
[0016] Optionally, according to one embodiment of this application, determining the initial processing resources allocated to the consumer node corresponding to each message based on the initial configuration data and the business status corresponding to each message includes: loading the initial configuration data into a memory library; configuring a distributed lock for the target consumer node to be processed; calculating the required number of concurrent connections based on the peak business volume corresponding to the message to be processed; reading the number of shared connections in the IOD account resource group from the memory library; and determining 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 the 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 an IOD account and the corresponding number of connections, adding the reapplying IOD account and the corresponding number of connections to the IOD account resource group, and re-determining the resource quota.
[0017] Optionally, according to one embodiment of this application, the plurality of adjustment configuration items include: default priority, business timeliness sensitivity, message queue backlog status, IOD account resource idle status, and end-user receiving strategy. The step of determining whether to dynamically adjust the priority of each message based on the parameter values of the plurality of adjustment configuration items includes: performing a weighted calculation on the plurality of adjustment configuration items based on the parameter value and preset weight of each adjustment configuration item to obtain a weighted value; comparing the weighted value with a preset adjustment threshold, and adjusting the priority of messages whose weighted value is greater than the adjustment threshold to high priority.
[0018] Optionally, according to one embodiment of this 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 replicas of the consumer processing node corresponding to the high-priority message through the service platform; and locking the number of IOD account connections of the consumer processing node; after the priority of the high-priority message decreases, reducing the number of pod replicas of the consumer processing node through the service platform and releasing the IOD account connection resources of the consumer processing node.
[0019] Optionally, according to one embodiment of this application, receiving multiple 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; before sending each type of message to the corresponding message queue, the method further includes: encrypting the multiple types of messages and determining whether the multiple types of messages have passed authentication based on the encryption result.
[0020] To achieve the above objectives, a second aspect of this application also proposes a dynamic message priority adjustment device, comprising the following modules:
[0021] The receiving module is used to receive various types of messages sent by the business system and send each type of message to the corresponding message queue according to the message type.
[0022] The first allocation module is used to centrally incorporate 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 a message in the message queue;
[0023] The dynamic adjustment module is used to process each message according to the initial processing resources, and to collect the parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing, and to 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 for the adjusted high-priority message.
[0025] To achieve the above objectives, a third aspect of this application also provides an electronic device, comprising:
[0026] processor;
[0027] Memory used to store the processor's executable instructions;
[0028] The processor is configured to execute the instructions to implement the method for dynamically adjusting message priorities as described in any of the first aspects above.
[0029] To achieve the above objectives, the fourth aspect of this application also proposes a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for dynamically adjusting message priority as described in any one of the first aspects.
[0030] The technical solution provided by the embodiments of this application brings at least the following beneficial effects: In the message sending priority adjustment strategy of this application, configuration items can be dynamically added and adjusted, and real-time configuration item parameter values can be obtained. By applying a weighted algorithm to the configuration item parameter values, it is determined whether there is a business bottleneck in real-time message sending, thereby dynamically adjusting the priority of the message template. By increasing the processing resources of consumer nodes corresponding to high-priority messages through the priority scheduler, including adjusting the number of connections and concurrency of the converged gateway resource pool, it is achieved that high-priority messages are matched with high-level resources during peak periods, and low-priority SMS messages are matched with ordinary resources, thereby ensuring the continuity and timeliness of business and improving user satisfaction. Furthermore, this application also centralizes the dispersed message sending resources into a unified shared resource pool through a resource allocation algorithm. Different sending programs can share the resources of the resource pool, and idle IOD connections can be utilized during busy periods, which can avoid the situation where some sending nodes are busy and some sending nodes are idle, improve the utilization rate of scarce IT resources, and help maximize the delivery rate and timeliness of business messages. Therefore, this application can dynamically adjust the message priority according to multiple judgment dimensions and realize the sharing of message sending resources, improving the accuracy of message priority adjustment and resource utilization.
[0031] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0032] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0033] Figure 1 A flowchart illustrating a method for dynamically adjusting message priority according to an embodiment of this application;
[0034] Figure 2 This is a schematic diagram illustrating the principle of performing message processing services according to an embodiment of this application;
[0035] Figure 3 This is a flowchart illustrating a method for dynamically allocating resources according to an embodiment of this application;
[0036] Figure 4 This is a schematic diagram illustrating the principle of dynamically allocating initial processing resources to multiple nodes according to an embodiment of this application.
[0037] Figure 5 This is a schematic diagram illustrating a message priority adjustment process proposed in an embodiment of this application;
[0038] Figure 6 This is a schematic diagram of the structure of a dynamic message priority adjustment device proposed in an embodiment of this application;
[0039] Figure 7 This is a schematic diagram of the structure of an electronic device proposed in an embodiment of this application. Detailed Implementation
[0040] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0041] It should be noted that while the message push priority adjustment schemes in related technologies adjust message sending priorities according to relevant priority scheduling algorithms, and the program can dynamically adjust the message processing nodes for sending based on message delivery rate, thus improving the message delivery rate to a certain extent, these priority adjustment schemes have the following problems: First, the message sending strategy adjustment dimension is singular, only adjusting the sending order based on message type and dynamically adjusting based on the idle status of the sending target node. It cannot make judgments based on multiple dimensions such as business timeliness sensitivity, server-side message queue backlog, target node resource pool idle status, and end-user receiving strategy, and it cannot dynamically add judgment dimensions.
[0042] Second, the adjustment schemes in related technologies can only switch target nodes when resources are insufficient, but cannot share resources among multiple target nodes. During peak business periods, some message sending target nodes may be idle while others are busy, resulting in the resource utilization not reaching the optimal level and creating a bottleneck for improving message delivery rate.
[0043] Third, the adjustment schemes in related technologies only schedule storage resources and cannot share resources such as IOD peripheral interface connection resources. Furthermore, there is no dynamic scheduling process for resource usage.
[0044] To address this, this application proposes a dynamic message priority adjustment method. This method selects relevant parameters based on the business characteristics of the communication service support system and uses a weighted algorithm to determine priority. Messages with high time sensitivity can be dynamically prioritized, and backend sending resources are coordinated to ensure timeliness and success rate, thereby improving customer satisfaction. Furthermore, a resource allocation algorithm centralizes dispersed message sending resources into a shared resource pool, allowing idle IOD connections to be utilized during busy periods, improving the utilization rate of scarce IT resources and simultaneously enhancing message delivery rate and timeliness.
[0045] It should be noted that the message priority dynamic adjustment method implemented in this application is illustrated by configuring a message priority dynamic adjustment device. This message priority dynamic adjustment method 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 can be any device with computing capabilities, such as a personal computer (PC) and various terminals. The terminals can be hardware devices with various operating systems and input / output devices.
[0047] It should also be noted that, in order to more clearly explain the implementation process of the dynamic message priority adjustment method of this application, the various modules, programs and technologies involved in the dynamic message priority adjustment method of this application will be explained below.
[0048] Message receiving program: Its function is to receive messages through a unified entry point. The system uses a container pod to host the receiver module, which receives SMS 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 receiving messages from the front end, the message receiving program sends the messages to the Kafka cluster, and then places them into different Kafka queues according to different business needs for buffering, so as to facilitate subsequent processing.
[0050] Priority-based intelligent scheduling: Based on various configuration items, such as message priority, business timeliness sensitivity, message queue backlog, IOD account resource pool idle status, and end-user receiving strategy, the intelligent scheduling algorithm prioritizes message templates, dynamically allocates resources for high-priority message sending modules, and adjusts resources such as the number of connections and concurrency in the resource pool. This ensures that there is no backlog of real-time high-priority messages during peak periods, that backend converged gateway resources are not blocked, and that low-priority SMS messages are released smoothly.
[0051] Dynamic resource allocation: Message sending resources, such as the number of IOD connections and the number of concurrent message sending processes, are managed uniformly in a resource pool. They can be dynamically allocated during sending to achieve optimal utilization of message sending resources during peak business periods.
[0052] Production-side scanning program: Production-side applications support dynamic adaptation of scanning directories and sending queues.
[0053] Consumer-side sending program: The consumer application supports consumption queues and dynamic adaptation of IOD accounts.
[0054] The following description, with reference to the accompanying drawings, describes a method, apparatus, and device for dynamically adjusting message priority according to embodiments of the present invention.
[0055] Figure 1 This is a flowchart of a method for dynamically adjusting message priority according to an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0056] Step S101: Receive various types of messages sent by the business system, and send each type of message to the corresponding message queue according to the message type.
[0057] Specifically, the message receiving program receives various types of messages sent by the front-end business system, and then, according to the message type, sends each type of message to a pre-defined message queue corresponding to that type of message for further processing.
[0058] The push message business system applicable to this application can be various front-end business systems, such as communication service support systems. The received messages can contain multiple types, specifically determined by the push message business system.
[0059] For example, a communication service support system receives various types of messages sent by the service system, including: receiving real-time interface call message data through real-time interface calls, and obtaining directory file data through a file scanning program.
[0060] In this embodiment, as Figure 2 As shown, the communication service support system supports receiving two types of messages. The first type is received via real-time interface calls, where the receiver-service application receives real-time interface call message data and stores it in the corresponding Kafka queue. The second type is receiving file data, where the schedule-service scanning program obtains directory file data transmitted from the peer's SFTP server, scans it, and then transmits it to the corresponding Kafka queue.
[0061] A Kafka cluster contains multiple broker modules, and each broker module contains multiple partitions.
[0062] In one embodiment of this application, before sending each type of message to the corresponding message queue, the method further includes: encrypting multiple types of messages, and determining whether the multiple types of messages have passed authentication based on the encryption result.
[0063] Specifically, in this embodiment, after the message receiving program receives the message, the sender first encrypts the message and its private key to obtain a digital signature. Then, after obtaining the signature from the message center, it encrypts the original text and its public key, and compares it with the obtained digital signature. If the two match, authentication is successful. The authenticated message is then sent to the corresponding Kafka message queue according to its message type. This embodiment ensures the accuracy and reliability of subsequent messages through preliminary authentication processing.
[0064] Step S102: Collect the message sending resources of each message sending node into the shared resource pool. Based on the dynamic resource allocation algorithm, dynamically allocate initial processing resources to each consumer node from the shared resource pool. The consumer node corresponds to the message in the message queue.
[0065] Specifically, this application uses a dynamic resource allocation algorithm to dynamically allocate initial processing resources to each message in the processing queues of multiple message processing programs. When allocating processing resources, this application first includes the sending resources of the target node sending the message, such as the number of information object definitions (IODs), connection count, and concurrency count, into a unified shared resource pool. This allows different sending programs to share the resources in this pool, avoiding situations where some sending nodes are busy while others are idle, thus maximizing message delivery rate.
[0066] In one embodiment of this application, the initial processing resources are dynamically allocated to each consumer node from a shared resource pool, including: constructing initial configuration data for the shared resource pool so that different message sending programs can share the resources in the shared resource pool; and determining the initial processing resources allocated to each consumer node corresponding to each message based on the initial configuration data and the business status corresponding to each message.
[0067] Specifically, in this embodiment, initial data configuration is performed first. The initial configuration data for building the shared resource pool includes: building SMS consumer configuration and IOD account resource configuration. 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 assign different IOD accounts to the shared resource pool. The SMS consumer configuration includes the consumer name, detailed consumer configuration, and consumer group. The SMS consumer configuration is used to associate the consumer program with the IOD account resource group.
[0068] Specifically, IOD account resource configuration enables resource sharing by grouping different IOD accounts into the same resource group. SMS consumers are configured to associate their consumer programs with the IOD account resource groups to access shared resources.
[0069] For example, the specific data for the constructed SMS consumer configuration is shown in Table 1 below.
[0070] Table 1 SMS Consumer Configuration Table
[0071]
[0072] In Table 1, the first column is the consumer name, the second column is the detailed consumer configuration, and the third column is the consumer group. The second column, detailed consumer configuration (DICTNAME), currently consists of five fields, separated by "~". The meanings of each field are as follows:
[0073] The first field represents the number of consumer instances, which is equivalent to how many of all PODs belong to this consumer group. The second field represents the consumption queue. The third field represents the IOD account group to which it belongs, corresponding to the "IOD account group dictionary". The fourth field represents the required number of IOD connections, used to allocate a certain connection quota from the IOD account group. The fifth field represents the speed limit for each IOD connection.
[0074] The specific data for the constructed IOD account resource configuration is shown in Table 2 below.
[0075] Table 2 IOD Account Resource Configuration
[0076]
[0077] In Table 2, the first column 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, account configuration (DICTNAME), consists of 5 fields, separated by "~". The meanings of each field are as follows:
[0078] The first field indicates the maximum number of connections allowed for 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 initial configuration and combined with real-time business conditions, processing resources can be dynamically allocated to multiple nodes.
[0080] To more clearly illustrate the specific implementation process of allocating initial processing resources to the consumer node corresponding to each message based on the initial configuration data and the business status corresponding to each message, the following is an exemplary description of a processing resource allocation method proposed in one embodiment of this application.
[0081] Figure 3This is a flowchart illustrating a method for dynamically allocating resources according to an embodiment of this application. Figure 4 The following is a schematic diagram illustrating the implementation principle of this allocation method, as shown below. Figure 3 As shown, the method includes the following steps:
[0082] Step S301: Load the initial configuration data into the memory library and configure a distributed lock for the target consumer node to be processed.
[0083] Specifically, when the message handler starts, it requests resources from the resource sharing program. The resource sharing program's algorithm for resource allocation is implemented as follows: Figure 4 As shown, the initial configuration data is first loaded into the Redis in-memory database, and then the consumer node acquires the distributed lock.
[0084] Among them, the consumer node corresponding to the 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 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. Determine whether the resource quota is sufficient by comparing the number of concurrent connections with the number of shared connections.
[0086] Specifically, such as Figure 4 As shown, the allocated IOD account resource group information is retrieved from the Redis in-memory database. This resource group information was obtained during the IOD account resource configuration described above. Then, the required number of concurrent connections is calculated based on business conditions such as peak traffic during busy periods.
[0087] For example, if the business message being processed requires a throughput of 1000 transactions per second during peak hours, then the number of concurrent connections needed to achieve this peak throughput can be calculated to be 200.
[0088] Furthermore, based on the calculated number of concurrent connections, it is checked whether the shared connection resource quota in the IOD account resource group is sufficient. The calculated number of concurrent connections is compared with the number of shared connections in the IOD account resource group. If the number of shared connections in the IOD account resource group is greater than the required number of concurrent connections, it indicates that the remaining quota of shared connection resources is sufficient to allocate the required processing resources to the current target consumer node.
[0089] Step S303: If 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 database, 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 necessary processing resources are allocated to the consumer node. Meanwhile, if... Figure 4 As shown, update the allocated resource information in the Redis memory database, determine the remaining quota in the current IOD account resource group, and perform the judgment in step S302 on the next consumer node based on 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 to allow for subsequent processing.
[0092] Step S304: If the resource quota is insufficient, reapply for an IOD account and the corresponding number of connections, add the reapplying IOD account and the corresponding number of connections to the IOD account resource group, and re-determine the resource quota.
[0093] Specifically, if the number of shared connections in the resource group is insufficient, that is, if the number of shared connections in the IOD account resource group is less than the required number of concurrent connections, then it is necessary to apply for a new account and corresponding number of connections from the IOD and assign the account and corresponding number of connections to the resource group.
[0094] Furthermore, repeat step S302 above, and re-determine whether the resource quota is sufficient based on the updated number of connections in the IOD account resource group in the manner described in step S302, until the entire resource allocation process ends.
[0095] Therefore, this application allocates a corresponding initial processing resource to each consumer node. The message processing program initiates a connection to the IOD based on the number of connections obtained, and performs processing such as formal message sending.
[0096] Step S103: Process each message according to the initial processing resources, and collect the parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing. Determine whether to dynamically adjust the priority of each message based on the parameter values of multiple adjustment configuration items.
[0097] Specifically, during the process of message processing by the message processing program based on the initial processing resources, problems in the operation of the business system may arise, such as manually adjusting message priority and timeliness sensitivity, or queue backlog caused by a large increase in business volume. Therefore, the priority intelligent scheduling program of this application will dynamically adjust the priority of each message based on the real-time parameter values of multiple judgment dimensions (i.e. configuration items). By scheduling the sending priority of each message in real time, the program aims to smooth out peaks and valleys and ensure the smooth operation of various businesses.
[0098] Among them, multiple adjustment configuration items are determined based on factors such as the type of business system pushing messages. For example, in the embodiment of this application, when targeting the 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 this application, determining whether to dynamically adjust the priority of each message based on the parameter values of multiple adjustment configuration items includes: first, performing a weighted calculation on multiple adjustment configuration items based on the parameter value and preset weight of each adjustment configuration item to obtain a weighted value; comparing the weighted value with a preset adjustment threshold, and adjusting the priority of messages with a weighted value greater than the adjustment threshold to high priority.
[0100] Specifically, in this embodiment, when dynamically adjusting priorities, the dimension parameter values can be configured in real time based on the actual detection results, and configuration items can be dynamically added. The message priority adjustment is determined based on 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 can be selected from multiple configuration items. The parameter values of the default priority, business timeliness sensitivity, and IOD account resource idle status can be read from the Redis memory database, and the message queue backlog status can be obtained by detecting the Kafka message queue where this message is located.
[0101] Furthermore, by applying a weighted algorithm to the obtained configuration parameter values, it is determined whether there is a business bottleneck in the sending of this real-time message, and then the priority of the real-time message template is dynamically adjusted, and the priority of messages with business bottlenecks is dynamically adjusted.
[0102] For example, the priority-based intelligent scheduler retrieves the default priority of message configuration from the database configuration table, then obtains the current backlog value and time sensitivity of the message queue, and performs a weighted calculation on the three configuration items: default priority, time sensitivity, and average queue backlog. For instance, assuming the default priority is 3, the time sensitivity is 100, and the average queue backlog is 100, the preset weights corresponding to each dimension are obtained, and the real-time parameter value of each configuration item is multiplied by the corresponding weight to calculate the weighted value, i.e., 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 message templates 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 adjust and add message processing programs according to the general algorithm of dynamic resource allocation, process the consumption queue corresponding to the message template with the previously dynamically adjusted priority, thereby increasing message processing capacity and improving message delivery rate and timeliness.
[0104] It should be noted that the configuration items added during the judgment can be determined based on the current actual situation, and the weight of each configuration item can be determined based on the message adjustment needs of different business systems and the characteristics of the current business messages, etc. This application does not impose any restrictions on this.
[0105] Step S104: For the high-priority messages obtained from the adjustment, increase the processing resources of the consumer nodes corresponding to the high-priority messages.
[0106] Specifically, for messages adjusted to high priority, the priority scheduler uses a dynamic resource allocation algorithm to increase the processing resources of the consumer nodes corresponding to the high priority messages, such as the number of IOD connections and concurrency resources, to ensure business continuity and timeliness, and to ensure that high priority messages are not backed up during peak periods.
[0107] As one possible implementation, a dynamic resource allocation process for processing high-priority messages is added, such as... Figure 5 As shown. Assuming the SMS consumer configuration is: 2 ~ online ~ IOD_GROUP_ONLINE ~ 6 ~ 100, the message processing program's dynamic resource allocation algorithm allocates two consumer processing nodes to the ONLINE queue for message processing according to the default configuration. When the workload increases, if the queue backlog increases and the weighted value is greater than 80, the priority of this service is increased. When the dynamic resource task detects in real time that this service needs additional resource processing, it first checks whether the resources in the shared resource pool are sufficient. If sufficient, it can add more consumer processing nodes to process messages for the ONLINE queue. If insufficient, it increases the processing resources of the consumer nodes corresponding to the high-priority message by requesting more processing resources.
[0108] In one embodiment of this application, increasing the processing resources of the consumer node corresponding to a high-priority message by requesting more processing resources 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 replicas of the consumer processing node corresponding to the high-priority message through the service platform; and locking the number of IOD account connections of the consumer processing node; after the priority of the high-priority message decreases, reducing the number of pod replicas of the consumer processing node through the service platform and releasing the IOD account connection resources of the consumer processing node.
[0109] Specifically, in this embodiment, the task requesting the addition of dynamic resources sends a request to the PaaS (Platform as a Service) platform to add the minimum deployment unit (pod) of the application. After receiving the request, the PaaS platform dynamically increases the number of pod replicas of the message processing node. Here, a pod can contain multiple containers, and the number of pod replicas 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 for that consumer processing node will be locked to prevent the number of IOD account connections from decreasing due to various reasons, and to ensure that the number of IOD account connections meets the requirements.
[0111] Furthermore, the above operations enhance the processing capacity of the consumer processing node. In practical applications, when the priority of a high-priority message decreases due to factors such as reduced backlog, the PaaS platform can be notified to reduce the number of pod replicas 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, this application realizes the dynamic adjustment of message sending priority, which can efficiently process message templates with different timeliness requirements separately, allocate IOD resources in a timely manner for message sending during peak business periods, improve the timeliness and success rate of message sending, enhance user experience, and be applicable to messages of various business systems in practical applications, thus enriching application scenarios.
[0113] In summary, the message priority dynamic adjustment method of this application embodiment can dynamically add and adjust configuration items and obtain real-time configuration item parameter values. By applying a weighted algorithm to the configuration item parameter values, it can determine whether there are business bottlenecks in real-time message sending, thereby dynamically adjusting the priority of message templates. By increasing the processing resources of consumer nodes corresponding to high-priority messages through a priority scheduler, including adjusting the number of connections and concurrency in the converged gateway resource pool, it ensures that high-priority messages are matched with advanced resources during peak periods, and low-priority SMS messages are matched with ordinary resources, thereby ensuring business continuity and timeliness and improving user satisfaction. Furthermore, this method also centralizes the dispersed message sending resources into a unified shared resource pool through a resource allocation algorithm. Different sending programs can share the resources in the resource pool, and idle IOD connections can be utilized during busy periods, avoiding situations where some sending nodes are busy and others are idle, improving the utilization rate of scarce IT resources, and maximizing the delivery rate and timeliness of business messages. Therefore, this method can dynamically adjust message priorities based on multiple judgment dimensions and achieve message sending resource sharing, improving the accuracy of message priority adjustment and resource utilization.
[0114] To implement the above embodiments, this application also proposes a dynamic message priority adjustment device. Figure 6 This is a schematic diagram of the structure of a dynamic message priority adjustment device proposed in an embodiment of this application, as shown below. Figure 6 As shown, the device includes a receiving module 100, a first distribution module 200, a dynamic adjustment module 300, and a second distribution module 400.
[0115] The receiving module 100 is used to receive various types of messages sent by the business system and send each type of message to the corresponding message queue according to the message type.
[0116] The first allocation module 200 is used to centrally incorporate the message sending resources of each message sending node into a shared resource pool. Based on a dynamic resource allocation algorithm, it dynamically allocates initial processing resources to each consumer node from the shared resource pool. The consumer node corresponds to a 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 the parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing. Based on the parameter values of multiple adjustment configuration items, it determines whether to dynamically adjust the priority of each message.
[0118] The second allocation module 400 is used to increase the processing resources of the consumer node corresponding to the high-priority message for the adjusted high-priority message.
[0119] In one embodiment of this application, the first allocation module 200 is specifically used to: construct initial configuration data for 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 status corresponding to each message.
[0120] In one embodiment of this application, the first allocation module 200 is specifically used to: construct SMS consumer configuration and information object definition (IOD) account resource configuration; wherein, the IOD account resource configuration includes IOD account name, account configuration and resource group to which the account belongs, and the IOD account resource configuration is used to assign different IOD accounts to the shared resource pool; the SMS consumer configuration includes 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 this application, the first allocation module 200 is specifically used for: loading initial configuration data into a memory library, configuring a distributed lock for the target consumer node to be processed; calculating the required number of concurrent connections based on the peak business volume corresponding to the message to be processed, and reading the shared connection number from the IOD account resource group in the memory library, and determining 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 the 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 an IOD account and the corresponding number of connections, adding the reapplying IOD account and the corresponding number of connections to the IOD account resource group, and re-determining the resource quota.
[0122] In one embodiment of this application, the dynamic adjustment module 300 is specifically used to: perform a weighted operation 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 messages with a weighted value greater than the adjustment threshold to high priority.
[0123] In one embodiment of this application, the second allocation module 400 is specifically used to: send a request to the service platform to add a pod, the smallest deployment unit of a high-priority message; dynamically increase the number of pod replicas 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, reduce the number of pod replicas of the consumer processing node through the service platform and release the IOD account connection resources of the consumer processing node.
[0124] In one embodiment of this application, the receiving module 100 is specifically used to: receive real-time interface call message data through real-time interface calls, and obtain directory file data through a file scanning program; encrypt various types of messages, and determine whether various types of messages have passed authentication based on the encryption results.
[0125] It should be noted that the explanation of the aforementioned embodiment of the dynamic message priority adjustment method also applies to the apparatus of this embodiment, and will not be repeated here.
[0126] In summary, the message priority dynamic adjustment device of this application embodiment can dynamically adjust the message priority 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] To implement the above embodiments, this 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 executable instructions of the processor 710; wherein the processor 710 is configured to execute instructions to implement a dynamic message priority adjustment method as described in any one of the first aspect embodiments above.
[0128] To implement the above embodiments, this application also proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for dynamically adjusting message priority as described in any one of the first aspects of the embodiments above.
[0129] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0130] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0131] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0133] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0134] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0135] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0136] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A method for dynamically adjusting message priority, characterized in that, Includes the following steps: Receive various types of messages from the business system and send each type of message to the corresponding message queue according to the message type; The message sending resources of each message sending node are centrally incorporated into a shared resource pool. Based on a dynamic resource allocation algorithm, initial processing resources are dynamically allocated to each consumer node from the shared resource pool, wherein each consumer node corresponds to a message in the message queue. Each message is processed according to the initial processing resources, and the parameter values of multiple adjustment configuration items corresponding to each message are collected in real time during the processing. Based on the parameter values of the multiple adjustment configuration items, it is determined whether to dynamically adjust the priority of each message. The multiple adjustment configuration items include: default priority, business timeliness sensitivity, message queue backlog status, IOD account resource idle status, and end-user receiving strategy. The step of determining whether to dynamically adjust the priority of each message based on the parameter values of the multiple adjustment configuration items includes: performing a weighted calculation on the multiple adjustment configuration items based on the parameter value and preset weight of each item to obtain a weighted value; comparing the weighted value with a preset adjustment threshold; and adjusting the priority of messages whose weighted value is greater than the adjustment threshold to high priority. For high-priority messages obtained through adjustment, increase the processing resources of the consumer node corresponding to the high-priority message.
2. The method according to claim 1, characterized in that, The step of dynamically allocating initial processing resources to each consumer node from the shared resource pool includes: The initial configuration data for the shared resource pool is constructed so that different message sending programs can share the resources in the shared resource pool; Based on the initial configuration data and the business status corresponding to each message, the initial processing resources allocated to the consumer node corresponding to each message are determined.
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 message object definition (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 assign different IOD accounts to the shared resource pool. The SMS consumer configuration includes consumer name, detailed consumer configuration, and consumer group. The SMS consumer configuration is used to associate the consumer program with the IOD account resource group.
4. The method according to claim 3, characterized in that, The step of determining the initial processing resources allocated to the consumer node corresponding to each message based on the initial configuration data and the business status corresponding to each message includes: The initial configuration data is loaded into the memory library, and a distributed lock is configured for the target consumer node to be processed. The required number of concurrent connections is calculated based on the peak business volume corresponding to the current pending message, and the number of shared connections in the IOD account resource group is read from the memory library. The resource quota is then compared with the number of concurrent connections to determine whether the resource quota is sufficient. If 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 bank, and release the distributed lock; If the resource quota is insufficient, reapply for an IOD account and the corresponding number of connections, add the reapplying IOD account and the corresponding number of connections to the IOD account resource group, and re-determine the resource quota.
5. The method according to claim 1, characterized in that, The increase in processing resources for the consumer node corresponding to the high-priority message includes: Send a request to the service platform to add the smallest deployment unit pod of the high-priority message, dynamically increase the number of pod replicas 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 is reduced, the service platform reduces the number of pod replicas of the consumer processing node and releases the IOD account connection resources of the consumer processing node.
6. The method according to claim 1, characterized in that, The various types of messages sent by the receiving service system include: The system receives real-time interface call message data via real-time interface calls and obtains directory file data through a file scanner. Before sending each message to its corresponding message queue, the process also includes: The various types of messages are encrypted, and the authentication status of the messages is determined based on the encryption results.
7. 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 type of message to the corresponding message queue according to the message type. The first allocation module is used to centrally incorporate 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 a message in the message queue; The dynamic adjustment module is used to process each message according to the initial processing resources, and to collect the parameter values of multiple adjustment configuration items corresponding to each message in real time during the processing. Based on the parameter values of the multiple adjustment configuration items, it determines whether to dynamically adjust the priority of each message. The multiple adjustment configuration items include: default priority, business timeliness sensitivity, message queue backlog status, IOD account resource idle status, and end-user receiving strategy. The step of determining whether to dynamically adjust the priority of each message based on the parameter values of the multiple adjustment configuration items includes: performing a weighted calculation on the multiple adjustment configuration items based on the parameter value and a preset weight to obtain a weighted value; comparing the weighted value with a preset adjustment threshold, and adjusting the priority of messages whose weighted value is greater than the adjustment threshold to high priority. The second allocation module is used to increase the processing resources of the consumer node corresponding to the high-priority message for the adjusted high-priority message.
8. An electronic device, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement a dynamic message priority adjustment method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for dynamically adjusting message priority as described in any one of claims 1-6.
Citation Information
Patent Citations
Message processing method, device and equipment
CN115550284A
Message asynchronous processing method, system and device and storage medium
CN117909096A