A method for fast message processing in high concurrency scenarios

By designing the high-concurrency scenario system architecture and real-time monitoring and tuning, the problem of low message processing efficiency in high-concurrency scenarios has been solved, system performance and stability have been improved, and the efficiency of concurrent message processing in high-concurrency scenarios has been improved.

CN118377635BActive Publication Date: 2024-08-30BEIJING JIUJIA XINTONG TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410814297.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-08-30
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

Message processing in high-concurrency scenarios leads to resource competition, resulting in excessive resource consumption or bottlenecks, affecting system performance and stability, and making concurrent message processing inefficient.

Method used

Design a high-concurrency scenario system architecture to receive user message data and convert the message form, use load balancing to distribute it to processing nodes, store it in the message queue, process messages through multi-threading methods, and monitor abnormal indicators in real time for system tuning.

Benefits of technology

It improves the efficiency of concurrent message processing in high concurrency scenarios, achieves system performance optimization and reasonable allocation of resources, and ensures system stability and response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377635B
    Figure CN118377635B
Patent Text Reader

Abstract

The present invention discloses a method for rapid message processing in a high-concurrency scenario. The method for rapid message processing in a high-concurrency scenario relates to the field of electronic data processing technology, and includes the following steps: system framework design; data acquisition; data result acquisition; monitoring alarm; system abnormality tuning. The present invention collects user message data in a preset high-concurrency scenario and distributes it to the processing node of the designed high-concurrency scenario system architecture, then stores the user message data in a preset message queue and optimizes the system performance of the high-concurrency scenario system architecture, then performs high-concurrency message processing on the user message data to obtain data results, and simultaneously monitors and obtains monitoring alarm abnormality indicators in real time and sends alarm information to preset personnel, and finally performs system abnormality tuning according to the monitoring alarm abnormality indicators, thereby improving the efficiency of concurrent message processing in high-concurrency scenarios and solving the problem of low efficiency of concurrent message processing in high-concurrency scenarios in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic data processing, and in particular to a method for quickly processing messages in a high-concurrency scenario. Background Art

[0002] With the development of modern science and technology, the probability of high-concurrency scenarios is gradually increasing. High-concurrency scenarios usually refer to situations where the system needs to process a large number of requests at the same time. This scenario places high demands on the system's performance, stability, and response speed. There are many high-concurrency scenarios in real production and life, including but not limited to the following: e-commerce promotions, Spring Festival ticket grabbing, popular social media, flash sale systems, game applications, factory production, hospital visits, public transportation, information flow systems, and AI applications. The common feature of high-concurrency scenarios is that the system needs to process a large number of requests at the same time and has high requirements for response speed and stability. Message processing is an indispensable part of modern society, involving data collection, organization, analysis, storage, and transmission. Common methods include classification and coding, data compression, data encryption and decryption, sequence analysis, and pattern recognition. These methods play an important role in their respective fields and promote the development of information processing technology. Emerging technologies will provide a broader development space for message processing.

[0003] The existing methods for fast message processing mainly include the following: Asynchronous processing: Decouple the message processing logic from the receiving logic through message queues or event-driven methods to achieve asynchronous processing. Parallel processing: Use parallel processing technologies such as multi-threading, multi-process or distributed clusters to distribute messages to multiple processing units for simultaneous processing. Compression and decompression: For larger messages or data, compression algorithms can be used for compression to reduce transmission and processing overhead. Traffic shaping: By controlling the sending rate or receiving rate of messages, the system can process message streams smoothly. In practical applications, these methods can be selected and combined according to specific scenarios and needs to achieve the best message processing effect. At the same time, with the continuous development of technology, new methods for fast message processing are also emerging, such as automated processing methods based on machine learning and artificial intelligence.

[0004] For example, the invention patent with announcement number: CN115495231B announces a dynamic resource scheduling method and system in a high-concurrency task complex scenario, including: dividing the system server into a central server and a resource node server, the central server obtains the process information and resource occupancy of all node servers, calculates the resource utilization rate of each task server, establishes the relationship between server load and resource utilization rate, and generates a resource information summary table. The supervision process is to monitor the resource occupancy information of the node server where each process is located, the resource occupancy of the target task, and the performance of the node server in real time; the central server obtains the task execution information submitted by the user to establish a complete task structure information for the scheduling and execution of subsequent tasks. , the central server collects and summarizes all task structure information to form a task status set; the central server sorts the initial task levels in the task status set, and matches the task node servers in the resource information table in order of priority to execute the target tasks; based on the window mechanism and dynamic threshold mechanism, the task process sequence is traversed every time interval T, and the resource load of each node is calculated according to the monitored resource information, the task resource allocation is dynamically adjusted, and the task status set is updated; based on the server-based traffic monitoring method, the traffic of different associated processes of the task node is monitored, and the monitored traffic is analyzed to identify malicious tasks submitted by illegal users and monitor and warn suspected abnormal tasks, so as to release the resource occupation of abnormal processes in time.

[0005] For example, a message processing method and a message processing device are announced in the invention patent with announcement number CN112749018B, including: receiving a message carrying a network element identifier through a gateway service; grouping the messages received by the gateway service according to the network element identifier to obtain a message group corresponding to the network element identifier; performing packet processing on the messages in the message group to obtain a first data packet group; determining the business service process corresponding to the first data packet group according to the network element identifier corresponding to the first data packet group; sending the data packets in the first data packet group to the corresponding business service process for processing; the network element identifier and the business service process have a many-to-one correspondence; determining the business service process corresponding to the first data packet group according to the network element identifier corresponding to the first data packet group, including: sending the data packets in the first data packet group corresponding to the network element identifier to the same business service process; the business service process groups the data packets received from different first data packet groups according to the network element identifier to obtain a second data packet group; determining the message service process corresponding to the second data packet group according to the network element identifier corresponding to the second data packet group; sending the data packets in the second data packet group to the corresponding message service process for processing.

[0006] However, in the process of implementing the technical solution of the invention in the embodiments of the present application, the present application found that the above technology has at least the following technical problems:

