Request processing method of large-scale concurrent communication network system based on micro-service architecture

By using server polling sequence and load prediction model to determine the appropriate server processing requests in a large-scale concurrent communication network system based on microservice architecture, the problem of inefficient request processing caused by traditional random allocation is solved, and more efficient request processing is achieved.

CN120144298APending Publication Date: 2025-06-13ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510230538.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In traditional technology, when randomly allocating requests to the server, it is easy to cause a long request processing time and reduce the request processing efficiency.

Method used

The request processing method of a large-scale concurrent communication network system based on microservice architecture is adopted. The current server is determined through the preset server polling order, its current and historical load data are obtained, feature extraction and fusion processing are performed, the load prediction model is input to predict the server load, and the request is decided whether to send to the server based on the preset load threshold.

Benefits of technology

Ensure that the request is sent to a server with sufficient processing capabilities, reduce the time for requests to queue in the server, improve the efficiency of request processing, and avoid the extension of request processing time caused by random allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144298A_ABST
    Figure CN120144298A_ABST
Patent Text Reader

Abstract

The invention relates to a request processing method and device for a large-scale concurrent communication network system based on micro-service architecture, computer equipment, a storage medium and a computer program product. The method comprises the following steps: determining a current server from a plurality of candidate servers; obtaining current load data and historical load data of a current server; performing feature extraction processing on the current load data and the historical load data to obtain a first feature vector of the current load data and a second feature vector of the historical load data; performing fusion processing on the first feature vector and the second feature vector to obtain a fused feature vector; inputting the fusion feature vector into a load prediction model to obtain predicted load data of the current server; and when the predicted load data is smaller than or equal to a preset load threshold value, sending the to-be-processed request to the current server, so that the current server processes the to-be-processed request. By adopting the method, the request processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product for processing requests in a large-scale concurrent communication network system based on a microservices architecture. Background Art

[0002] With the continuous increase in the number of users and the continuous expansion of services, more and more requests need to be processed by servers. To avoid the accumulation of requests, it is usually necessary to arrange more servers to complete the task.

[0003] In traditional technologies, when using a server to process requests, a random allocation method is generally adopted. However, this random allocation method is likely to result in a long request processing time, thereby causing low request processing efficiency. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product for processing requests in a large-scale concurrent communication network system based on a microservices architecture, which can improve the request processing efficiency.

[0005] In a first aspect, the present application provides a method for processing requests in a large-scale concurrent communication network system based on a microservices architecture, including:

[0006] When a request to be processed is received, determine a current server from multiple candidate servers according to a preset server polling order;

[0007] Obtain the current load data and historical load data of the current server;

[0008] Respectively perform feature extraction processing on the current load data and the historical load data to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data;

[0009] Perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector;

[0010] Input the fusion feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server;

[0011] When the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server, so that the current server processes the request to be processed.

[0012] In one embodiment, after inputting the fusion feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server, the method further includes:

[0013] In the case where the predicted load data is greater than the preset load threshold, determine the next server corresponding to the current server from the multiple candidate servers according to the preset server polling order;

[0014] Use the next server corresponding to the current server as the new current server, and jump to the step of obtaining the current load data and historical load data of the current server until the predicted load data of the determined new current server is less than or equal to the preset load threshold.

[0015] In one embodiment, before receiving a request to be processed and determining the current server from multiple candidate servers according to the preset server polling order, the method further includes:

[0016] Obtain the target service type of the candidate request;

[0017] According to the target service type, query the corresponding relationship between the service type and the processing priority to obtain the target processing priority corresponding to each candidate request;

[0018] From each candidate request, screen out the candidate requests whose target processing priority is greater than or equal to the preset processing priority as the requests to be processed.

[0019] In one embodiment, the step of respectively performing feature extraction processing on the current load data and the historical load data to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data includes:

[0020] Respectively perform preprocessing on the current load data and the historical load data to obtain preprocessed current load data and preprocessed historical load data;

[0021] Use the preprocessed current load data as the main data and the preprocessed historical load data as the auxiliary data, and input them into a feature extraction model for feature extraction processing to obtain a feature vector corresponding to the preprocessed current load data as the first feature vector;

[0022] Use the preprocessed historical load data as the main data and the preprocessed current load data as the auxiliary data, and input them into the feature extraction model for feature extraction processing to obtain a feature vector corresponding to the preprocessed historical load data as the second feature vector.

[0023] In one embodiment, the fusing the first feature vector and the second feature vector to obtain a fused feature vector includes:

[0024] Obtaining a first initial weight corresponding to the current load data and a second initial weight corresponding to the historical load data;

[0025] Normalizing the first initial weight and the second initial weight to obtain a first target weight corresponding to the current load data and a second target weight corresponding to the historical load data;

[0026] Fusing the first feature vector and the second feature vector according to the first target weight and the second target weight to obtain the fused feature vector.

[0027] In one embodiment, the pre-trained load prediction model is trained by the following method:

[0028] Obtaining current sample load data and historical sample load data of a sample server;

[0029] Performing feature extraction processing on the current sample load data and the historical sample load data respectively to obtain a first sample feature vector corresponding to the current sample load data and a second sample feature vector corresponding to the historical sample load data;

[0030] Fusing the first sample feature vector and the second sample feature vector to obtain a sample fused feature vector;

[0031] Inputting the sample fused feature vector into a load prediction model to be trained to obtain predicted load data of the sample server;

[0032] Obtaining actual load data of the sample server, and iteratively training the load prediction model to be trained according to the difference between the predicted load data and the actual load data of the sample server to obtain the pre-trained load prediction model.

[0033] In a second aspect, the present application further provides a request processing device for a large-scale concurrent communication network system based on a microservice architecture, including:

[0034] A server determination module, configured to determine a current server from multiple candidate servers according to a preset server polling order when receiving a request to be processed;

[0035] A data acquisition module, configured to acquire current load data and historical load data of the current server;

[0036] A feature extraction module, configured to perform feature extraction processing on the current load data and the historical load data respectively, to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data;

[0037] A vector fusion module, configured to perform fusion processing on the first feature vector and the second feature vector to obtain a fused feature vector;

[0038] A load prediction module, configured to input the fused feature vector into a pre-trained load prediction model to obtain predicted load data of the current server;

[0039] A request processing module, configured to, when the predicted load data is less than or equal to a preset load threshold, send the to-be-processed request to the current server, so that the current server processes the to-be-processed request.

[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0041] When a to-be-processed request is received, determine a current server from multiple candidate servers according to a preset server polling order;

[0042] Obtain the current load data and the historical load data of the current server;

[0043] Perform feature extraction processing on the current load data and the historical load data respectively, to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data;

[0044] Perform fusion processing on the first feature vector and the second feature vector to obtain a fused feature vector;

[0045] Input the fused feature vector into a pre-trained load prediction model to obtain predicted load data of the current server;

[0046] When the predicted load data is less than or equal to a preset load threshold, send the to-be-processed request to the current server, so that the current server processes the to-be-processed request.

[0047] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0048] Upon receiving a request to be processed, determine the current server from multiple candidate servers according to a preset server polling order;

[0049] Obtain the current load data and historical load data of the current server;

[0050] Perform feature extraction processing on the current load data and the historical load data respectively to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data;

[0051] Perform fusion processing on the first feature vector and the second feature vector to obtain a fused feature vector;

[0052] Input the fused feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server;

[0053] When the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server to enable the current server to process the request to be processed.

[0054] In a fifth aspect, the present application further provides a computer program product, including a computer program, which when executed by a processor, implements the following steps:

[0055] Upon receiving a request to be processed, determine the current server from multiple candidate servers according to a preset server polling order;

[0056] Obtain the current load data and historical load data of the current server;

