Multi-user concurrent message processing method, device and equipment
By combining multi-objective optimization algorithms and consistent hashing algorithms with reinforcement learning algorithms, the problems of uneven load and real-time requirements in large-scale instant messaging and collaborative office applications are solved, achieving efficient message processing and load balancing, and improving system stability and collaboration efficiency.
Patent Information
- Application Number
- CN202511146459.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies face challenges in handling real-time data streams in large-scale instant messaging and collaborative office applications, such as frequent user updates, uneven load distribution, real-time response requirements, and multi-functional support, resulting in insufficient system performance and scalability.
Multi-objective optimization and consistent hashing algorithms are used to prioritize and load balance message requests. Reinforcement learning algorithms are combined to dynamically adjust resource allocation. Parallel message processing is performed through a concurrent processing engine. Message distribution is optimized using a spatiotemporal traffic awareness module and an intelligent message scheduling module.
It improves the performance of multi-user concurrent message processing, reduces latency and conflicts, ensures the reliability of message delivery, and dynamically adjusts task allocation strategies to improve system stability and collaboration efficiency.
Smart Images

Figure CN120915752A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of concurrent message processing, and particularly to a multi-user concurrent message processing method, device and equipment. BACKGROUND
[0002] In modern office environments, instant messaging (IM) and collaborative office applications have become the core tools for team communication and cooperation. These applications often involve large-scale user groups who frequently interact at different times and locations, such as message transmission, file sharing, and video conferencing. These user behaviors generate a large amount of instant data streams, which can also be regarded as "spatial data streams". For example, in a global office network of a large enterprise, employees' real-time messages and file transfer requests are frequently generated and transmitted to the data center.
[0003] However, existing technologies face several major challenges in handling these large instant data streams:
[0004] 1. Frequent user updates: In IM communication applications, user status, messages, and file transfer information need to be frequently updated and synchronized. Especially in large enterprises, there are thousands or even millions of information updates per second, which means that the amount of data updates is extremely large.
[0005] 2. Uneven load distribution: The load distribution of user interaction is extremely uneven in time and space. For example, the activity frequency of users will change significantly during working hours and non-working hours; at the same time, there are also great differences in user density among different departments or regions. This requires the system to have good horizontal expansion and load balancing capabilities to cope with large amounts of data requests during peak periods.
[0006] 3. Real-time response requirements: In order to ensure user experience, the system needs to be able to handle and respond to various user requests in real time, including instant message transmission, file synchronization, and low-latency support for video conferencing. Therefore, the system needs to have excellent real-time performance and low-latency processing capabilities.
[0007] 4. Multi-function support: IM communication and collaborative office applications usually involve multiple functions, such as message transmission, file sharing, task management, and scheduling. These functions require comprehensive processing capabilities of the system, and a unified solution is needed to manage these diverse user needs, rather than relying on multiple independent systems to complete different functions.
[0008] Although existing systems have made some progress in handling large-scale user interactions and real-time data streams in instant messaging and collaborative office applications, their performance and scalability still have deficiencies. Therefore, there is an urgent need for a multi-user concurrent message processing method that can adapt to changes in space-time traffic to optimize system performance, improve user experience, and reduce operating costs. SUMMARY
[0009] The technical problem to be solved by the present application is to provide a multi-user concurrent message processing method, device and equipment, aiming to improve the concurrent message processing performance.
[0010] In a first aspect, a multi-user concurrent message processing method is provided, comprising:
[0011] Performing real-time traffic analysis and future traffic prediction on the real-time acquired user interaction messages to obtain future traffic prediction data;
[0012] According to the future traffic prediction data, using a multi-objective optimization algorithm to calculate the processing priority order of the message requests;
[0013] According to the processing priority order of the message requests, distributing the message requests through a consistent hashing algorithm to balance the load of the message requests on different processing nodes to obtain a message distribution plan;
[0014] According to the node load information, using a reinforcement learning algorithm to dynamically adjust resource allocation to obtain real-time resource allocation results and load balancing strategies;
[0015] According to the message distribution plan, real-time resource allocation results and load balancing strategies, executing parallel message processing through a concurrent processing engine.
[0016] In a second aspect, a multi-user concurrent message processing device is provided, comprising:
[0017] A space-time traffic sensing module for performing real-time traffic analysis and future traffic prediction on the real-time acquired user interaction messages to obtain future traffic prediction data;
[0018] An intelligent message scheduling module for calculating the processing priority order of the message requests using a multi-objective optimization algorithm according to the future traffic prediction data;
[0019] A message distribution module for distributing the message requests through a consistent hashing algorithm to balance the load of the message requests on different processing nodes to obtain a message distribution plan according to the processing priority order of the message requests;
[0020] A resource allocation and load balancing module for dynamically adjusting resource allocation using a reinforcement learning algorithm to obtain real-time resource allocation results and load balancing strategies according to the node load information;
[0021] A concurrent processing engine execution module for executing parallel message processing through a concurrent processing engine according to the message distribution plan, real-time resource allocation results and load balancing strategies.
[0022] In a third aspect, a computer device is provided, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the multi-user concurrent message processing method as described above when executing the computer program.
[0023] In a fourth aspect, a storage medium is provided, which stores a computer program, and the computer program can implement the multi-user concurrent message processing method as described above when executed by a processor.
[0024] In the scheme implemented by the multi-user concurrent message processing method, device and equipment, real-time traffic analysis and future traffic prediction are performed on the real-time user interaction message to obtain future traffic prediction data; a multi-objective optimization algorithm is used to calculate the processing priority order of the message request according to the future traffic prediction data; the message request is distributed through a consistent hashing algorithm according to the processing priority order of the message request, the load of the message request in different processing nodes is balanced, and a message distribution plan is obtained; a reinforcement learning algorithm is used to dynamically adjust resource allocation according to node load information, and real-time resource allocation results and load balancing strategies are obtained; parallel message processing is performed through a concurrent processing engine according to the message distribution plan, the real-time resource allocation results and the load balancing strategies. In the present application, the multi-objective optimization algorithm and the consistent hashing algorithm are used to reduce the delay and conflict in multi-user concurrent processing, and to ensure the reliability of message transmission; the cooperative optimization algorithm is used to process potential cooperative conflicts, dynamically adjust the task allocation strategy, and improve the performance of concurrent message processing. BRIEF DESCRIPTION OF DRAWINGS
[0025] The specific structure of the present application will be described in detail below with reference to the accompanying drawings.
[0026] Figure 1 The application scenario of the multi-user concurrent message processing method of the embodiment of the present application is shown in the figure.
[0027] Figure 2 The flowchart of the multi-user concurrent message processing method of the embodiment of the present application is shown in the figure.
[0028] Figure 3 The space-time traffic sensing flowchart of the embodiment of the present application is shown in the figure.
[0029] Figure 4 The intelligent message scheduling flowchart of the embodiment of the present application is shown in the figure.
[0030] Figure 5 The message distribution flowchart of the embodiment of the present application is shown in the figure.
[0031] Figure 6 The resource allocation and load balancing flowchart of the embodiment of the present application is shown in the figure.
[0032] Figure 7Flowchart for concurrent processing engine execution of embodiments of the invention;
[0033] Figure 8 Flowchart for collaborative optimization of embodiments of the invention;
[0034] Figure 9 Block diagram of multi-user concurrent message processing apparatus of embodiments of the invention;
[0035] Figure 10 Block diagram of space-time traffic awareness module of embodiments of the invention;
[0036] Figure 11 Block diagram of intelligent message scheduling module of embodiments of the invention;
[0037] Figure 12 Block diagram of message distribution module of embodiments of the invention;
[0038] Figure 13 Block diagram of resource allocation and load balancing module of embodiments of the invention;
[0039] Figure 14 Block diagram of concurrent processing engine execution module of embodiments of the invention;
[0040] Figure 15 Block diagram of collaborative optimization module of embodiments of the invention;
[0041] Figure 16 Schematic block diagram of a computer device of embodiments of the invention. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0043] It should be understood that, when used in the specification and the appended claims, the terms "comprise" and "include" indicate the presence of described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0044] It should also be understood that the terms used herein in the specification and the appended claims are only for the purpose of describing particular embodiments and do not intend to limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0045] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0046] This application provides a method, apparatus, and device for multi-user concurrent message processing.
[0047] To facilitate understanding, the application scenarios to which the multi-user concurrent message processing method of this application embodiment is applicable will be introduced first.
[0048] like Figure 1 As shown, Figure 1 This is a schematic diagram illustrating an application scenario of the multi-user concurrent message processing method provided in this embodiment of the invention. The multi-user concurrent message processing method is applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server performs real-time traffic analysis and future traffic prediction on user interaction messages, obtaining future traffic prediction data. Based on the future traffic prediction data, a multi-objective optimization algorithm is used to calculate the processing priority order of message requests. According to the processing priority order of message requests, a consistent hashing algorithm is used to distribute message requests, balancing the load of message requests on different processing nodes, resulting in a message distribution plan. Based on node load information, a reinforcement learning algorithm is used to dynamically adjust resource allocation, obtaining real-time resource allocation results and a load balancing strategy. Based on the message distribution plan, real-time resource allocation results, and load balancing strategy, a concurrent processing engine executes parallel message processing. Based on the data processed by the concurrent processing engine, a collaborative optimization algorithm is used to detect potential collaborative conflicts and dynamically adjust the task allocation strategy. In this invention, multi-objective optimization and consistent hashing algorithms reduce latency and conflicts in multi-user concurrent processing, ensuring the reliability of message transmission; collaborative optimization algorithms handle potential collaborative conflicts and dynamically adjust task allocation strategies, improving the performance of concurrent message processing. The invention will be described in detail below through specific embodiments.
[0049] like Figure 2 As shown, this embodiment of the invention provides a method for processing concurrent messages from multiple users, including:
[0050] S10. Perform real-time traffic analysis and future traffic prediction on the user interaction messages acquired in real time to obtain future traffic prediction data.
[0051] In this embodiment, future traffic prediction data includes message interaction frequency and user activity.
[0052] like Figure 3 As shown, in a further embodiment, step S10 may include the following steps: S11-S14.
[0053] S11, input a user interaction message into the AGCRN model, the user interaction message including a message interaction matrix and a user feature matrix.
[0054] In this embodiment, the input of each time step t is the message interaction matrix At of the user and the user feature matrix Xt.
[0055] S12, extract the spatio-temporal relationship of the node from the message interaction matrix and the user feature matrix by using a graph convolution layer.
[0056] In this embodiment, the formula for extracting the spatio-temporal relationship of the node by using the graph convolution layer is as follows:
[0057] H(l+1) = σ(D-12AtD-12H(l)W(l));
[0058] Where H(l) is the node feature of the lth layer, W(l) is the weight matrix of the lth layer, D is the degree matrix, and sigma is the activation function.
[0059] S13, use a recurrent neural network to perform time series modeling according to the spatio-temporal relationship of the node, and output the spatial topology of the message interaction network.
[0060] In this embodiment, after the spatio-temporal relationship is extracted, a recurrent neural network (such as LSTM or GRU) is used to perform time series modeling, and the formula is as follows:
[0061] ht = LSTM(ht-1, H(l+1));
[0062] Where ht is the hidden state of time step t.
[0063] S14, output the future traffic prediction data of the spatial topology of the message interaction network through the STR model.
[0064] In this embodiment, the hidden state finally output by the STR model is used to predict the traffic distribution Yt of the future time step, which is used as the input of the subsequent step.
[0065] Before implementing steps S11-S13, spatio-temporal graph modeling needs to be performed in advance: assuming that the user set is U = {u1, u2, …, un}, the message interaction in the system can be represented as a spatio-temporal graph Gt = (V, Et), where V represents the user node, and Et represents the message interaction edge at time t. The weight of the edge represents the message frequency between users.
[0066] In this embodiment, an adaptive graph convolutional neural network (AGCRN) and a spatio-temporal regression model (STR) are combined to predict user traffic and message interaction frequency in future different spatio-temporal dimensions. The AGCRN is responsible for capturing complex spatial relationships between users, while the STR accurately predicts future traffic changes through temporal analysis. This dual prediction mechanism can improve the accuracy of traffic prediction.
[0067] The AGCRN is defined by the following formula:
[0068] H(l+1) = σ(∑r=1RPrH(l)Wr(l) + b(l));
[0069] where Pr is the graph structure generated by the adaptive graph generation module, H(l) is the input feature of the lth layer, Wr(l) and b(l) are the learnable weight matrix and bias vector respectively, and σ is the activation function.
[0070] The STR model is based on the following time series regression formula:
[0071] yt = ∑i=1pφiyt-i + ∑j=1qθj∈t-j + ∈t;
[0072] where yt is the predicted value at the current time, φi and θj are the coefficients of the autoregressive and moving average parts respectively, and ∈t is the error term.
[0073] In this embodiment, the combination of adaptive graph convolutional neural network and spatio-temporal regression model greatly improves the accuracy of traffic prediction.
[0074] S20, according to the future traffic prediction data, using multi-objective optimization algorithm to calculate the processing priority order of message request.
[0075] In this embodiment, in the high concurrency scenario, through the multi-objective optimization algorithm, the messages are processed in a reasonable order to minimize the delay and conflict.
[0076] As shown in Figure 4 in a further embodiment, the step S20 can include the following steps: S21-S24.
[0077] S21, set multi-objective function, including message delay minimization function and high priority message processing priority maximization function.
[0078] In this embodiment, the objective function: the goal of scheduling is to minimize the delay Ld and the conflict Lc, and to maximize the stability Ls of the system. The comprehensive objective function is:
[0079] L = αLd + βLc - γLs;
[0080] Wherein, a, b, g are weight parameters, which can be determined by historical data training.
[0081] S22, according to the future traffic prediction data, different weights are assigned to each type of user request.
[0082] S23, a non-dominated sorting genetic algorithm or a multi-objective evolutionary algorithm is used for multi-objective solution to obtain a set of Pareto optimal solutions.
[0083] In this embodiment, the non-dominated sorting genetic algorithm is NSGA-II, and the multi-objective evolutionary algorithm is MOEA / D,
[0084] S24, select the optimal solution from the Pareto solution set to generate the processing priority order of message requests.
[0085] In this embodiment, based on the traffic prediction result, an adaptive message scheduling algorithm (AMSA) is designed, which dynamically adjusts the priority and routing strategy of message processing to ensure the communication quality in high concurrency scenarios. AMSA introduces a message priority function and a dynamic routing table, which can optimize the distribution path of messages between different nodes in real time.
[0086] The message priority function is defined as:
[0087] Pm=a·Tm+b·Lm+g·Um;
[0088] Wherein, Pm is the priority of message m, Tm is the timeliness of the message, Lm is the load coefficient of the message, Um is the importance of the user, a, b and g are adjustable weight parameters.
[0089] The update strategy of the dynamic routing table is based on the following formula:
[0090]
[0091] Wherein, Rn(t) is the routing table of node n at time t, is the gradient update direction, and η is the learning rate.
[0092] In this embodiment, by dynamically adjusting the message priority and the routing table, efficient message processing in high concurrency scenarios is realized.
[0093] S30, according to the processing priority order of the message request, the message request is distributed through a consistent hash algorithm, the load of the message request in different processing nodes is balanced, and a message distribution plan is obtained.
[0094] In this embodiment, in a high concurrency scenario, to realize stable message transmission, the load balancing algorithm is used to reasonably distribute messages to different processing nodes.
[0095] As Figure 5 shown, in further embodiments, the step S30 can include the following steps: S31-S34.
[0096] S31, real-time monitoring of key performance indicators of each node, including but not limited to CPU usage, memory usage, network delay.
[0097] S32, using a consistent hashing algorithm to distribute concurrent message requests to multiple processing nodes, ensuring that each message request has a fixed processing node.
[0098] S33, when detecting that the load of a node is too high, using a load balancing strategy (such as round robin, least connection number) to reassign part of the message requests.
[0099] In this embodiment, dynamic load balancing: using a consistent hashing algorithm (Consistent Hashing) to distribute messages to different processing nodes to reduce the problem of uneven load. The formula is:
[0100] h(m) = Hash(m) mod N;
[0101] Where m is the message, and N is the number of available processing nodes.
[0102] S34, using reinforcement learning algorithm to learn load redistribution strategy, gradually optimizing message distribution through feedback mechanism, and obtaining message request distribution plan.
[0103] In this embodiment, according to the priority of the message request, the distribution order of the message request between different nodes is adjusted to ensure that high-priority message requests are processed in time.
[0104] S40, according to the node load information, using reinforcement learning algorithm to dynamically adjust resource allocation, obtaining real-time resource allocation result and load balancing strategy.
[0105] In this embodiment, using the traffic prediction result to dynamically adjust resource allocation during peak period to ensure the stability of the system under different loads.
[0106] As Figure 6 shown, in further embodiments, the step S40 can include the following steps: S41-S44.
[0107] S41, real-time monitoring of current resource usage and availability.
[0108] S42, according to the future traffic prediction data, estimate the resource usage peak, and allocate sufficient resources in advance to cope with peak load.
[0109] S43, according to the actual and predicted resource demand, adjust the resource allocation strategy combined with reinforcement learning algorithm to ensure dynamic adjustment of resources when resources are insufficient or overloaded. In this embodiment, the resource scheduling strategy is based on the reinforcement learning algorithm, and the Q-learning method is used to adjust the resource allocation strategy. The Q-learning formula is:
[0110] Q(s,a)=Q(s,a)+α[r+γa′maxQ(s′,a′)-Q(s,a)];
[0111] Where s is the current system state, a is the resource allocation action, r is the immediate reward, a is the learning rate, and g is the discount factor.
[0112] S44, when the load increases or decreases beyond the preset threshold, automatically expand or shrink the resource instance through containerization technology to obtain real-time resource allocation results and load balancing strategy.
[0113] In this embodiment, the resource utilization of different nodes is adjusted through reinforcement learning to ensure efficient use of resources and stability of the system in high concurrency scenarios.
[0114] In this embodiment, a hybrid granularity-based load balancing algorithm (HGLB) is proposed, which considers the spatiotemporal distribution characteristics of user requests and reduces system bottleneck problems by dynamically adjusting the load distribution strategy between nodes. HGLB introduces a multi-level load balancing strategy, combining coarse-grained (region-based) and fine-grained (user-based) load scheduling methods.
[0115] Coarse-grained load balancing strategy:
[0116] Lregion=1N∑i=1NWi·Di;
[0117] Where Lregion is the regional load balancing degree, Wi is the weight of the i-th region, Di is the traffic density of the region, and N is the number of regions.
[0118] Fine-grained load balancing strategy:
[0119] Luser=min(∑j=1MTjCj);
[0120] Where Luser is the user-level load balancing degree, Tj is the task load of j, Cj is the available computing resource, and M is the number of users.
[0121] In this embodiment, the load balancing at the regional and user levels is comprehensively considered, effectively reducing the system bottleneck problem.
[0122] S50, according to the message distribution plan, real-time resource allocation result and load balancing strategy, executing parallel message processing through concurrent processing engine.
[0123] In this embodiment, the multi-user message request is processed according to the priority message and load balancing allocation strategy, ensuring the system response speed.
[0124] As shown in Figure 7 In further embodiments, the step S50 can include the following steps: S51-S54.
[0125] S51, analyze the message request and assign it to the appropriate processing thread or microservice instance.
[0126] In this step, whenever a new message is received, the processing engine will first check the message priority and process it according to the pre-set strategy (such as FIFO, priority-based queue).
[0127] S52, use thread pool or coroutine concurrent processing mechanism to execute multiple message requests simultaneously in a multi-processor environment.
[0128] In this step, task decomposition and parallel processing technology is used to divide large tasks into multiple sub-tasks and process them in parallel to improve efficiency. The optimization of message processing time can be expressed by the formula:
[0129] Ttotal=max i=1,…,nTi+∑i=1nTcomm,i;
[0130] Where Ti is the processing time of the ith sub-task, and Tcomm,i is the communication time between sub-tasks.
[0131] S53, when an error or timeout occurs in a certain thread, automatically trigger the fault recovery mechanism to reassign the task to other available threads.
[0132] S54, under the action of load balancing feedback mechanism, automatically adjust the number of concurrent tasks.
[0133] S60, according to the concurrent processing engine processing data, through the cooperation optimization algorithm, detect potential cooperation conflicts, dynamically adjust the task allocation strategy.
[0134] In this embodiment, through the path optimization and conflict detection algorithm, the multi-user cooperation efficiency is improved, and resource conflicts are avoided.
[0135] As shown in Figure 8As shown, in further embodiments, the step S60 can include the following steps: S61-S63.
[0136] S61, based on the spatiotemporal traffic analysis results, predict the high-frequency path of user interaction, such as the message flow path within the project group.
[0137] S62, analyze the interaction paths of different users using path optimization algorithms, and detect possible resource competition or process conflicts.
[0138] In this embodiment, the path optimization algorithm is, for example, Dijkstra's shortest path algorithm or A* algorithm.
[0139] Collaboration path optimization: using the shortest path algorithm (such as Dijkstra's algorithm) to optimize the task allocation and execution path between team members, reducing the bottleneck in collaboration. The formula is:
[0140] d(u,v)=min(u,v)∈E∑(u,v)∈Pw(u,v);
[0141] where d(u,v) is the shortest path distance between nodes u and v w(u,v) is the weight of the edge.
[0142] Conflict detection and resolution: through the collaboration conflict detection algorithm, potential collaboration conflicts are identified in advance, and dynamic adjustment is made through task redistribution strategy to ensure smooth collaboration process.
[0143] S63, for potential conflicts, dynamically adjust the task allocation collaboration path and re-plan the collaboration link.
[0144] In this embodiment, the optimized collaboration strategy is used for the improvement and optimization of the overall collaboration flow of the system.
[0145] In this embodiment, the collaboration strategy is dynamically optimized based on the predicted traffic, and a spatiotemporal-aware collaboration optimization algorithm (Spatiotemporal-Aware Collaboration Optimization, STACO) is introduced. STACO predicts the collaboration peak period and adjusts the allocation and coordination strategy of collaboration tasks to maximize collaboration efficiency and resource utilization. This module integrates multi-objective optimization methods to realize dynamic scheduling of user collaboration.
[0146] Collaboration optimization objective function:
[0147] O(C)=∑k=1Kλk·Fk(C);
[0148] where O(C) is the optimization objective function, Fk(C) is the kth optimization objective, λk is the corresponding weight coefficient, C is the allocation scheme of the collaboration task, and K is the number of objectives.
[0149] In this embodiment, by dynamically adjusting the cooperation strategy, the cooperation efficiency and resource utilization are maximized, and the overall performance of the system is improved.
[0150] In summary, the method improves resource utilization efficiency and system stability by using the AGCRN model to perceive and predict system traffic in real time; reduces delay and conflict in multi-user concurrent processing through multi-objective optimization algorithm and consistent hashing algorithm, and ensures the reliability of message transmission; through the cooperation optimization algorithm to handle potential cooperation conflicts, dynamically adjust the task allocation strategy, and improve the performance of concurrent message processing.
[0151] As shown in Figure 9 The embodiment of the application provides a multi-user concurrent message processing device, which comprises:
[0152] The space-time traffic perception module 10 is used for real-time traffic analysis and future traffic prediction of the real-time acquired user interaction message, and future traffic prediction data is obtained.
[0153] As shown in Figure 10 The space-time traffic perception module 10 specifically comprises:
[0154] The matrix input unit 11 is used for inputting user interaction messages to the AGCRN model, wherein the user interaction messages comprise a message interaction matrix and a user feature matrix;
[0155] The space-time relationship extraction unit 12 is used for extracting the space-time relationship of nodes from the message interaction matrix and the user feature matrix by using a graph convolution layer;
[0156] The time series modeling unit 13 is used for performing time series modeling by using a recurrent neural network according to the space-time relationship of the nodes, and outputting the spatial topology structure of the message interaction network;
[0157] The traffic distribution prediction unit 14 is used for outputting the future traffic prediction data of the message interaction network through the STR model according to the spatial topology structure of the message interaction network.
[0158] The intelligent message scheduling module 20 is used for calculating the processing priority order of the message request by using a multi-objective optimization algorithm according to the future traffic prediction data.
[0159] As shown in Figure 11 The intelligent message scheduling module 20 specifically comprises:
[0160] The objective function setting unit 21 is used for setting a multi-objective function, which comprises a message delay minimization function and a processing priority maximization function of a high-priority message;
[0161] The weight allocation unit 22 is used for allocating different weights to each type of user request according to the future traffic prediction data.
[0162] The multi-objective optimization solving unit 23 is configured to perform multi-objective solving by using a non-dominated sorting genetic algorithm or a multi-objective evolutionary algorithm to obtain a set of Pareto optimal solutions;
[0163] The priority queue generating unit 24 is configured to select optimal solutions from the Pareto solution set to generate a processing priority order of the message requests.
[0164] The message distribution module 30 is configured to distribute the message requests by using a consistent hashing algorithm according to the processing priority order of the message requests, balance the load of the message requests on different processing nodes, and obtain a message distribution plan.
[0165] As shown in Figure 12 , the message distribution module 30 specifically includes:
[0166] The node state monitoring unit 31 is configured to monitor key performance indicators of each node in real time, and the key performance indicators include but are not limited to CPU usage, memory occupation, and network delay.
[0167] The consistent hashing distribution unit 32 is configured to distribute concurrent message requests to multiple processing nodes by using a consistent hashing algorithm, and ensure that each message request has a fixed processing node.
[0168] The load balancing adjustment unit 33 is configured to re-allocate part of the message requests by using a load balancing strategy when it is detected that the load of a node is too high.
[0169] The dynamic load distribution unit 34 is configured to learn a load re-distribution strategy by using a reinforcement learning algorithm, gradually optimize message distribution through a feedback mechanism, and obtain a distribution plan of the message requests.
[0170] The resource allocation and load balancing module 40 is configured to dynamically adjust resource allocation by using a reinforcement learning algorithm according to node load information, and obtain real-time resource allocation results and load balancing strategies.
[0171] As shown in Figure 13 , the resource allocation and load balancing module 40 specifically includes:
[0172] The resource state monitoring unit 41 is configured to monitor the usage and availability of the current resources in real time.
[0173] The dynamic resource prediction unit 42 is configured to estimate resource usage peaks according to future traffic prediction data, and allocate sufficient resources in advance to cope with peak loads.
[0174] The resource allocation decision unit 43 is configured to adjust resource allocation strategies by using a reinforcement learning algorithm according to actual and predicted resource requirements, and ensure dynamic adjustment of resources when resources are insufficient or overloaded.
[0175] a dynamic expansion or contraction unit 44, configured to automatically expand or contract resource instances by containerization technology when the load increases or decreases beyond a preset threshold, to obtain real-time resource allocation results and load balancing strategies.
[0176] a concurrent processing engine execution module 50, configured to execute parallel message processing by a concurrent processing engine according to the message distribution plan, the real-time resource allocation results and the load balancing strategies.
[0177] As shown in Figure 14 the concurrent processing engine execution module 50 specifically includes:
[0178] a message parsing and dispatching unit 51, configured to parse message requests and dispatch them to appropriate processing threads or micro-service instances;
[0179] a task parallel execution unit 52, configured to execute multiple message requests simultaneously in a multi-processor environment by using a thread pool or coroutine concurrent processing mechanism;
[0180] a fault recovery unit 53, configured to automatically trigger a fault recovery mechanism to reassign tasks to other available threads when an error or timeout occurs in a certain thread;
[0181] a dynamic task adjustment unit 54, configured to automatically adjust the number of concurrent tasks under the action of a load balancing feedback mechanism.
[0182] a collaboration optimization module 60, configured to detect potential collaboration conflicts and dynamically adjust task allocation strategies by using a collaboration optimization algorithm based on the data processed by the concurrent processing engine.
[0183] As shown in Figure 15 the collaboration optimization module 60 specifically includes:
[0184] a collaboration path detection unit 61, configured to predict high-frequency paths of user interactions based on spatiotemporal traffic analysis results;
[0185] a conflict detection unit 62, configured to analyze the interaction paths of different users using a path optimization algorithm to detect possible resource competition or process conflicts;
[0186] a collaboration path optimization unit 63, configured to dynamically adjust the task allocation collaboration path and re-plan collaboration links for potential conflicts.
[0187] It should be noted that those skilled in the art can clearly understand the specific implementation process of the above multi-user concurrent message processing device and each unit, which can refer to the corresponding description in the foregoing method embodiments. For the convenience and brevity of description, it will not be repeated here.
[0188] The multi-user concurrent message processing apparatus can be implemented in the form of a computer program, which can run on a computer device as shown in Figure 7 .
[0189] Please refer to Figure 16 , Figure 16 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a terminal or a server, wherein the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, or the like electronic device having a communication function. The server can be a standalone server or a server cluster composed of multiple servers.
[0190] Please refer to Figure 16 , the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, wherein the memory can include a non-volatile storage medium 503 and an internal memory 504.
[0191] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which when executed, can cause the processor 502 to perform a multi-user concurrent message processing method.
[0192] The processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.
[0193] The internal memory 504 provides an environment for the running of the computer program 5032 in the non-volatile storage medium 503, which when executed by the processor 502, can cause the processor 502 to perform a multi-user concurrent message processing method.
[0194] The network interface 505 is configured to perform network communication with other devices. Those skilled in the art can understand that Figure 16 the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. The specific computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0195] The processor 502 is configured to run the computer program 5032 stored in the memory to implement the multi-user concurrent message processing method as described above.
[0196] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0197] It can be understood by those skilled in the art that all or part of the processes in the method of the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the above-mentioned embodiments of the method.
[0198] Therefore, the present application also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions are executed by a processor to make the processor execute the multi-user concurrent message processing method as described above.
[0199] The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various computer-readable storage media that can store program codes.
[0200] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0201] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the embodiments of the apparatus described above are merely schematic. For example, the division of the units is merely a logical function division. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In this way, the inventive idea can be implemented.
[0202] The steps in the method embodiments of the present application can be adjusted, combined and deleted in sequence according to actual needs. The units in the apparatus embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0203] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art that makes a contribution, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application.
[0204] The above description is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of multi-user concurrent message processing, characterized by, The method comprises: real-time traffic analysis and future traffic prediction on real-time acquired user interaction messages to obtain future traffic prediction data; calculating the processing priority order of message requests using a multi-objective optimization algorithm according to the future traffic prediction data; distributing message requests through a consistent hashing algorithm according to the processing priority order of message requests, balancing the load of message requests on different processing nodes, and obtaining a message distribution plan; using a reinforcement learning algorithm to dynamically adjust resource allocation according to node load information, obtaining real-time resource allocation results and load balancing strategies; executing parallel message processing through a concurrent processing engine according to the message distribution plan, real-time resource allocation results and load balancing strategies.
2. The multi-user concurrent message handling method of claim 1, wherein, The method further comprises: After the concurrent processing engine executes parallel message processing, detect potential collaboration conflicts through a collaboration optimization algorithm based on the data processed by the concurrent processing engine, and dynamically adjust the task allocation strategy.
3. The multi-user concurrent message handling method of claim 1, wherein, Real-time traffic analysis and future traffic prediction on real-time acquired user interaction messages to obtain future traffic prediction data includes: inputting user interaction messages into an AGCRN model, the user interaction messages including a message interaction matrix and a user feature matrix; extracting the spatio-temporal relationship of nodes from the message interaction matrix and the user feature matrix using a graph convolution layer; using a recurrent neural network to perform time series modeling according to the spatio-temporal relationship of nodes, and outputting the spatial topology of the message interaction network; outputting future traffic prediction data from the STR model based on the spatial topology of the message interaction network.
4. The multi-user concurrent message handling method of claim 1, wherein, Using a multi-objective optimization algorithm to calculate the processing priority order of message requests according to the future traffic prediction data includes: setting a multi-objective function, including a message delay minimization function and a high-priority message processing priority maximization function; assigning different weights to each type of user request according to the future traffic prediction data; solving the multi-objective function using a non-dominated sorting genetic algorithm or a multi-objective evolutionary algorithm to obtain a set of Pareto optimal solutions; selecting the optimal solution from the Pareto solution set to generate the processing priority order of message requests.
5. The multi-user concurrent message handling method of claim 1, wherein, Distributing message requests through a consistent hashing algorithm according to the processing priority order of concurrent message requests, balancing the load of concurrent message requests on different processing nodes, and obtaining a message distribution plan includes: monitoring the key performance indicators of each node in real time, including but not limited to CPU usage, memory usage, and network latency; using a consistent hashing algorithm to distribute concurrent message requests to multiple processing nodes to ensure that each message request has a fixed processing node; when detecting that a node has a high load, use a load balancing strategy to reassign part of the message requests; using a reinforcement learning algorithm to learn the load redistribution strategy and gradually optimizing message allocation through a feedback mechanism to obtain a message distribution plan.
6. The multi-user concurrent message handling method of claim 1, wherein, Using a reinforcement learning algorithm to dynamically adjust resource allocation according to node load information to obtain real-time resource allocation results and load balancing strategies includes: monitoring the usage and availability of current resources in real time; estimating resource usage peaks based on future traffic prediction data and allocating sufficient resources in advance to handle peak loads. According to the actual and predicted resource requirements, adjust the resource allocation strategy combined with reinforcement learning algorithm, ensure dynamic adjustment of resources when resources are insufficient or overloaded; When the load increases or decreases beyond the preset threshold, automatically expand or shrink resource instances through containerization technology, get real-time resource allocation results and load balancing strategy.
7. The multi-user concurrent message handling method of claim 1, wherein, According to the message distribution plan, real-time resource allocation results and load balancing strategy, execute parallel message processing through concurrent processing engine including: Parse message requests and dispatch to appropriate processing threads or microservice instances; Adopt thread pool or coroutine concurrent processing mechanism to execute multiple message requests simultaneously in a multi-processor environment; When an error or timeout occurs in a thread, automatically trigger the fault recovery mechanism to reassign tasks to other available threads; Under the action of load balancing feedback mechanism, automatically adjust the number of concurrent tasks.
8. The multi-user concurrent message handling method of claim 1, wherein, According to the concurrent processing engine processing data, through the cooperation optimization algorithm, detect potential cooperation conflicts, dynamically adjust the task allocation strategy including: Based on the results of space-time traffic analysis, predict the high-frequency path of user interaction; Use path optimization algorithm to analyze the interaction path of different users and detect possible resource competition or process conflict; For potential conflicts, dynamically adjust the task allocation cooperation path and re-plan the cooperation link.
9. A multi-user concurrent message processing apparatus, characterized by comprising: Including: Space-time traffic sensing module for real-time traffic analysis and future traffic prediction of real-time acquired user interaction messages to obtain future traffic prediction data; Intelligent message scheduling module for calculating the processing priority order of message requests using multi-objective optimization algorithm according to future traffic prediction data; Message distribution module for distributing message requests through consistent hashing algorithm according to the processing priority order of message requests to balance the load of message requests on different processing nodes and obtain message distribution plan; Resource allocation and load balancing module for dynamically adjusting resource allocation using reinforcement learning algorithm according to node load information to obtain real-time resource allocation results and load balancing strategy; Concurrent processing engine execution module for executing parallel message processing through concurrent processing engine according to message distribution plan, real-time resource allocation results and load balancing strategy.
10. A computer device, comprising: The computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the multi-user concurrent message processing method of any one of claims 1-7.