[0007] In the prior art, high-concurrency message processing will lead to resource competition, such as competition for CPU, memory, network bandwidth and other resources. In the case of unreasonable resource allocation and improper resource use, it will lead to excessive resource consumption or resource bottlenecks, affecting the performance and stability of the system. There is a problem of low efficiency in concurrent message processing in high-concurrency scenarios. Summary of the invention

[0008] The embodiments of the present application solve the problem of low efficiency of concurrent message processing in high-concurrency scenarios in the prior art by providing a method for rapid message processing in high-concurrency scenarios, thereby improving the efficiency of concurrent message processing in high-concurrency scenarios.

[0009] The embodiment of the present application provides a method for rapid message processing in a high-concurrency scenario, including the following steps: S1, designing a high-concurrency scenario system architecture; S2, receiving user message information in a preset high-concurrency scenario within a preset time interval and converting the message format to obtain user message data, and using a load balancing method to distribute the user message data to the processing nodes of the high-concurrency scenario system architecture; S3, storing the user message data on the processing node in a preset message queue, and optimizing the system performance of the high-concurrency scenario system architecture, the processing node uses a multi-threading method to perform high-concurrency message processing on the user message data from the preset message queue to obtain data results, and the system performance optimization includes message processing algorithm optimization and data result optimization of the high-concurrency scenario system architecture; S4, real-time monitoring of high-concurrency message processing to obtain monitoring alarm abnormality indicators, and sending alarm information to preset personnel according to the monitoring alarm abnormality indicators, wherein the monitoring alarm abnormality indicators are used to describe the abnormal degree of high-concurrency message processing; S5, system abnormality tuning of the high-concurrency scenario system architecture according to the monitoring alarm abnormality indicators and in combination with the operation of the high-concurrency scenario system architecture.

[0010] Furthermore, the specific process of obtaining monitoring alarm abnormality indicators is as follows: configure monitoring indicators and corresponding alarm thresholds on the selected open source monitoring tool; obtain monitoring indicator data in real time through the visual interface provided by the open source monitoring tool, and obtain the alarm thresholds and reference alarm deviations corresponding to the monitoring indicator data, the monitoring indicator data including preset message queue length, message processing speed, thread pool status indicators and error rate; obtain monitoring indicator coefficients in combination with the monitoring indicator data and the corresponding alarm thresholds and reference alarm deviations, and obtain monitoring alarm abnormality indicators for high-concurrency message processing based on the obtained monitoring indicator coefficients, the monitoring indicator coefficients including preset message queue length coefficients, message processing speed coefficients, thread pool status indicator coefficients and error rate coefficients.

[0011] Furthermore, the specific method for obtaining the main thread separation index is as follows: obtain linear separation parameter data of user message data from the high-concurrency message processing process, and obtain the linear separation coefficient in combination with the corresponding reference value and reference deviation, wherein the linear separation coefficient includes thread utilization coefficient, concurrency coefficient, abnormality rate coefficient and resource consumption rate coefficient; obtain the main thread separation index of the user message data according to the obtained linear separation coefficient.

[0012] Furthermore, the monitoring alarm abnormality index is calculated using the following formula:

[0013] ,

[0014] In the formula, e is a natural constant, and f represents the number of times high concurrent message processing is performed. , F is the total number of high-concurrency message processing, fd represents the user message data number of the f-th high-concurrency message processing, , fD is the total number of user message data processed by the fth high concurrent message, This is the monitoring alarm abnormal indicator for the f-th high concurrent message processing. is the preset message queue length coefficient for the f-th high-concurrency message processing, is the message processing speed coefficient of the fd-th user message data in the f-th high-concurrency message processing, is the thread pool status index coefficient for the f-th high-concurrency message processing, is the error rate coefficient of the f-th high-concurrency message processing.

[0015] Furthermore, the specific method for obtaining the high concurrency tuning index is as follows: obtain the tuning performance parameter data during the system abnormality tuning process of the high concurrency scenario system architecture, and obtain the tuning performance coefficient in combination with the corresponding reference value and reference deviation, and obtain the reference relative deviation of the throughput coefficient; the tuning performance parameter data includes response time, throughput, QPS data and TPS data, and the tuning performance coefficient includes response time coefficient, throughput coefficient, QPS data coefficient and TPS data coefficient; calculate the high concurrency tuning index of the high concurrency scenario system architecture according to the obtained tuning performance coefficient and the reference relative deviation of the throughput coefficient, and the high concurrency tuning index is calculated using the following formula:

[0016] ,

[0017] In the formula, j represents the number of times the system abnormality tuning occurs. , J is the total number of system abnormality tuning, jd is the user message data number of the jth system abnormality tuning, , jD is the total number of user message data for the jth system abnormality tuning, is the high concurrency tuning index for the j-th system exception tuning, The response time coefficient of the jd-th user message data optimized for the j-th system exception, is the throughput coefficient of the jth system abnormality tuning, QPS data coefficient for the jth system abnormality tuning is the TPS data coefficient of the jth system abnormality tuning, is the reference relative deviation of the throughput coefficient.

[0018] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0019] 1. By receiving user message data in a preset high-concurrency scenario and distributing it to the processing nodes of the designed high-concurrency scenario system architecture, the user message data is then stored in a preset message queue and the system performance of the high-concurrency scenario system architecture is optimized. Then, high-concurrency message processing is performed on the user message data to obtain data results, thereby realizing the acquisition of user message results in high-concurrency scenarios, and then realizing the improvement of the efficiency of concurrent message processing in high-concurrency scenarios, effectively solving the problem of low efficiency of concurrent message processing in high-concurrency scenarios in the prior art.

[0020] 2. By obtaining the linear separation parameter data of the user message data from the high-concurrency message processing process, and combining the corresponding reference value and reference deviation to obtain the linear separation coefficient, the main thread separation index of the user message data is obtained according to the obtained linear separation coefficient. Finally, the primary and secondary degree of the user message data is evaluated through the obtained main thread separation index, thereby realizing the quantification of the importance of the user message data, and then realizing a more accurate evaluation of the primary and secondary degree of the user message data.