[0057] Perform feature extraction processing on the current load data and the historical load data respectively to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data;

[0058] Perform fusion processing on the first feature vector and the second feature vector to obtain a fused feature vector;

[0059] Input the fused feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server;

[0060] When the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server to enable the current server to process the request to be processed.

[0061] The above request processing method, device, computer device, storage medium and computer program product of a large-scale concurrent communication network system based on a microservices architecture, when receiving a request to be processed, first determine the current server from multiple candidate servers according to a preset server polling order, then obtain the current load data and historical load data of the current server, and then, perform feature extraction processing on the current load data and historical load data respectively to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data, and perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector, and then, input the fusion feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server, and finally, when the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server, so that the current server processes the request to be processed. In this way, when using a server to process a request, first initially screen the server through the polling order, then use the load prediction model to comprehensively consider the current and historical load data to predict the server load, and use the preset load threshold to determine whether to allocate the request to this server for processing, so as to ensure that the request is sent to a server with sufficient processing capacity, reduce the time for the request to queue and wait in the server, and is beneficial to improving the request processing efficiency; moreover, this method avoids the defect that the random allocation method is likely to lead to a long request processing time, resulting in low request processing efficiency, and further improves the request processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained without creative efforts based on these drawings.

[0063] Figure 1 It is a schematic flowchart of a request processing method for a large-scale concurrent communication network system based on a microservices architecture in one embodiment;

[0064] Figure 2 It is a schematic flowchart of a request processing method for a large-scale concurrent communication network system based on a microservices architecture in another embodiment;

[0065] Figure 3 It is a schematic diagram of a large-scale concurrent communication network system based on a microservices architecture in one embodiment;

[0066] Figure 4The structural block diagram of a request processing device for a large-scale concurrent communication network system based on a microservices architecture in an embodiment;

[0067] Figure 5 The internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0068] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0069] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant regulations.

[0070] In an exemplary embodiment, as Figure 1 shown, a request processing method for a large-scale concurrent communication network system based on a microservices architecture is provided. In this embodiment, the method is described by taking its application to a server as an example; it can be understood that the method can also be applied to a terminal, or to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but is not limited to various personal computers, laptop computers, smart phones and tablet computers; the server can be implemented by an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:

[0071] Step S101, when a request to be processed is received, determine the current server from multiple candidate servers according to a preset server polling order.

[0072] Among them, the request to be processed refers to a request task that needs to be processed.

[0073] Among them, the preset server polling order is used to represent the order corresponding to the request processing by the preset server, such as the server number, etc.

[0074] Among them, the candidate server refers to a server to be selected.

[0075] Among them, the current server refers to the server corresponding to the processing of the request to be processed.

[0076] Exemplarily, the server obtains the number corresponding to the candidate server, and determines the preset server polling order according to the number corresponding to the candidate server; then, when the server receives a request to be processed, it determines the candidate server corresponding to the server polling order from multiple candidate servers according to the preset server polling order as the current server.

[0077] Step S102, obtain the current load data and historical load data of the current server.

[0078] Among them, the current load data refers to the load data of the current server at the current time.

[0079] Among them, the load data is used to represent the change of indicators such as CPU (Central Processing Unit) usage rate, memory usage rate, and network bandwidth usage rate over time.

[0080] Among them, the historical load data refers to the load data of the current server at historical times (such as the past week, the past month).

[0081] Exemplarily, the server obtains the load data of the current server and the time information corresponding to each load data from the database; then, the server divides and processes the load data of the current server according to the time information corresponding to each load data to obtain the current load data and historical load data of the current server.

[0082] Step S103, perform feature extraction processing on the current load data and historical load data respectively to obtain the first feature vector corresponding to the current load data and the second feature vector corresponding to the historical load data.

[0083] Among them, the first feature vector refers to the feature vector corresponding to the current load data.

[0084] Among them, the second feature vector refers to the feature vector corresponding to the historical load data.

[0085] Exemplarily, the server inputs the current load data into the feature extraction model, and the feature extraction model performs feature extraction processing on the current load data to obtain the feature vector corresponding to the current load data as the first feature vector; then, the server inputs the historical load data into the feature extraction model, and the feature extraction model performs feature extraction processing on the historical load data to obtain the feature vector corresponding to the historical load data as the second feature vector.

[0086] Step S104, perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector.

[0087] Among them, the fusion processing may refer to weighted summation processing.

[0088] The fused feature vector refers to the feature vector obtained by fusing the first feature vector and the second feature vector.

[0089] Exemplarily, the server fuses the first feature vector and the second feature vector to obtain a fused feature vector; for example, the server performs weighted summation processing on the first feature vector and the second feature vector to obtain a fused feature vector.

[0090] Step S105: Input the fused feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server.

[0091] The load prediction model refers to a network model that can use the fused feature vector corresponding to the current load data and historical load data of the current server to obtain the predicted load data of the current server, such as an ARIMA (Autoregressive Integrated Moving Average) model.

[0092] The predicted load data refers to the load data of the current server in the future (such as the next week or the next month).

[0093] Exemplarily, the server iteratively trains the load prediction model to be trained based on the current sample load data and historical sample load data of the sample server to obtain a pre-trained load prediction model; then, the server inputs the fused feature vector into the pre-trained load prediction model to obtain the predicted load data corresponding to the fused feature vector as the predicted load data of the current server.

[0094] Step S106: When the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server so that the current server processes the request to be processed.

[0095] The preset load threshold refers to a preset load threshold used to judge the predicted load data. It should be noted that the preset load threshold can be determined according to the situation.

[0096] Exemplarily, when the predicted load data is less than or equal to the preset load threshold, the server establishes a network connection with the current server; then, the server generates a request processing instruction corresponding to the request to be processed and sends the request to be processed and the request processing instruction corresponding to the request to be processed to the current server according to this network connection, so that the current server processes the request to be processed according to the request processing instruction corresponding to the request to be processed.

[0097] In the above request processing method of the large-scale concurrent communication network system based on the microservice architecture, when a request to be processed is received, first, according to the preset server polling order, the current server is determined from multiple candidate servers. Then, the current load data and historical load data of the current server are obtained. Next, feature extraction processing is respectively performed on the current load data and historical load data to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data. And the first feature vector and the second feature vector are fused to obtain a fused feature vector. Then, the fused feature vector is input into a pre-trained load prediction model to obtain the predicted load data of the current server. Finally, when the predicted load data is less than or equal to the preset load threshold, the request to be processed is sent to the current server, and the current server processes the request to be processed. In this way, when using the server to process the request, first, the server is initially screened through the polling order, and then the load prediction model is used to comprehensively consider the current and historical load data to predict the server load, and the preset load threshold is used to determine whether to allocate the request to the server for processing, so as to ensure that the request is sent to a server with sufficient processing capacity, reduce the time for the request to queue and wait in the server, and is conducive to improving the request processing efficiency. Moreover, this method avoids the defect that the random allocation method is likely to lead to a long request processing time, resulting in low request processing efficiency, and further improves the request processing efficiency.

[0098] In an exemplary embodiment, after the step S105 of inputting the fused feature vector into the pre-trained load prediction model to obtain the predicted load data of the current server, the following specific contents are included: when the predicted load data is greater than the preset load threshold, according to the preset server polling order, the next server corresponding to the current server is determined from multiple candidate servers; the next server corresponding to the current server is used as the new current server, and it jumps to the step of obtaining the current load data and historical load data of the current server until the predicted load data of the newly determined current server is less than or equal to the preset load threshold.