[0021] 3. By obtaining the tuning performance parameter data during the tuning process of the high-concurrency scenario system architecture, and combining the corresponding reference value and reference deviation to obtain the tuning performance coefficient, the high-concurrency tuning index of the high-concurrency scenario system architecture is calculated based on the obtained tuning performance parameter data and the throughput coefficient reference relative deviation. Finally, the real-time tuning of the high-concurrency scenario system architecture is evaluated based on the calculated high-concurrency tuning index, thereby realizing the digitization of the real-time tuning of the high-concurrency scenario system architecture, and then realizing a more accurate evaluation of the real-time tuning of the high-concurrency scenario system architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart of a method for quickly processing messages in a high-concurrency scenario provided by an embodiment of the present application;

[0023] Figure 2 A diagram showing the design steps of a high-concurrency scenario system architecture provided in an embodiment of the present application;

[0024] Figure 3 A conversion flowchart of the message format provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiment of the present application solves the problem of low efficiency of concurrent message processing in high-concurrency scenarios in the prior art by providing a method for rapid message processing in high-concurrency scenarios. By designing a high-concurrency scenario system architecture, user message information in a preset high-concurrency scenario within a preset time interval is received and converted into a message format to obtain user message data. At the same time, a load balancing method is used to distribute the user message data to a processing node of the high-concurrency scenario system architecture. The user message data on the processing node is then stored in a preset message queue. The system performance of the high-concurrency scenario system architecture is optimized. The processing node uses a multi-threaded method to perform high-concurrency message processing on the user message data from the preset message queue to obtain a data result, thereby achieving the effect of improving the efficiency of concurrent message processing in high-concurrency scenarios.

[0026] The technical solution in the embodiment of the present application is to solve the problem of low efficiency of concurrent message processing in the above-mentioned high-concurrency scenario. The overall idea is as follows:

[0027] By receiving user message data in preset high-concurrency scenarios and distributing it to the processing nodes of the designed high-concurrency scenario system architecture, the user message data is then stored in the preset message queue and the system performance of the high-concurrency scenario system architecture is optimized. Then, high-concurrency message processing is performed on the user message data to obtain data results, thereby improving the efficiency of concurrent message processing in high-concurrency scenarios.

[0028] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0029] like Figure 1As shown, it is a flow chart of a method for rapid message processing in a high-concurrency scenario provided by an embodiment of the present application. The method for rapid message processing in a high-concurrency scenario provided by an embodiment of the present application includes the following steps: S1, designing a high-concurrency scenario system architecture, where the high-concurrency scenario system architecture is designed according to preset business requirements and concurrency and is applied to information processing in a preset high-concurrency scenario; S2, receiving user message information in a preset high-concurrency scenario within a preset time interval and converting the message format to obtain user message data, and at the same time using a load balancing method to distribute the user message data to the processing nodes of the high-concurrency scenario system architecture, and the message format conversion is used to convert the user message information into user message data; S3, storing the user message data on the processing node in the preset message queue, and performing a load balancing on the high-concurrency scenario system architecture. The system performance optimization of the architecture is that the processing node uses a multi-threaded method to perform high-concurrency message processing on the user message data from the preset message queue to obtain the data result. The system performance optimization includes the message processing algorithm optimization and data result optimization of the high-concurrency scenario system architecture. The multi-threaded method is used to synchronously process multiple user message data. The preset message queue is used to asynchronously process messages and decouple the components of the high-concurrency scenario system architecture; S4, real-time monitoring of high-concurrency message processing is performed to obtain monitoring alarm abnormality indicators, and alarm information is sent to the preset personnel according to the monitoring alarm abnormality indicators. The monitoring alarm abnormality indicators are used to describe the abnormal degree of high-concurrency message processing; S5, system abnormality tuning of the high-concurrency scenario system architecture is performed according to the monitoring alarm abnormality indicators and combined with the operation of the high-concurrency scenario system architecture.

[0030] In this embodiment, after receiving the alarm information, the cause of the problem is quickly located, and it is analyzed whether it is caused by resource bottlenecks, network delays, code defects or other factors in the high-concurrency scenario system architecture. Tools such as log analysis and performance analysis are used to quickly locate and solve the problem; the high-concurrency scenario system architecture resources are dynamically adjusted according to monitoring indicators, such as increasing or decreasing server instances and adjusting virtual machine configurations; historical data comparisons of monitoring indicators are regularly performed to identify potential problems and room for improvement; and the efficiency of concurrent message processing in high-concurrency scenarios is improved.

[0031] Further, such as Figure 2As shown, it is a design step diagram of the high-concurrency scenario system architecture provided in an embodiment of the present application. The specific design steps of the high-concurrency scenario system architecture are: S11, splitting the initial high-concurrency scenario system architecture to obtain a high-concurrency scenario subsystem. The initial high-concurrency scenario system architecture has the function of processing information in high-concurrency scenarios, and the high-concurrency scenario subsystem is responsible for information processing of preset information; S12, constructing a high-concurrency scenario master-slave architecture based on the high-concurrency scenario subsystem to obtain a first high-concurrency scenario system architecture. The first high-concurrency scenario master-slave architecture includes a high-concurrency scenario master library and a high-concurrency scenario slave library. The high-concurrency scenario master library is used to write user message information, and the high-concurrency scenario slave library is used to read user information; S13, introducing a preset message queue into the first high-concurrency scenario system architecture, and splitting the message data processing point of the high-concurrency scenario subsystem to obtain sub-message data processing points to obtain a high-concurrency scenario system architecture. The sub-message data point is used to process user message data within the same time interval under the preset high-concurrency scenario.

[0032] In this embodiment, the initial high-concurrency scenario system architecture can be split through tools such as dubbo and springCloud. The high-concurrency scenario subsystem is connected to a database, which can play a certain role in diverting high-concurrency access, thereby improving the accuracy of the high-concurrency scenario system architecture design.

[0033] Further, such as Figure 3 As shown, it is a message format conversion flow chart provided in an embodiment of the present application, and the specific steps of message format conversion are as follows: Step 1, performing message parsing on the acquired user message information to obtain a user parsed message, where message parsing means decoding the user message information by using a natural language understanding method, and the user parsed message is in a data format that can be processed by a high-concurrency scenario system architecture; Step 2, performing format conversion on the user parsed message to obtain a format-converted message, where the format conversion includes changing the data representation method, adjusting the data structure hierarchy, and adding and deleting preset fields; Step 3, constructing initial user message data according to the target format and verifying it to obtain the user message data.

[0034] In this embodiment, the data structures that can be processed by the high-concurrency scenario system architecture include formats such as JSON, XML, and Protobuf; the user message data after format conversion can be stored in a database, data warehouse, or memory for subsequent use by the high-concurrency scenario system architecture, generally including the content of the user message, context information, and user history records, etc.; the efficiency of the form conversion of user message information is improved.

[0035] Furthermore, message processing algorithm optimization includes high-concurrency algorithm optimization, parallel optimization and asynchronous processing optimization; high-concurrency algorithm optimization means selecting a high-concurrency control algorithm according to the preset business requirements of the high-concurrency scenario system architecture, and optimizing the time complexity and space complexity of the selected high-concurrency control algorithm, while optimizing the data access mode using the cache and locality principles; parallel optimization means dividing user message data into parallel subtask message data, and the parallel subtask message data is used to describe the message data for parallel computing using a multi-core processor; asynchronous processing optimization means performing high-concurrency message processing on user message data that meets the main thread separation index, otherwise separating it to the preset message queue for temporary storage, and the main thread separation index is used to describe the importance of user message data.

[0036] In this embodiment, a suitable concurrency control algorithm, such as locks, semaphores, and conditional variables, is selected according to the system architecture requirements of high-concurrency scenarios to ensure correct synchronization between threads or processes, and lock-free data structures or algorithms are evaluated and used to reduce the performance overhead caused by lock contention; an asynchronous programming model is adopted to separate time-consuming operations from the main thread to avoid blocking the main thread, and a message queue or event-driven mechanism is used to process the results of asynchronous operations; the optimization of the system architecture algorithm for high-concurrency scenarios is achieved, further improving the efficiency of high-concurrency message processing.

[0037] Furthermore, data result optimization includes compression coding optimization, message data cache optimization, data aggregation optimization and index optimization; compression coding optimization refers to data compression and data encoding of data results, data compression is used to reduce the storage and transmission overhead of data results, and data encoding is used to reduce the complexity of data result parsing and processing; message data cache optimization is to use a cache mechanism to store user message data and data results with an access frequency greater than a preset frequency, and delete data results of user message data with an access frequency less than a preset frequency; data aggregation optimization is to aggregate user message data to reduce the number of calls and network communication overhead of the concurrent scenario system architecture; index optimization refers to establishing data indexes on the high-concurrency scenario system architecture to improve the query efficiency of user message data.

[0038] In this embodiment, an efficient data encoding method is used to reduce the complexity of data parsing and processing; a cache mechanism is used to store commonly used data results to reduce frequent access to original data; and the data result acquisition process is optimized to further improve the efficiency of data result acquisition.

[0039] Furthermore, the specific process of obtaining monitoring alarm abnormal indicators is as follows: configure monitoring indicators and corresponding alarm thresholds on the selected open source monitoring tool. The monitoring indicators are used to measure the processing status of high-concurrency message processing; obtain monitoring indicator data in real time through the visual interface provided by the open source monitoring tool, and obtain the alarm threshold and reference alarm deviation corresponding to the monitoring indicator data. The monitoring indicator data is used for real-time numerical analysis of the processing status of high-concurrency message processing. The monitoring indicator data includes the preset message queue length, message processing speed, thread pool status indicator and error rate. The thread pool status indicator is the data obtained by the preset personnel based on the thread pool status; combine the monitoring indicator data and the corresponding alarm threshold and reference alarm deviation to obtain the monitoring indicator system The monitoring indicator coefficients include preset message queue length coefficient, message processing speed coefficient, thread pool state indicator coefficient and error rate coefficient; the preset message queue length coefficient is the absolute value of the ratio of the preset message queue length to the corresponding reference alarm deviation and the corresponding reference alarm threshold difference, the message processing speed coefficient is the absolute value of the ratio of the message processing speed to the corresponding reference alarm deviation and the corresponding reference alarm threshold difference, the thread pool state indicator coefficient is the absolute value of the ratio of the thread pool state indicator to the corresponding reference alarm deviation and the corresponding reference alarm threshold difference, and the error rate coefficient is the absolute value of the ratio of the error rate to the corresponding reference alarm deviation and the corresponding reference alarm threshold difference.

[0040] In this embodiment, the message queue length reflects the backlog of the message queue to avoid message processing delays caused by too long queues; the message processing speed measures the system's ability to process messages to ensure that the system architecture in high-concurrency scenarios can process a large number of messages in a timely manner; the thread pool status includes the number of active threads in the thread pool, the length of the task queue, etc., reflecting the usage of the thread pool and performance bottlenecks; statistics on errors occurring during message processing can promptly identify potential problems; open source monitoring tools usually provide rich monitoring indicators, flexible alarm configurations and powerful data visualization functions; alarm notification methods include email, SMS and Slack, etc., and generally one or more of them can be selected to ensure that operation and maintenance personnel can receive alarm information in a timely manner; the timeliness of monitoring alarms for high-concurrency message processing processes is improved.

[0041] Furthermore, the specific process of system exception tuning is as follows: locate the performance bottleneck of high-concurrency message processing according to the obtained monitoring alarm exception indicators, and the performance bottleneck is used to describe the abnormal indicators in the high-concurrency scenario system architecture; according to the located performance bottleneck, perform system exception tuning on the high-concurrency scenario system architecture until the high-concurrency tuning index reaches the high-concurrency tuning interval, and put the high-concurrency scenario system architecture that has reached the high-concurrency tuning interval into actual business operations, otherwise continue to tune until it reaches the high-concurrency tuning interval; the high-concurrency tuning index is used to describe the real-time system exception tuning of the high-concurrency scenario system architecture, and architecture tuning includes message queue optimization, database performance optimization, and thread pool optimization.