[0099] Exemplarily, when the predicted load data of the server is greater than the preset load threshold, according to the preset server polling order, the next server corresponding to the current server is determined from multiple candidate servers. For example, the preset server polling order is from the smallest number to the largest number. If the number of the current server is 3, then the next server corresponding to the current server is the server with the number 4. Then, the server uses the next server corresponding to the current server as the new current server and jumps to the step of obtaining the current load data and historical load data of the current server until the predicted load data of the newly determined current server is less than or equal to the preset load threshold.

[0100] In this embodiment, when the predicted load data is greater than the preset load threshold, the servers are switched according to the preset polling order, so that a certain server can be prevented from being in a high-load state for a long time, load balancing among multiple candidate servers is achieved, the resources of the entire server cluster are reasonably utilized, and the processing capacity and stability of the overall system are improved accordingly.

[0101] In an exemplary embodiment, before step S101 of determining the current server from multiple candidate servers according to the preset server polling order when a request to be processed is received, the following specific contents are included: obtaining the target service type of the candidate request; querying the corresponding relationship between the service type and the processing priority according to the target service type to obtain the target processing priority corresponding to each candidate request; and screening out the candidate requests whose target processing priority is greater than or equal to the preset processing priority from each candidate request as the requests to be processed.

[0102] Among them, the candidate request refers to the request task to be selected.

[0103] Among them, the target service type refers to the service type of the candidate request, including financial transaction services (such as real-time transfer services), core operation services (including commodity order placement services, inventory update services), user identity verification services, etc.

[0104] Among them, the corresponding relationship between the service type and the processing priority is used to represent the association information between the service type and the processing priority. For example, the service type of the request being a financial transaction service corresponds to the highest priority, the service type of the request being a core operation service (commodity order placement, inventory update) corresponds to a relatively high priority, and the service type of the request being user identity verification corresponds to a medium priority.

[0105] Among them, the target processing priority refers to the processing priority corresponding to each candidate request, including the highest priority, relatively high priority, medium priority, etc.

[0106] Among them, the preset processing priority refers to the processing priority set in advance, such as a relatively high priority.

[0107] Exemplarily, the server obtains the service identifier carried by the candidate request, and determines the service type of the candidate request as the target service type according to the service identifier carried by the candidate request; then, the server queries the corresponding relationship between the service type and the processing priority according to the target service type to obtain the target processing priority corresponding to each candidate request; then, the server screens out the candidate requests whose target processing priority is greater than or equal to the preset processing priority from each candidate request, and uses these candidate requests as the requests to be processed.

[0108] In this embodiment, by clarifying the target processing priorities of each candidate request and screening out the requests to be processed whose priorities reach a certain standard, it can ensure that system resources are preferentially allocated to more important or urgent services, avoiding the situation where system resources are heavily occupied by low-priority services, resulting in high-priority services not being processed in a timely manner, so that the limited system resources can be utilized more efficiently.

[0109] In an exemplary embodiment, for the above step S103, feature extraction processing is respectively performed on the current load data and the historical load data to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data. The specific content is as follows: The current load data and the historical load data are respectively preprocessed to obtain the preprocessed current load data and the preprocessed historical load data; the preprocessed current load data is used as the main data, and the preprocessed historical load data is used as the auxiliary data, and they are input into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed current load data as the first feature vector; the preprocessed historical load data is used as the main data, and the preprocessed current load data is used as the auxiliary data, and they are input into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed historical load data as the second feature vector.

[0110] Among them, the preprocessed current load data refers to the current load data after preprocessing.

[0111] Among them, the preprocessed historical load data refers to the historical load data after preprocessing.

[0112] Among them, the main data can refer to the data with a relatively large corresponding weight.

[0113] Among them, the auxiliary data can refer to the data with a relatively small corresponding weight.

[0114] Exemplarily, the server preprocesses the current load data and the historical load data respectively to obtain the preprocessed current load data and the preprocessed historical load data. For example, the server uses data processing techniques to clean, fuse, and transform the current load data and the historical load data respectively to obtain the preprocessed current load data and the preprocessed historical load data. Then, the server takes the preprocessed current load data as the main data and the preprocessed historical load data as the auxiliary data, and inputs them into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed current load data, which is used as the first feature vector. For example, it is determined that the weight corresponding to the preprocessed current load data is 0.8, and the weight corresponding to the preprocessed historical load data is 0.2. Then, according to the weights corresponding to the preprocessed current load data and the preprocessed historical load data, the preprocessed current load data and the preprocessed historical load data are input into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed current load data, which is used as the first feature vector. Then, the server takes the preprocessed historical load data as the main data and the preprocessed current load data as the auxiliary data, and inputs them into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed historical load data, which is used as the second feature vector.

[0115] In this embodiment, by taking the preprocessed current load data as the main data and the historical load data as the auxiliary data, and vice versa, taking the historical load data as the main data and the current load data as the auxiliary data, and inputting them into the feature extraction model for processing respectively, the feature information in the data can be comprehensively mined from different angles, which is beneficial to improving the comprehensiveness of the first feature vector and the second feature vector.

[0116] In an exemplary embodiment, the above step S104 of fusing the first feature vector and the second feature vector to obtain a fused feature vector specifically includes the following content: obtaining the first initial weight corresponding to the current load data and the second initial weight corresponding to the historical load data; normalizing the first initial weight and the second initial weight to obtain the first target weight corresponding to the current load data and the second target weight corresponding to the historical load data; and fusing the first feature vector and the second feature vector according to the first target weight and the second target weight to obtain a fused feature vector.

[0117] Among them, the first initial weight refers to the weight initially assigned to the current load data.

[0118] Among them, the second initial weight refers to the weight initially assigned to the historical load data.

[0119] Among them, the first target weight refers to the weight finally assigned to the current load data.

[0120] Among them, the second target weight refers to the weight finally assigned to the historical load data.

[0121] Exemplarily, the server determines a first initial weight corresponding to the current load data and a second initial weight corresponding to the historical load data according to the importance levels of the current load data and the historical load data (such as determined based on prior knowledge and experience); then, the server performs a normalization process on the first initial weight and the second initial weight to obtain a first target weight corresponding to the current load data and a second target weight corresponding to the historical load data; for example, if the first initial weight is 0.9 and the second initial weight is 0.6, after the normalization process, the first target weight corresponding to the current load data is 0.6, and the second target weight corresponding to the historical load data is 0.4; then, the server performs a fusion process on the first feature vector and the second feature vector according to the first target weight and the second target weight to obtain a fused feature vector; for example, the server performs a weighted summation process on the first feature vector and the second feature vector according to the first target weight and the second target weight to obtain a fused feature vector.

[0122] In this embodiment, by performing a normalization process on the first initial weight and the second initial weight, the weight allocation becomes more scientific, reasonable, and comparable; moreover, according to the first target weight and the second target weight, a fusion process is performed on the first feature vector and the second feature vector to obtain a fused feature vector, so that the feature information extracted from the current load data and the historical load data respectively can be comprehensively and effectively integrated, which is beneficial to improving the determination accuracy of the fused feature vector.

[0123] In an exemplary embodiment, a method for processing requests in a large-scale concurrent communication network system based on a microservice architecture provided by the present application further includes a training step of a pre-trained load prediction model, which specifically includes the following contents: obtaining the current sample load data and the historical sample load data of the sample server; respectively performing feature extraction processing on the current sample load data and the historical sample load data to obtain a first sample feature vector corresponding to the current sample load data and a second sample feature vector corresponding to the historical sample load data; performing a fusion process on the first sample feature vector and the second sample feature vector to obtain a sample fused feature vector; inputting the sample fused feature vector into the load prediction model to be trained to obtain the predicted load data of the sample server; obtaining the actual load data of the sample server, and iteratively training the load prediction model to be trained according to the difference between the predicted load data and the actual load data of the sample server to obtain a pre-trained load prediction model.