[0042] In this embodiment, performance bottlenecks include unreasonable design of message queues, improper configuration of thread pool size, uneven allocation of system resources, and complex business logic leading to low processing efficiency. The specific performance bottlenecks can be analyzed according to the actual high-concurrency scenario; optimize the use of message queues, such as adjusting the capacity of the queue, optimizing the serialization and deserialization process of messages, etc., to reduce queue backlogs and increase the message processing speed; for database performance issues, adopt read-write separation architecture, optimize query statements, increase indexes, etc. to increase database capacity and response speed; according to the actual load and message processing speed of the high-concurrency scenario system architecture, reasonably adjust the size of the thread pool to make full use of the high-concurrency scenario system architecture resources and avoid excessive competition; achieve the improvement of the performance stability of the high-concurrency scenario system architecture.

[0043] Furthermore, a specific method for obtaining the main thread separation index is as follows: linear separation parameter data of user message data is obtained from a high-concurrency message processing process, and a linear separation coefficient is obtained in combination with a corresponding reference value and a reference deviation. The linear separation parameter data includes thread utilization, concurrency, exception rate and resource consumption rate. The linear separation coefficient includes a thread utilization coefficient, a concurrency coefficient, an exception rate coefficient and a resource consumption rate coefficient. The thread utilization coefficient is the absolute value of the ratio difference between the reference value of the thread utilization and the corresponding reference deviation, the message concurrency coefficient is the absolute value of the ratio difference between the reference value of the message concurrency and the corresponding reference deviation, the exception rate coefficient is the absolute value of the ratio difference between the reference value of the exception rate and the corresponding reference deviation, and the resource consumption rate coefficient is the absolute value of the ratio difference between the reference value of the resource consumption rate and the corresponding reference deviation; the main thread separation index of the user message data is obtained according to the obtained linear separation coefficient.

[0044] In this embodiment, the main thread separation index can be obtained directly through the operating system level tool, or it can be more accurately calculated through a formula. The main thread separation index is calculated using the following formula:

[0045] ,

[0046] In the formula, e is a natural constant, f represents the number of times high concurrent message processing is performed, , F is the total number of high concurrent message processing, is the main thread separation index for the f-th high-concurrency message processing, is the thread utilization coefficient for the f-th high-concurrency message processing, is the message concurrency coefficient for the f-th high-concurrency message processing, is the abnormal rate coefficient of the f-th high concurrent message processing, is the resource consumption rate coefficient of the f-th high-concurrency message processing.

[0047] Specifically, the expression of thread utilization coefficient is ,in, is the thread utilization rate of the fth high concurrent message processing, is the reference thread utilization rate for the f-th high concurrent message processing, is the thread utilization reference deviation; the expression of the message concurrency coefficient is ,in, is the number of concurrent messages processed for the fth high-concurrency message. is the reference message concurrency number for the f-th high-concurrency message processing, is the reference deviation of the number of concurrent messages; the expression of the abnormal rate coefficient is ,in, is the exception rate of the f-th high concurrent message processing, is the reference exception rate of the f-th high concurrent message processing, is the abnormal rate reference deviation; the expression of resource consumption rate coefficient is ,in, is the resource consumption rate of the fth high concurrent message processing, is the reference resource consumption rate of the f-th high concurrent message processing, It is the reference deviation of resource consumption rate; thread utilization is through the CPU utilization and busy and idle status of each thread, which can evaluate the utilization of thread resources after the main thread is separated; main thread separation helps to improve the concurrent processing capability of the system architecture in high-concurrency scenarios. By comparing the number of concurrencies before and after the implementation of main thread separation, its impact on the concurrent performance of the system architecture in high-concurrency scenarios can be evaluated; main thread separation should not lead to an increase in the exception rate, therefore, it is necessary to monitor these indicators to ensure that the implementation of main thread separation does not introduce new problems; main thread separation may increase the resource consumption (such as memory and CPU) of the system architecture in high-concurrency scenarios, therefore, it is necessary to monitor resource consumption to ensure that the performance improvement brought by main thread separation will not come at the cost of excessive resource consumption.

[0048] It should be understood that the reference thread utilization is obtained by analyzing and counting the thread utilization in the high-concurrency message processing process and taking the average value, the reference message concurrency is obtained by analyzing and counting the message concurrency in the high-concurrency message processing process and taking the average value, the reference exception rate is obtained by analyzing and counting the exception rate in the high-concurrency message processing process and taking the average value, and the reference resource consumption rate is obtained by analyzing and counting the resource consumption rate in the high-concurrency message processing process and taking the average value; the thread utilization reference deviation is obtained by analyzing and counting the thread utilization in the high-concurrency message processing process through the reference deviation calculation formula, the message concurrency reference deviation is obtained by analyzing and counting the message concurrency in the high-concurrency message processing process through the reference deviation calculation formula, the exception rate reference deviation is obtained by analyzing and counting the exception rate in the high-concurrency message processing process through the reference deviation calculation formula, and the resource consumption rate reference deviation is obtained by analyzing and counting the resource consumption rate in the high-concurrency message processing process through the reference deviation calculation formula; the importance of user message data is digitized, the efficiency of user message data classification is further improved, and the efficiency of message concurrency processing in high-concurrency scenarios is improved.

[0049] Furthermore, in addition to being directly obtained through the monitoring system, monitoring alarm abnormality indicators can also be more accurately calculated through formulas. Monitoring alarm abnormality indicators are calculated using the following formula:

[0050] ,

[0051] In the formula, e is a natural constant, f represents the number of times high concurrent message processing is performed, , F is the total number of high-concurrency message processing, fd represents the user message data number of the f-th high-concurrency message processing, , fD is the total number of user message data processed by the fth high concurrent message, This is the monitoring alarm abnormal indicator for the f-th high concurrent message processing. is the preset message queue length coefficient for the f-th high-concurrency message processing, is the message processing speed coefficient of the fd-th user message data in the f-th high-concurrency message processing, is the thread pool status index coefficient for the f-th high-concurrency message processing, is the error rate coefficient of the f-th high-concurrency message processing.

[0052] In this embodiment, let , so the monitoring alarm abnormality indicator formula can be simplified to: ,The statistical table of changes in monitoring alarm abnormal indicators is shown in Table 1:

[0053] Table 1 Statistics of changes in monitoring alarm abnormal indicators

[0054]

[0055] Specifically, the expression of the preset message queue length coefficient is: ,in, is the preset message queue length for the fth high-concurrency message processing, is the preset message queue length alarm threshold for the f-th high concurrent message processing, is the reference alarm deviation of the preset message queue length; the expression of the message processing speed coefficient is ,in, is the message processing speed of fd user message data in the f-th high-concurrency message processing, is the message processing speed alarm threshold for the fd-th user message data of the f-th high-concurrency message processing. is the message processing speed reference alarm deviation; the expression of the thread pool status indicator coefficient is ,in is the thread pool status indicator for the f-th high-concurrency message processing. is the thread pool status indicator alarm threshold for the f-th high concurrent message processing. is the thread pool status indicator reference alarm deviation; the expression of the error rate coefficient is ,in, is the error rate of the fth high concurrent message processing is the error rate alarm threshold for the f-th high concurrent message processing, It is the error rate reference alarm deviation.

[0056] It should be understood that the preset message queue length alarm threshold is obtained by analyzing and counting the preset message queue length for high-concurrency message processing based on a statistical method, the message processing speed alarm threshold is obtained by analyzing and counting the message processing speed for high-concurrency message processing based on a statistical method, the thread pool status indicator alarm threshold is obtained by analyzing and counting the thread pool status indicator for high-concurrency message processing based on a statistical method, and the error rate alarm threshold is obtained by analyzing and counting the error rate for high-concurrency message processing based on a statistical method; the preset message queue length reference alarm deviation is calculated by referring to the deviation calculation formula for the high-concurrency scenario system architecture. The preset message queue length is analyzed and counted, the message processing speed reference alarm deviation is obtained by analyzing and counting the message processing speed of the high-concurrency scenario system architecture through the reference deviation calculation formula, the thread pool status indicator reference alarm deviation is obtained by analyzing and counting the thread pool status indicator of the high-concurrency scenario system architecture through the reference deviation calculation formula, and the error rate reference alarm deviation is obtained by analyzing and counting the error rate of the high-concurrency scenario system architecture through the reference deviation calculation formula; the digitization of the abnormal degree of high-concurrency message processing is realized, the processing efficiency of high-concurrency messages is further improved, and the effect of improving the concurrent processing efficiency of messages in high-concurrency scenarios is achieved.

[0057] Furthermore, the specific method for obtaining the high concurrency tuning index is as follows: obtain the tuning performance parameter data during the system abnormality tuning process of the high concurrency scenario system architecture, and obtain the tuning performance coefficient in combination with the corresponding reference value and reference deviation, and obtain the reference relative deviation of the throughput coefficient at the same time; the tuning performance parameter data includes response time, throughput, QPS data and TPS data, and the tuning performance coefficient includes response time coefficient, throughput coefficient, QPS data coefficient and TPS data coefficient. The response time coefficient is the absolute value of the ratio of the response time to the corresponding reference deviation and the difference between the corresponding reference value, and the throughput coefficient is the absolute value of the ratio of the response time to the corresponding reference deviation and the difference between the corresponding reference value. The throughput coefficient is the absolute value of the ratio of the throughput to the corresponding reference deviation and the difference between the corresponding reference value. The QPS data coefficient is the absolute value of the ratio of the QPS data to the corresponding reference deviation and the difference between the corresponding reference value. The TPS data coefficient is the absolute value of the ratio of the TPS data to the corresponding reference deviation and the difference between the corresponding reference value. The high concurrency tuning index of the high concurrency scenario system architecture is calculated based on the obtained tuning performance coefficient and the throughput coefficient reference relative deviation. In addition to being directly obtained through performance analysis, the high concurrency tuning index can also be more accurately calculated through a formula. The high concurrency tuning index is calculated using the following formula:

[0058] ,

[0059] In the formula, j represents the number of times the system abnormality tuning occurs. , J is the total number of system abnormality tuning, jd is the user message data number of the jth system abnormality tuning, , jD is the total number of user message data for the jth system abnormality tuning, is the high concurrency tuning index for the j-th system exception tuning, The response time coefficient of the jd-th user message data optimized for the j-th system exception, The throughput coefficient optimized for the jth system anomaly is the QPS data coefficient of the jth system abnormality tuning, is the TPS data coefficient of the jth system abnormality tuning, is the reference relative deviation of the throughput coefficient.

[0060] In this embodiment, let , so the high concurrency tuning index formula can be simplified to: The statistical table of changes in the high concurrency tuning index is shown in Table 2:

[0061] Table 2 Statistics of changes in high concurrency tuning index

[0062]

[0063] Specifically, the expression of the response time coefficient is: ,in, The response time of the jd-th user message data optimized for the j-th system exception, The reference response time for the jd-th user message data during the j-th system exception tuning is: is the response time reference deviation; the expression of throughput coefficient is ,in, is the throughput of the jth system exception tuning, is the reference throughput of the j-th system abnormality tuning, is the throughput reference deviation; the expression of the QPS data coefficient is ,in, is the QPS data of the jth system abnormality tuning, is the reference QPS data for the j-th system abnormality tuning, is the reference deviation of QPS data; the expression of TPS data coefficient is ,in, is the TPS data of the jth system abnormality tuning, is the reference TPS data for the jth system abnormality tuning, It is the reference deviation of TPS data; response time reflects the time required for the high-concurrency scenario system architecture to send a request and receive a complete response. It is an important indicator for evaluating the performance of the high-concurrency scenario system architecture. In high-concurrency scenarios, optimizing the response time can significantly improve the efficiency of the high-concurrency scenario system architecture; throughput refers to the number of user messages processed by the system per unit time, which reflects the processing capability of the high-concurrency scenario system architecture. In high-concurrency tuning, improving throughput is one of the important goals; QPS data and TPS data are the number of queries per second and the number of transactions per second, which are key indicators for evaluating the system processing capability. By optimizing these indicators, the performance of the system in high-concurrency scenarios can be improved.