[0124] Among them, the sample server refers to the server used to train the load prediction model.

[0125] Among them, the current sample load data refers to the current load data of the sample server.

[0126] Among them, the historical sample load data refers to the historical load data of the sample server.

[0127] Among them, the first sample feature vector refers to the feature vector corresponding to the current sample load data.

[0128] Among them, the second sample feature vector refers to the feature vector corresponding to the historical sample load data.

[0129] Among them, the sample fusion feature vector refers to the feature vector obtained by performing a fusion process on the first sample feature vector and the second sample feature vector.

[0130] Among them, the predicted load data of the sample server refers to the predicted value corresponding to the load data of the sample server.

[0131] Among them, the actual load data of the sample server refers to the actual value corresponding to the load data of the sample server.

[0132] Exemplarily, in response to a model training instruction for a load prediction model to be trained, the server obtains the current sample load data and the historical sample load data of the sample server from the database; then, the server respectively inputs the current sample load data and the historical sample load data into a feature extraction model for feature extraction processing, obtaining a first sample feature vector corresponding to the current sample load data and a second sample feature vector corresponding to the historical sample load data; then, the server performs a fusion process on the first sample feature vector and the second sample feature vector to obtain a sample fusion feature vector; then, the server inputs the sample fusion feature vector into the load prediction model to be trained to obtain the predicted load data of the sample server; then, the server obtains the actual load data of the sample server and, based on the difference between the predicted load data and the actual load data of the sample server, obtains a loss value; then, the server adjusts the model parameters of the load prediction model to be trained according to the loss value; then, the server retrains the load prediction model with the adjusted model parameters until the loss value obtained by the trained load prediction model is less than the loss value threshold, then stops training, and uses this trained load prediction model as the pre-trained load prediction model.

[0133] In this embodiment, by pre-training the load prediction model, it is convenient to predict the predicted load data of the current server after obtaining the current load data and the historical load data of the current server in practical applications; moreover, the load prediction model receives new data in each round of iteration for internal improvement and optimization of the model, facilitating more effective prediction and being conducive to improving the prediction accuracy of the load prediction model.

[0134] In an exemplary embodiment, as Figure 2 shown, another method for processing requests of a large-scale concurrent communication network system based on a microservice architecture is provided. Taking the application of this method to a server as an example, the method includes the following steps:

[0135] Step S201, when a request to be processed is received, determine the current server from multiple candidate servers according to a preset server polling order.

[0136] Step S202, obtain the current load data and historical load data of the current server.

[0137] Step S203, preprocess the current load data and historical load data respectively to obtain the preprocessed current load data and preprocessed historical load data.

[0138] Step S204, take the preprocessed current load data as the main data and the preprocessed historical load data as the auxiliary data, input them into a feature extraction model for feature extraction processing, and obtain the feature vector corresponding to the preprocessed current load data as the first feature vector.

[0139] Step S205, take the preprocessed historical load data as the main data and the preprocessed current load data as the auxiliary data, input them into a feature extraction model for feature extraction processing, and obtain the feature vector corresponding to the preprocessed historical load data as the second feature vector.

[0140] Step S206, obtain the first initial weight corresponding to the current load data and the second initial weight corresponding to the historical load data.

[0141] Step S207, perform normalization processing on the first initial weight and the second initial weight to obtain the first target weight corresponding to the current load data and the second target weight corresponding to the historical load data.

[0142] Step S208, perform fusion processing on the first feature vector and the second feature vector according to the first target weight and the second target weight to obtain a fusion feature vector.

[0143] Step S209, input the fusion feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server.

[0144] Step S210, when the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server so that the current server processes the request to be processed.

[0145] Step S211, when the predicted load data is greater than the preset load threshold, determine the next server corresponding to the current server from multiple candidate servers according to the preset server polling order.

[0146] Step S212, use the next server corresponding to the current server as the new current server, and jump to the step of obtaining the current load data and historical load data of the current server until the predicted load data of the determined new current server is less than or equal to the preset load threshold.

[0147] In the above request processing method of a large-scale concurrent communication network system based on a microservices architecture, when using a server to process a request, first initially screen the servers through the polling order, then use a load prediction model to comprehensively consider the current and historical load data to predict the server load, and use a preset load threshold to determine whether to allocate the request to this server for processing, so as to ensure that the request is sent to a server with sufficient processing capacity, reduce the time for the request to queue and wait in the server, and is beneficial to improving the request processing efficiency; moreover, this method avoids the defect that the random allocation method is likely to lead to a longer request processing time, resulting in a lower request processing efficiency, and further improves the request processing efficiency. For the load balancing technologies in traditional technologies, the common ones are polling, weighted polling, and least connections algorithm. The polling algorithm distributes requests in order without considering the actual processing capacity of the server; weighted polling assigns weights according to the server performance, but the weight setting is relatively static; the least connections algorithm only focuses on the number of connections and ignores the request complexity and server processing capacity. For the asynchronous communication technologies in traditional technologies, the message distribution algorithms in the message queue often have uneven message distribution and do not fully consider the processing capacity of functional units and message priorities. Compared with the above traditional technologies, this method can effectively improve the request processing efficiency.

[0148] In an exemplary embodiment, to more clearly illustrate a request processing method of a large-scale concurrent communication network system based on a microservices architecture provided by an embodiment of the present application, the following uses a specific embodiment to specifically describe the request processing method of the large-scale concurrent communication network system based on a microservices architecture. In one embodiment, as Figure 3As shown in the figure, the present application also provides a large-scale concurrent communication network system and its method based on a microservices architecture. When using a server to process requests, upon receiving a request to be processed, first determine the current server from multiple candidate servers according to a preset server polling order, then obtain the current load data and historical load data of the current server. Next, perform feature extraction processing on the current load data and historical load data respectively to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data, and perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector. Then, input the fusion feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server. Finally, when the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server so that the current server processes the request to be processed. The specific content is as follows:

[0149] I. Technical improvements regarding load balancing:

[0150] Node layout and communication mechanism: In a distributed architecture, multiple server nodes and a load balancing control node are established. The server nodes are connected to the load balancing control node through a high-speed network to ensure low-latency data transmission. For example, in a cloud computing environment, each server node is distributed on different physical servers, and they communicate with the load balancing control node through an internal network to transmit load information and receive assigned requests.

[0151] Data collection and aggregation: Each server node S i real-time collects its own load-related data D i ={CPU i (t), Mem i (t), Net i (t),…}, where CPU i (t) represents the CPU usage rate of server i at time t, Mem i (t) represents the memory usage rate, and Net i (t) represents the network bandwidth usage rate. These data are sent to the load balancing control node for aggregation at a fixed time interval △t (for example, every 10 seconds). For example, server S 1 at time t 1 collects CPU 1 (t 1 ) = 60%, Mem 1 (t 1 ) = 40%, NNet 1 (t 1 ) = 30% and sends these data to the load balancing control node.

[0152] (1) Implementation of polling algorithm

[0153] Request queue management: The load balancing control node maintains a request queue Q = {q 1 ,q 2 ,…,q m}. When an external request arrives, it is sequentially placed into the queue. For example, in an e-commerce system, requests such as user order submission requests and product query requests first enter this request queue.

[0154] Polling to select a server: The load balancing control node selects a server from the server list in the polling order to process the request. Let the current polling index be k, then select the server S(k mod n)+1 to process the next request, where n is the number of server nodes. For example, there are servers S 1 、S 2 、S 3 . If the current polling index k = 3, then (3 mod 3)+1 = 1, and the next request will be assigned to S 1 .

[0155] (2) Implementation of prediction-based algorithm

[0156] 1. Data preparation:

[0157] (1) Collect historical load data: Collect historical load data from each server node in the distributed architecture. These data include the changing situations of indicators such as CPU usage rate, memory usage rate, and network bandwidth usage rate over time. For example, record the CPU usage rate of the server at fixed time intervals (such as every minute) to form a time series data.

[0158] (2) Data preprocessing and standardization: Conduct a stationarity test on the collected time series data. Commonly used methods include the ADF (Augmented Dickey-Fuller Test) test. If the data is not stationary, differencing processing is required to make the data stationary. Standardize the stationary time series data so that its mean is 0 and variance is 1. The standardization formula is:

[0159]

[0160] where x is the original data, μ is the mean of the data, and σ is the standard deviation of the data.

[0161] 2. Construction of ARIMA model:

[0162] (1) Determine the model order:

[0163] Determination of the autoregressive order p: The autoregressive order p is initially determined through the Autocorrelation Function (ACF) and the Partial Autocorrelation Function (PACF). Observe the ACF and PACF plots and select the value of p based on their properties of trailing and truncating. For example, from the ACF and PACF plots of the CPU usage differential data of server S 1 it is found that the PACF truncates after a lag of 2 periods, and p = 2 is initially determined.

[0164] Determination of the moving average order q: Similarly based on the ACF and PACF plots, determine the moving average order q according to their characteristics. For example, if the ACF truncates after a lag of 3 periods, q = 3 is initially determined.

[0165] Determination of the differencing order d: The differencing order d that makes the data stationary has already been determined in the previous data preprocessing.

[0166] (2) Construct the ARIMA(p, d, q) model

[0167] Based on the determined values of p, d, and q, construct the ARIMA model expression. The general form of the ARIMA model is:

[0168]

[0169] where L is the lag operator, Y t is the time series data, and ∈ t is the white noise sequence. For example, for the CPU usage data of server S 1 construct the ARIMA(2, 1, 3) model.

[0170] 3. Estimate the model parameters using the least squares method:

[0171] The goal of the least squares method is to find a set of model parameters such that the sum of squared residuals is minimized.

[0172] where

[0173] Parameter estimation process: Expand the constructed ARIMA model to obtain a linear equation about the parameters. For example, for the ARIMA(2, 1, 3) model, after expansion, a linear equation about θ 1 、θ 2 、θ 3 can be obtained.

[0174] Let X is a matrix consisting of historical data, and y is a residual vector. Then the least squares problem can be expressed as

[0175] By solving the normal equation X T Xβ=X T y to get the estimated value of parameter β.

[0176] 4. Model training process:

[0177] (1) Initialization parameters: Randomly initialize the parameters of the ARIMA model

[0178] (2) Iterative optimization: In each iteration, the residual ∈ is calculated based on the current parameter value. t , and then use the least squares method to update the parameter value. Repeat this process until the stopping condition is met. The stopping condition can be that the change in the residual sum of squares is less than a certain threshold, or that a predetermined number of iterations is reached. For example, the iteration is stopped when the change in the residual sum of squares is less than 0.001 or the number of iterations reaches 100.

[0179] (3) Model evaluation:

[0180] Use the validation set data to evaluate the trained ARIMA model. Calculate evaluation indicators such as mean squared error (MSE) Where m is the number of validation set data, y i is the actual value, is the predicted value. The evaluation index is used to determine whether the model meets the requirements. If not, the model order p, q can be adjusted or retrained.

[0181] 5. Predict future load conditions:

[0182] (1) Use the trained model to make predictions:

[0183] When the model training is completed and the evaluation is passed, the latest load data is input into the ARIMA model, and the load forecast value of the server in the future is calculated according to the model formula, such as predicting the CPU usage of the server at the next 5 time points.

[0184] (2) Load determination and request allocation based on prediction results:

[0185] The predicted load value is compared with the set overload threshold. If the predicted load exceeds the threshold, the request is distributed to other servers during the load balancing process to avoid overloading the server.

[0186] Load balancing works in both the gateway module and the load balancing module. The details are as follows:

[0187] Load Balancing at the Gateway Layer: In the gateway module, dedicated gateway software or a load balancer is typically used to achieve load balancing. When an external request arrives at the gateway, the gateway forwards the request to different microservice instances at the backend according to the preset load balancing strategy (a combination of round-robin and prediction-based algorithms). Among them, gateway software includes Zuul (a load balancer), Spring Cloud Gateway (a cloud gateway for microservice frameworks), etc.; load balancers include Nginx (a reverse proxy web server), etc.

[0188] Load Balancing at the Service Invocation Layer: In the load balancing module, especially in a microservice architecture, client-side load balancing tools achieve load balancing at the service invocation layer. When a microservice needs to invoke another microservice, the load balancing tool selects an appropriate service instance for invocation according to the configured strategy.

[0189] Regarding the Application of the Combination of Round-Robin and Prediction-Based Algorithms in a Large-Scale Concurrent Communication Network System Based on Microservice Architecture:

[0190] When the load balancer distributes requests, it first selects a microservice instance as a candidate instance according to the round-robin algorithm. Then, it judges based on the load prediction result of the candidate instance by the prediction-based algorithm. If it is predicted that the candidate instance may be overloaded, the load balancer will reassign the request to other microservice instances that are judged to have a lighter load according to the prediction algorithm. For example, in an online education system, when a new course playback request arrives, the load balancer first selects a course service instance A according to the round-robin algorithm, and then checks the load prediction of instance A by the prediction-based algorithm. If it is predicted that the CPU usage rate of this instance will exceed 80% (the set overload threshold) in the next few minutes, the request will not be assigned to instance A. After finding that course service instance A is overloaded, the load balancer will select another course service instance B with a lighter predicted load to handle this course playback request.

[0191] The system continuously monitors the actual load conditions of each microservice instance in real time and feeds this new data back to the prediction algorithm for updating the prediction model. According to the operating state and load change characteristics of the system, the weights and application methods of the round-robin algorithm and the prediction-based algorithm are dynamically adjusted. For example, in a logistics management system, as the real-time volume of express delivery business changes, the loads of each express delivery processing microservice instance are also constantly changing. The load balancer collects these load data in real time and updates the prediction algorithm based on the ARIMA model every 10 minutes to ensure that the prediction results can accurately reflect the current system state.

[0192] In the initial stage of system operation, due to the small amount of data, the accuracy of the prediction algorithm may not be high. At this time, appropriately increase the weight of the polling algorithm. As the system runs for a longer time and data accumulates, gradually increase the weight of the prediction-based algorithm.

[0193] II. Improvement on asynchronous communication technology:

[0194] Traditional asynchronous communication technology uses message distribution algorithms in message queues. For example, in some message queue systems, a distribution algorithm based on topics or tags may be adopted to distribute messages to functional units that have subscribed to the corresponding topics or tags. However, there is a situation of uneven message distribution. If the processing capabilities of functional units are different, but the message distribution algorithm does not take this into account, it may lead to idle functional units with strong processing capabilities, while functional units with weak processing capabilities are overloaded with a large number of messages.

[0195] To solve the above problems, a combination of a message complexity prediction algorithm based on decision trees and a message allocation algorithm based on the greedy strategy is used. The decision tree algorithm is used to predict the processing complexity of each message. The input features of the decision tree can include the size of the message, message type, data structure in the message, etc. Through learning from a large amount of historical message processing data, the decision tree can predict whether a message is a simple message or a complex message. According to the message complexity prediction results, the message allocation algorithm based on the greedy strategy allocates complex messages to functional units with strong processing capabilities, and simple messages to functional units with relatively weak processing capabilities. The greedy strategy aims to select the currently optimal functional unit each time a message is allocated to maximize the overall message processing efficiency.