[0064] It should be understood that the reference response time is obtained by analyzing and counting the response time of the high-concurrency scenario system architecture and taking the average value, the reference throughput is obtained by analyzing and counting the throughput of the high-concurrency scenario system architecture and taking the average value, the reference QPS data is obtained by analyzing and counting the QPS data of the high-concurrency scenario system architecture and taking the average value, and the reference TPS data is obtained by analyzing and counting the TPS data of the high-concurrency scenario system architecture and taking the average value; the response time reference deviation is obtained by analyzing and counting the response time of the high-concurrency scenario system architecture through the reference deviation calculation formula, the throughput reference deviation is obtained by analyzing and counting the throughput of the high-concurrency scenario system architecture through the reference deviation calculation formula, and the QPS data reference deviation is obtained by analyzing and counting the QPS data of the high-concurrency scenario system architecture through the reference deviation calculation formula. The reference deviation of PS data is obtained by analyzing and counting the TPS data of the high-concurrency scenario system architecture through the reference deviation calculation formula; the reference relative deviation of throughput is obtained by taking the average value after analyzing and counting the throughput reference deviation; the corresponding high-concurrency tuning interval is: when the throughput is not greater than the reference relative deviation of the throughput, the high-concurrency scenario system architecture can no longer process user messages, so the high-concurrency tuning index is zero. When it is greater than the corresponding reference relative deviation, specific calculation is performed, and the throughput is most affected, followed by QPS data and TPS data, and the response time is the smallest. This segmentation can improve the calculation efficiency of the high-concurrency tuning index; the real-time tuning status of the high-concurrency scenario system architecture is digitized, which further improves the user message processing efficiency of the high-concurrency scenario system architecture, and achieves the effect of improving the concurrent processing efficiency of messages in high-concurrency scenarios.

[0065] The technical solution in the above-mentioned embodiment of the present application has at least the following technical effects or advantages: relative to a dynamic resource scheduling method and system in a high-concurrency task complex scenario announced by the invention patent with announcement number: CN115495231B, the embodiment of the present application obtains linear separation parameter data of user message data from the high-concurrency message processing process, and obtains the linear separation coefficient in combination with the corresponding reference value and reference deviation, and then obtains the main thread separation index of the user message data according to the obtained linear separation coefficient, and finally evaluates the importance of the user message data through the obtained main thread separation index, thereby realizing the numeration of the primary and secondary degree of the user message data, and then realizing a more accurate primary and secondary degree of the user message data. Accurate evaluation; relative to a message processing method and a message processing device announced in the invention patent with announcement number: CN112749018B, the embodiment of the present application obtains the tuning performance parameter data in the process of tuning the high-concurrency scenario system architecture, and obtains the tuning performance coefficient in combination with the corresponding reference value and reference deviation, and then calculates the high-concurrency tuning index of the high-concurrency scenario system architecture according to the obtained tuning performance parameter data and the throughput coefficient reference relative deviation, and finally evaluates the real-time tuning of the high-concurrency scenario system architecture according to the calculated high-concurrency tuning index, thereby realizing the digitization of the real-time tuning of the high-concurrency scenario system architecture, and then realizing a more accurate evaluation of the real-time tuning of the high-concurrency scenario system architecture.

[0066] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0067] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0068] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0069] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0070] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0071] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for fast message processing in high concurrency scenarios. It is characterized in that The following steps are involved: S1, design high-concurrency scenario system architecture; S2, receiving user message information in a preset high-concurrency scenario within a preset time interval and converting the message format to obtain user message data, and at the same time using a load balancing method to distribute the user message data to the processing nodes of the high-concurrency scenario system architecture; S3, storing the user message data on the processing node in a preset message queue, and optimizing the system performance of the high-concurrency scenario system architecture, the processing node uses a multi-threaded method to perform high-concurrency message processing on the user message data from the preset message queue to obtain data results, and the system performance optimization includes message processing algorithm optimization and data result optimization of the high-concurrency scenario system architecture; S4, real-time monitoring of high-concurrency message processing to obtain monitoring alarm abnormality indicators, and sending alarm information to preset personnel according to the monitoring alarm abnormality indicators, wherein the monitoring alarm abnormality indicators are used to describe the abnormality degree of high-concurrency message processing; S5, according to the monitoring alarm abnormality index and combined with the operation status of the high-concurrency scenario system architecture, the high-concurrency scenario system architecture is optimized for system abnormality to obtain a high-concurrency tuning index, wherein the high-concurrency tuning index is used to describe the real-time system abnormality tuning status of the high-concurrency scenario system architecture; The monitoring alarm abnormality index is calculated using the following formula: , In the formula, e is a natural constant, f represents the number of times high concurrent message processing is performed, , F is the total number of high-concurrency message processing, fd represents the user message data number of the f-th high-concurrency message processing, , fD is the total number of user message data processed by the fth high concurrent message, This is the monitoring alarm abnormal indicator for the f-th high concurrent message processing. is the preset message queue length coefficient for the f-th high-concurrency message processing, is the message processing speed coefficient of the fd-th user message data in the f-th high-concurrency message processing, is the thread pool status index coefficient for the f-th high-concurrency message processing, is the error rate coefficient of the f-th high-concurrency message processing. The thread pool status includes the number of active threads in the thread pool and the length of the task queue, which are used to reflect the usage of the thread pool and performance bottlenecks.