[0196] For example, in an e-commerce order processing system, order messages contain different information, such as ordinary commodity orders, promotional commodity orders, combined orders containing multiple commodities, etc. Through the message complexity prediction algorithm based on decision trees, according to features such as the number of commodities in the order message and whether it contains promotional information, the processing complexity of the order message is predicted. The message allocation algorithm based on the greedy strategy will allocate order messages with high processing complexity (such as combined orders containing multiple promotional commodities) to order processing microservice instances with high configuration and strong processing capabilities, while allocating order messages with low processing complexity (such as single ordinary commodity orders) to microservice instances with lower configuration.

[0197] The specific implementation steps are as follows:

[0198] 1. Message complexity prediction algorithm based on decision trees:

[0199] (1) Data collection and preprocessing:

[0200] In a large-scale concurrent communication network system based on a microservices architecture, historical message processing data is collected from the message queues of each business module. For example, in an e-commerce system, message data is extracted from the relevant message queues of the order processing module, inventory management module, user management module, etc. The collected data includes the basic attributes of the message (such as the message size S, in bytes; the message type T, which can be the encoding of different business types), the business data characteristics carried by the message (such as the number of items N and the variety of items K in an order), and the system resources and time consumed in processing the message (such as the CPU time C for processing the message, in milliseconds; the memory occupancy M, in megabytes), etc. t and other information.

[0201] Let the collected data set be D = {(x 1 , y 1 ), (x 2 , y 2 ), …, (x n , y n )}, where x i represents the feature vector of the i-th message, x i = (S i , T i , N i , K i , …), and y i represents the complexity of processing the i-th message. The complexity is defined as a comprehensive index. For example where α and β are weight coefficients, which are set according to the degree of importance the system attaches to CPU time and memory occupancy.

[0202] Remove the noise points and outliers from the data. For example, if it is found that the CPU time C for processing a certain message t is far beyond the normal range (such as being higher than the average processing time of the same type of message by multiple standard deviations), it is considered that this may be due to system failures or other abnormal situations resulting in data anomalies, and it will be deleted from the data set. Normalize the values of different features so that they are mapped to the same numerical range for subsequent algorithm processing. Through the min-max normalization method, the formula is

[0203] (2) Construct a decision tree model:

[0204] Feature selection: Analyze the feature importance and determine the influence degree of each feature of the message on the message complexity through information gain.

[0205] For example, for feature f, the information gain where is the entropy of dataset D, c is the number of categories (divided into several categories according to the value range of complexity), values(f) are all possible values of feature f, and D v is the subset where the value of feature f is v.

[0206] According to the calculated feature importance, select the features that have a significant impact on the message complexity as the input features of the decision tree. For example, in an image recognition system, after calculation, it is found that features such as the resolution of the image, the number of colors in the image, and the type of the image (such as portrait, landscape, etc.) have a large information gain, so these features are selected as the input features of the decision tree.

[0207] Construct a decision tree: Decision tree splitting rules. Construct a decision tree based on the selected features. Starting from the root node, split according to different values of each feature until the stopping condition is met. For example, taking the image resolution as the root node feature, if the resolution is greater than 1624*768, then branch to the left subtree, otherwise branch to the right subtree. Continue to split with other features in the subtree. For example, in the left subtree, take the number of colors as the splitting feature. If the number of colors is greater than 1 million, then continue to branch to the left subtree, otherwise branch to the right subtree.

[0208] (3) Model training and evaluation:

[0209] Train the decision tree: Recursive partitioning training.

[0210] Use the preprocessed dataset D to train the constructed decision tree. The training process is to continuously adjust the structure of the decision tree so that for each node, after splitting according to the feature of that node, the sample purity of the child nodes is as high as possible. Specifically, for node t, calculate the splitting criterion (such as information gain) for each feature f i and select the feature that makes the splitting criterion optimal for splitting. For example, calculate the information gain of all candidate features at a certain node. Assume that the information gain of the image type feature is the largest, then use the image type as the splitting feature to divide the dataset of that node into different subsets, corresponding to different child nodes.

[0211] The stopping conditions include that the depth of the tree reaches the preset value d max the number of samples in the node is less than a certain threshold n min or all features have been used for splitting, etc.

[0212] Evaluate the decision tree model:

[0213] Divide the dataset into a training set and a test set.

[0214] Calculate evaluation metrics:

[0215] Use the test set to evaluate the trained decision tree model through the mean squared error (MSE) and the mean absolute error (MAE).

[0216] Adjust the model according to the evaluation results. If the model shows overfitting (such as a large MSE or MAE on the test set), perform pruning operations. There are two pruning methods: pre-pruning and post-pruning. Pre-pruning is to stop splitting in advance during the construction of the decision tree; post-pruning is to cut off some subtrees according to certain rules after the decision tree is constructed.

[0217] 2. Message allocation algorithm based on the greedy strategy:

[0218] (1) Obtain functional unit information:

[0219] Collect functional unit capacity information: Collect information from the microservice architecture module.

[0220] In a system based on the microservice architecture, collect information from the nodes where each microservice instance is located. Each microservice instance can be regarded as a functional unit, and collect information related to their processing capabilities, including but not limited to the maximum processing capacity of the functional unit (such as the number of messages that can be processed per second R), the current load situation (such as the number of messages being processed L n 、the proportion of occupied resources U, etc.). Suppose there are k functional units in the system, and denote the maximum processing capacity of functional unit j as the current load as L j , and the average time-consuming for processing each message as T j .

[0221] (2) Message allocation decision:

[0222] Predict message complexity: Through the decision tree model prediction, when a new message enters the system, use the trained decision tree model to predict the complexity C of the message m .

[0223] Select a functional unit and calculate the load change: According to the greedy strategy, calculate the load situation of each functional unit after processing the message. For functional unit j, calculate its load after processing the message (assuming that the processing capacity is proportional to the load).

[0224] Select the optimal functional unit: Select the functional unit j that makes the smallest as the receiver of the message. If there are multiple functional units that meet the conditions, other factors can be further considered, such as the average processing time T j of the functional unit, and select the functional unit with a faster processing speed. For example, if there are two functional units j 1and j 2 Meet and Then select functional unit j 1 .

[0225] (3) Dynamic adjustment:

[0226] Real-time monitoring and update, monitoring the status of functional units: The system monitors the actual processing situation of each functional unit in real time, including the actual time consumption of processing messages, whether there are exceptions, etc.

[0227] Update the capability information of functional units: According to this real-time information, dynamically update the capability information of functional units. If it is found that the average time consumption of a certain functional unit in processing a certain type of message suddenly increases by △T, it means that the processing capability of this functional unit has decreased, and its capability information is adjusted accordingly. For example, adjust the maximum processing capability to

[0228] Adjust the message distribution strategy: When the capability information of functional units changes, subsequent message distribution decisions will be adjusted according to the new information to ensure the rationality of message distribution.

[0229] Message complexity prediction: When a message enters the message queue, it is analyzed by a message complexity prediction algorithm based on decision trees. The message queue module integrates this algorithm to predict the processing complexity of newly entered messages according to their characteristics (such as message size, message type, etc.). For example, for a report generation message containing a large amount of data, the algorithm predicts that this message may require higher processing resources and longer processing time based on the relationship between report scale and processing time in historical data.

[0230] Affect message storage and distribution: According to the predicted complexity, the message queue can adjust different storage strategies for messages. Messages with high complexity may be stored in a storage area with higher performance, or given a higher priority mark during distribution. For example, in a distributed message queue system, messages with high complexity are preferentially stored in a solid-state drive (SSD, Solid State Drive) storage area to speed up reading and processing.