2. The method for rapid message processing in a high-concurrency scenario according to claim 1, It is characterized in that The specific design steps of the high-concurrency scenario system architecture are as follows: S11, splitting the initial high-concurrency scenario system architecture to obtain high-concurrency scenario subsystems; S12, constructing a high-concurrency scenario master-slave architecture based on the high-concurrency scenario subsystem to obtain a first high-concurrency scenario system architecture; S13, introducing a preset message queue into the first high-concurrency scenario system architecture, and splitting the message data processing point of the high-concurrency scenario subsystem to obtain sub-message data processing points to obtain the high-concurrency scenario system architecture.

3. The method for rapid message processing in a high-concurrency scenario according to claim 1, It is characterized in that The specific steps of the message format conversion are as follows: Step 1: parse the acquired user message information to obtain a user parsed message; Step 2: convert the format of the user parsed message to obtain a format converted message; Step three, construct initial user message data according to the target format and verify to obtain the user message data.

4. The method for rapid message processing in a high-concurrency scenario according to claim 1, Features: The message processing algorithm optimization includes high concurrency algorithm optimization, parallel optimization and asynchronous processing optimization; The high-concurrency algorithm optimization means selecting a high-concurrency control algorithm according to the preset business requirements of the high-concurrency scenario system architecture, optimizing the time complexity and space complexity of the selected high-concurrency control algorithm, and optimizing the data access mode by using the cache and locality principles; The parallel optimization means dividing the user message data into parallel subtask message data; The asynchronous processing optimization means performing high-concurrency message processing on user message data that reaches the main thread separation index, otherwise separating it to a preset message queue for temporary storage. The main thread separation index is used to describe the importance of user message data.

5. The method for rapid message processing in a high-concurrency scenario according to claim 1, Features: The data result optimization includes compression coding optimization, message data cache optimization, data aggregation optimization and index optimization; The compression coding optimization means performing data compression and data coding on the data result; The message data cache is optimized to utilize a cache mechanism to store user message data and data results with an access frequency greater than a preset frequency, and to delete data results of user message data with an access frequency less than a preset frequency; The data aggregation optimization is to aggregate user message data to reduce the number of calls and network communication overhead of the concurrent scenario system architecture; The index optimization refers to establishing a data index on a high-concurrency scenario system architecture to improve the query efficiency of user message data.

6. The method for rapid message processing in a high-concurrency scenario according to claim 1, It is characterized in that The specific process of obtaining monitoring alarm abnormal indicators is as follows: Configure monitoring indicators and corresponding alarm thresholds on the selected open source monitoring tool; Obtain monitoring indicator data in real time through the visual interface provided by the open source monitoring tool, and obtain the alarm threshold and reference alarm deviation corresponding to the monitoring indicator data. The monitoring indicator data includes the preset message queue length, message processing speed, thread pool status indicator and error rate; The monitoring indicator coefficient is obtained by combining the monitoring indicator data and the corresponding alarm threshold and reference alarm deviation, and the monitoring alarm abnormality index of high-concurrency message processing is obtained according to the obtained monitoring indicator coefficient. The monitoring indicator coefficient includes a preset message queue length coefficient, a message processing speed coefficient, a thread pool status indicator coefficient and an error rate coefficient.

7. The method for rapid message processing in a high-concurrency scenario according to claim 6, It is characterized in that The specific process of the system abnormality tuning is as follows: Locate the performance bottleneck of high-concurrency message processing based on the abnormal monitoring alarm indicators obtained; According to the located performance bottlenecks, perform system exception tuning on the high-concurrency scenario system architecture until the high-concurrency tuning index reaches the high-concurrency tuning range. Put the high-concurrency scenario system architecture that has reached the high-concurrency tuning range into actual business operations. Otherwise, continue to tune until it reaches the high-concurrency tuning range.

8. The method for rapid message processing in a high-concurrency scenario according to claim 4, It is characterized in that The specific method for obtaining the main thread separation index is as follows: Obtain linear separation parameter data of user message data from a high-concurrency message processing process, and obtain a linear separation coefficient in combination with a corresponding reference value and a reference deviation, wherein the linear separation coefficient includes a thread utilization coefficient, a concurrency coefficient, an abnormality rate coefficient, and a resource consumption rate coefficient; The main thread separation index of the user message data is obtained according to the obtained linear separation coefficient.

9. The method for rapid message processing in a high-concurrency scenario according to claim 7, It is characterized in that The specific method for obtaining the high concurrency tuning index is as follows: Obtain the tuning performance parameter data during the system abnormality tuning process for the high-concurrency scenario system architecture, and obtain the tuning performance coefficient in combination with the corresponding reference value and reference deviation, and obtain the reference relative deviation of the throughput coefficient; The tuning performance parameter data includes response time, throughput, QPS data and TPS data, and the tuning performance coefficient includes response time coefficient, throughput coefficient, QPS data coefficient and TPS data coefficient; The high concurrency tuning index of the high concurrency scenario system architecture is calculated based on the obtained tuning performance coefficient and throughput coefficient reference relative deviation. The high concurrency tuning index is calculated using the following formula: , In the formula, j represents the number of times the system abnormality tuning occurs. , J is the total number of system abnormality tuning, jd is the user message data number of the jth system abnormality tuning, , jD is the total number of user message data for the jth system abnormality tuning, is the high concurrency tuning index for the j-th system exception tuning, The response time coefficient of the jd-th user message data optimized for the j-th system exception, is the throughput coefficient of the jth system abnormality tuning, is the QPS data coefficient of the jth system abnormality tuning, is the TPS data coefficient of the jth system abnormality tuning, is the reference relative deviation of the throughput coefficient.

Citation Information

Patent Citations

  • A message processing method and a message processing apparatus

    CN112749018B

  • A method and system for dynamic resource scheduling in complex scenarios with high concurrency tasks

    CN115495231B

  • Multitask process monitoring method and system in distributed system environment

    CN102360310A

  • Asynchronous message mechanism-based monitoring acquisition data alarm method, system and device

    CN116225843A