[0231] Greedy strategy allocation: A message allocation algorithm based on the greedy strategy is used in the message queue module to determine the distribution target of messages. When there are multiple functional units (such as different microservice instances) that can receive messages, the algorithm allocates the message to the functional unit most suitable for processing this message according to the current load and processing capability information of each functional unit. For example, there are two microservice instances A and B, and the current load of A is low and its processing capability is strong. When a message with a higher complexity enters the queue, the greedy strategy will preferentially allocate this message to A.

[0232] Functional unit capacity feedback: Each microservice, as a functional unit of the message, will feedback its own processing capacity information to the system. This information includes the number of messages currently being processed, resource occupancy (such as CPU and memory usage rates), and the average time taken to process different types of messages, etc. For example, an image recognition microservice will regularly report to the system information such as the number of image recognition tasks currently being processed and the average CPU time consumed for processing one image.

[0233] Message complexity adaptation: The results of the message complexity prediction algorithm based on the decision tree help microservices better prepare resources. When a microservice receives a message assigned by the message queue, according to the predicted complexity of the message, it prepares the corresponding computing resources and storage resources in advance. For example, when a data processing microservice receives a big data analysis message with a relatively high predicted complexity, it applies for more memory resources in advance or adjusts the size of the internal thread pool to improve processing efficiency.

[0234] Greedy strategy affects the processing order: Inside the microservice, when processing multiple messages simultaneously, a similar greedy strategy idea can also be adopted to arrange the processing order. According to the complexity of the messages and the current resource status of itself, it preferentially processes those messages with lower complexity and can be completed quickly to release resources as soon as possible, and then processes messages with higher complexity. For example, when a microservice receives a simple data query message and a complex data mining message simultaneously, it can process the data query message first to improve the overall message processing efficiency.

[0235] Algorithm monitoring and adjustment: The monitoring and management module is responsible for monitoring the running status of the message complexity prediction algorithm based on the decision tree and the message allocation algorithm based on the greedy strategy. By collecting indicators such as the execution time and prediction accuracy of the algorithm, it evaluates the performance of the algorithm. If it is found that the accuracy of the prediction algorithm has decreased (such as the deviation between the predicted message complexity and the actual processing complexity exceeds a certain threshold), it triggers the retraining or adjustment of the decision tree model. For example, when it is found that the average error of the message complexity prediction exceeds 30% continuously for a period of time, the monitoring module will notify the system to collect data again and train the decision tree model.

[0236] Dynamic resource allocation: According to the message complexity prediction and message allocation situation, the monitoring and management module dynamically adjusts system resources. For example, if it is found that a large number of high-complexity messages are concentratedly assigned to some microservice instances, resulting in high loads on these instances, the monitoring module can coordinate the resource management system to allocate more computing resources (such as increasing the number of CPU cores, memory capacity, etc.) to these instances, or dynamically start new microservice instances to share the load.

[0237] Global Policy Optimization: From a global perspective, the monitoring and management module utilizes the running data of two algorithms to optimize the system's asynchronous communication policy. By analyzing the complexity distribution of messages and the message distribution effect under different time periods and different business types, the system's load balancing policy, the capacity planning of message queues, etc. are adjusted. For example, during the business peak period, it is found that the message complexity is generally high and there is a backlog in the message queue. The monitoring and management module can adjust the load balancing policy and allocate more resources to the microservice cluster with stronger capabilities for processing complex messages.

[0238] In the above embodiments, when using a server to process requests, the servers are initially screened by polling in sequence. Then, a load prediction model is used to comprehensively consider the current and historical load data to predict the server load, and a preset load threshold is used to determine whether to allocate the request to the server for processing, thereby ensuring that the request is sent to a server with sufficient processing capacity, reducing the time for requests to queue and wait in the server, and facilitating the improvement of request processing efficiency. Moreover, this method avoids the defect that the random allocation method is likely to lead to a longer request processing time, resulting in a lower request processing efficiency, and further improves the request processing efficiency. At the same time, the prediction-based algorithm can predict the load conditions of each server according to historical data and the current system state, avoiding the problem that servers with good performance are not fully utilized due to simple polling, while servers with poor performance become bottlenecks. For example, during a major e-commerce promotion, the prediction algorithm can perceive the growth trend of the order volume in advance and reasonably allocate requests to servers with lighter loads and better performance, enabling more efficient use of system resources and improving the overall throughput of the system. Reasonable load distribution enables each request to be processed in a shorter time, thereby reducing the average response time. For example, in a financial trading system, trading requests can be quickly allocated to servers with appropriate loads for processing, reducing the time for users to wait for transaction confirmation and improving the user experience. When additional servers are needed to expand the system capacity, the prediction-based algorithm can help the new servers integrate into the system load balancing system more quickly. Secondly, the prediction algorithm can detect in advance servers that may become overloaded and, by adjusting the load distribution strategy, transfer requests to other servers, reducing the risk of server overload. For example, in a video streaming service, when the traffic of a certain server suddenly increases, the prediction algorithm can detect it in time and allocate new requests to other servers, preventing the server from crashing due to overload and ensuring the stable operation of the system. Since the load balancing strategy is more intelligent, even if an individual server fails, the system can quickly allocate requests to other normal servers, reducing the system downtime caused by server failures. For example, in a cloud computing platform, if a server experiences a hardware failure, the load balancer can quickly transfer the requests on that server to other servers according to the prediction algorithm, ensuring the continuity of cloud services. The combination of polling and the prediction-based algorithm can better adapt to the dynamic changes of system load. Whether it is a short-term traffic peak or a long-term business growth, the system can adjust the load distribution strategy in a timely manner according to the prediction algorithm. Moreover, the decision tree-based message complexity prediction algorithm can accurately predict the processing complexity of messages, and the greedy strategy-based message allocation algorithm can allocate messages to the most suitable functional units (microservice instances that receive and process messages) according to the message complexity and the capabilities of the functional units, thereby improving the overall processing efficiency of messages.For example, in a big data processing system, complex data mining tasks are assigned to computing nodes with strong processing capabilities, while simple data query tasks are assigned to ordinary nodes, avoiding the problems of resource waste and low processing efficiency caused by simple average distribution. Through reasonable message distribution, the waiting time of messages in the queue is reduced. The message complexity prediction algorithm based on decision trees can predict the complexity according to different message characteristics, enabling the system to adapt to various types of message processing requirements. Further, by allocating according to message complexity and functional unit capabilities, the situation where some functional units are overloaded while others are idle is avoided. For example, in an image recognition system, the recognition tasks for high-resolution and complex images are assigned to servers with high-performance graphics processing capabilities, while the recognition tasks for low-resolution and simple images are assigned to ordinary servers, making full use of the resources of each server. Overall, this algorithm combination enables the system resources to be allocated according to the actual needs of messages, improving resource utilization. When new functional units or message types need to be added to the system, this algorithm combination can be easily adjusted and extended.

[0239] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0240] Based on the same inventive concept, an embodiment of the present application further provides a request processing device for a large-scale concurrent communication network system based on a microservice architecture for implementing the request processing method for a large-scale concurrent communication network system based on a microservice architecture described above. The implementation solutions provided by this device to solve problems are similar to those described in the above method. Therefore, the specific limitations in one or more embodiments of the request processing device for a large-scale concurrent communication network system based on a microservice architecture provided below can refer to the limitations on the request processing method for a large-scale concurrent communication network system based on a microservice architecture in the above text, and will not be elaborated here.

[0241] In an exemplary embodiment, as Figure 4As shown, a request processing device for a large-scale concurrent communication network system based on a microservices architecture is provided, including: a server determination module 401, a data acquisition module 402, a feature extraction module 403, a vector fusion module 404, a load prediction module 405, and a request processing module 406, where:

[0242] The server determination module 401 is configured to, when receiving a request to be processed, determine the current server from multiple candidate servers according to a preset server polling order.

[0243] The data acquisition module 402 is configured to acquire the current load data and historical load data of the current server.

[0244] The feature extraction module 403 is configured to perform feature extraction processing on the current load data and historical load data respectively, to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data.

[0245] The vector fusion module 404 is configured to perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector.

[0246] The load prediction module 405 is configured to input the fusion feature vector into a pre-trained load prediction model to obtain the predicted load data of the current server.

[0247] The request processing module 406 is configured to, when the predicted load data is less than or equal to a preset load threshold, send the request to be processed to the current server, so that the current server processes the request to be processed.

[0248] In an exemplary embodiment, the request processing device for the large-scale concurrent communication network system based on a microservices architecture further includes a target confirmation module, configured to, when the predicted load data is greater than the preset load threshold, determine the next server corresponding to the current server from multiple candidate servers according to the preset server polling order; use the next server corresponding to the current server as the new current server, and jump to the step of acquiring the current load data and historical load data of the current server, until the predicted load data of the determined new current server is less than or equal to the preset load threshold.

[0249] In an exemplary embodiment, the request processing device for the large-scale concurrent communication network system based on a microservices architecture further includes a request determination module, configured to acquire the target service type of a candidate request; query the correspondence between the service type and the processing priority according to the target service type to obtain the target processing priority corresponding to each candidate request; screen out the candidate requests whose target processing priority is greater than or equal to the preset processing priority from each candidate request as the requests to be processed.

[0250] In an exemplary embodiment, the feature extraction module 403 is further configured to preprocess the current load data and the historical load data respectively to obtain the preprocessed current load data and the preprocessed historical load data; use the preprocessed current load data as the main data and the preprocessed historical load data as the auxiliary data, and input them into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed current load data as the first feature vector; use the preprocessed historical load data as the main data and the preprocessed current load data as the auxiliary data, and input them into the feature extraction model for feature extraction processing to obtain the feature vector corresponding to the preprocessed historical load data as the second feature vector.

[0251] In an exemplary embodiment, the vector fusion module 404 is further configured to obtain the first initial weight corresponding to the current load data and the second initial weight corresponding to the historical load data; perform normalization processing on the first initial weight and the second initial weight to obtain the first target weight corresponding to the current load data and the second target weight corresponding to the historical load data; and perform fusion processing on the first feature vector and the second feature vector according to the first target weight and the second target weight to obtain a fused feature vector.

[0252] In an exemplary embodiment, the request processing device of the large-scale concurrent communication network system based on the microservice architecture further includes a model training module, which is configured to obtain the current sample load data and the historical sample load data of the sample server; perform feature extraction processing on the current sample load data and the historical sample load data respectively to obtain the first sample feature vector corresponding to the current sample load data and the second sample feature vector corresponding to the historical sample load data; perform fusion processing on the first sample feature vector and the second sample feature vector to obtain a sample fused feature vector; input the sample fused feature vector into the load prediction model to be trained to obtain the predicted load data of the sample server; obtain the actual load data of the sample server, and perform iterative training on the load prediction model to be trained according to the difference between the predicted load data and the actual load data of the sample server to obtain a pre-trained load prediction model.

[0253] Each module in the above-mentioned request processing device of the large-scale concurrent communication network system based on the microservice architecture can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0254] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be asFigure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store current load data, historical load data, etc. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a request processing method for a large-scale concurrent communication network system based on a microservices architecture.

[0255] Those skilled in the art can understand that Figure 5 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0256] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0257] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0258] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0259] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0260] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0261] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A request processing method for a large-scale concurrent communication network system based on a microservice architecture, characterized in that: The method comprises: When receiving a pending request, determining a current server from a plurality of candidate servers according to a preset server polling order; Obtaining current load data and historical load data of the current server; Performing feature extraction processing on the current load data and the historical load data respectively to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data; fusing the first feature vector and the second feature vector to obtain a fused feature vector; Inputting the fused feature vector into a pre-trained load prediction model to obtain predicted load data of the current server; When the predicted load data is less than or equal to a preset load threshold, the pending request is sent to the current server so that the current server processes the pending request.

2. The method according to claim 1, characterized in that: After the fused feature vector is input into a pre-trained load prediction model to obtain the predicted load data of the current server, the method further includes: In the case where the predicted load data is greater than the preset load threshold, determining a next server corresponding to the current server from the multiple candidate servers according to the preset server polling order; The next server corresponding to the current server is used as the new current server, and the process jumps to the step of obtaining the current load data and the historical load data of the current server until the predicted load data of the new current server is determined to be less than or equal to the preset load threshold.

3. The method according to claim 1, characterized in that When a pending request is received, before determining a current server from multiple candidate servers according to a preset server polling order, the method further includes: Get the target business type of the candidate request; According to the target business type, query the correspondence between the business type and the processing priority to obtain the target processing priority corresponding to each of the candidate requests; From the candidate requests, the candidate requests whose target processing priority is greater than or equal to the preset processing priority are screened out as the requests to be processed.

4. The method according to claim 1, characterized in that: The performing feature extraction processing on the current load data and the historical load data respectively to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data includes: Preprocessing the current load data and the historical load data respectively to obtain preprocessed current load data and preprocessed historical load data; The preprocessed current load data is used as main data, and the preprocessed historical load data is used as auxiliary data, and input into a feature extraction model for feature extraction processing, so as to obtain a feature vector corresponding to the preprocessed current load data as the first feature vector; The preprocessed historical load data is used as main data, and the preprocessed current load data is used as auxiliary data, and input into the feature extraction model for feature extraction processing to obtain a feature vector corresponding to the preprocessed historical load data as the second feature vector.

5. The method according to claim 1, characterized in that The fusing the first feature vector and the second feature vector to obtain a fused feature vector includes: Obtaining a first initial weight corresponding to the current load data and a second initial weight corresponding to the historical load data; Normalizing the first initial weight and the second initial weight to obtain a first target weight corresponding to the current load data and a second target weight corresponding to the historical load data; The first feature vector and the second feature vector are fused according to the first target weight and the second target weight to obtain the fused feature vector.

6. The method according to any one of claims 1 to 5, characterized in that The pre-trained load prediction model is trained in the following way: Obtain current sample load data and historical sample load data of the sample server; Performing feature extraction processing on the current sample load data and the historical sample load data respectively to obtain a first sample feature vector corresponding to the current sample load data and a second sample feature vector corresponding to the historical sample load data; fusing the first sample feature vector and the second sample feature vector to obtain a sample fusion feature vector; Inputting the sample fusion feature vector into the load prediction model to be trained to obtain the predicted load data of the sample server; The actual load data of the sample server is obtained, and according to the difference between the predicted load data of the sample server and the actual load data, the load prediction model to be trained is iteratively trained to obtain the pre-trained load prediction model.

7. A request processing device for a large-scale concurrent communication network system based on a microservice architecture, characterized in that: The device comprises: A server determination module, configured to determine a current server from a plurality of candidate servers according to a preset server polling order when receiving a request to be processed; A data acquisition module, used to acquire current load data and historical load data of the current server; A feature extraction module, used to perform feature extraction processing on the current load data and the historical load data respectively, to obtain a first feature vector corresponding to the current load data and a second feature vector corresponding to the historical load data; A vector fusion module, used for fusing the first feature vector and the second feature vector to obtain a fused feature vector; A load prediction module, used for inputting the fused feature vector into a pre-trained load prediction model to obtain predicted load data of the current server; The request processing module is used to send the pending request to the current server when the predicted load data is less than or equal to a preset load threshold, so that the current server processes the pending request.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Load balancing method and device, equipment, storage medium and program product

    CN120692275A

  • System interface verification method and system based on artificial intelligence

    CN121070749A

  • Message queue processing method and system based on dynamic resource scheduling and intelligent routing

    CN122395202A