Multi-protocol interface configuration management platform based on micro-service architecture
By designing a multi-protocol interface configuration management platform in the microservice architecture, using protocol adaptation, dynamic configuration, intelligent optimization and policy execution modules, the complexity of multi-protocol interface configuration management in the microservice environment is solved, intelligent and automated management of interface configuration is realized, and system performance and user experience are improved.
Patent Information
- Application Number
- CN202510194196.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-02-21
AI Technical Summary
In microservice architecture, it is difficult for the prior art to effectively manage the configuration of multi-protocol interfaces, especially in the case of real-time load and system resource state changes, resulting in difficult performance optimization.
A multi-protocol interface configuration management platform based on microservice architecture is designed, including protocol adaptation module, dynamic configuration management module, intelligent optimization computing module and policy execution module. The platform standardizes data requests from different protocols, dynamically adjusts interface parameters, and uses reinforcement learning models to optimize interface parameter combinations, ultimately achieving automated deployment.
It realizes intelligent and automated management of multi-protocol interface configuration, improves system response speed and resource utilization, enhances service flexibility and adaptability, significantly reduces manual intervention needs, reduces operation and maintenance costs, and ensures stable service performance under high load conditions.
Smart Images

Figure CN120128458A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of microservices architecture, and particularly to a multi-protocol interface configuration management platform based on the microservices architecture. Background Art
[0002] With the development of information technology, enterprise application architectures are gradually shifting from monolithic architectures to microservices architectures. A microservices architecture allows large applications to be decomposed into a set of small, independent services that can be deployed, scaled, and updated independently. However, this shift has brought new challenges, especially in dealing with multi-protocol interface configuration management. Different services may need to support multiple communication protocols (such as HTTP, gRPC, WebSocket, etc.), and each service instance needs to be able to dynamically adjust its interface parameters according to real-time load conditions and system resource status to optimize performance. In the prior art, the configuration of interfaces is usually static or can only be adjusted manually in a limited way, which cannot meet the frequently changing requirements in the microservices environment.
[0003] In addition, the adaptation problems between different protocols also increase the complexity of the system. Therefore, there is an urgent need for a solution that can automatically adapt to requests in a multi-protocol environment and dynamically adjust interface parameters based on real-time load data and system resource status to achieve optimal service performance. Summary of the Invention
[0004] In view of the above-mentioned drawbacks and deficiencies of the prior art, the present invention provides a multi-protocol interface configuration management platform based on the microservices architecture.
[0005] To achieve the above object, the main technical solutions adopted by the present invention include:
[0006] An embodiment of the present invention provides a multi-protocol interface configuration management platform based on the microservices architecture, the platform comprising:
[0007] A protocol adaptation module, configured to receive data requests from multiple protocols and standardize the data requests into an intermediate representation N(P);
[0008] A dynamic configuration management module, configured to receive the intermediate representation N(P) and dynamically adjust interface parameters according to real-time load data L(t) and system resource status R(t) to obtain initial interface parameters, and output them to the intelligent optimization calculation module;
[0009] Wherein, the real-time load data L(t) includes: the current traffic size and resource occupancy rate;
[0010] The system resource status R(t) includes: the data request rate;
[0011] An intelligent optimization calculation module, according to the initial interface parameters output by the dynamic configuration management module, further obtains the optimal interface parameter combination according to the optimal interface adaptation configuration strategy;
[0012] A policy execution module, configured to receive the optimal interface parameter combination output by the intelligent optimization calculation module, and adjust the actual operation parameters of the interface according to the optimal interface parameter combination.
[0013] Preferably, the protocol adaptation module includes:
[0014] A receiving unit, configured to receive a data request, and calculate the frequency of occurrence of each data field of the received data request according to historical data using formula (1);
[0015] The formula (1) is: p i = the number of occurrences of the i-th data field received by the receiving unit in all data requests / the total number of occurrences of all data fields within a specified time period;
[0016] p i is the frequency of occurrence of the i-th data field of the data request;
[0017] The receiving unit is further configured to calculate the maximum information entropy H using formula (2) based on the total number n of data fields of the received data request. The formula (2) is: H = logn;
[0018] A normalization evaluation unit, configured to calculate the normalized information entropy N(P) corresponding to the data request using formula (3) according to the frequency of occurrence of each data field of the data request and the maximum information entropy H;
[0019] The formula (3) is:
[0020]
[0021] A field mapping unit, configured to convert the received data request into a standard structure according to the normalized information entropy N(P) and a preset first threshold.
[0022] Preferably, the field mapping unit converts the received data request into a standard structure according to the normalized information entropy N(P) and a preset first threshold, specifically including:
[0023] If the normalized information entropy N(P) is less than the first threshold, directly map the data request to a preset normalized structure so that the data request becomes a standard structure;
[0024] If the normalized information entropy N(P) is greater than or equal to the first threshold, the data request is normalized and transformed by means of data completion and / or field mapping, so that the data request becomes a standard structure.
[0025] Preferably, the dynamic configuration management module includes:
[0026] A load scoring calculation unit, configured to calculate and obtain a load score based on the intermediate representation N(P) and according to the real-time load data L(t) and the system resource status R(t) by using formula (4);
[0027] The formula (4) is:
[0028]
[0029] where C t is the current CPU usage rate;
[0030] C min is the minimum value of the preset CPU usage rate;
[0031] C max is the maximum value of the preset CPU usage rate;
[0032] D t is the current memory occupancy rate;
[0033] D min is the minimum value of the preset memory occupancy rate;
[0034] D max is the maximum value of the preset memory occupancy rate;
[0035] E t is the current data request rate;
[0036] E min is the minimum value of the preset data request rate;
[0037] E max is the maximum value of the preset data request rate;
[0038] N(P) min is the preset minimum normalized information entropy;
[0039] N(P) max is the preset maximum normalized information entropy;
[0040] F is the load score; α is the first weighting coefficient; β is the second weighting coefficient; γ is the third weighting coefficient; τ is the fourth weighting coefficient;
[0041] An interface parameter adjustment unit is configured to input the load score into a reinforcement learning model pre - constructed using a deep Q - network (DQN). The reinforcement learning model outputs the target value of the interface parameter and uses the target value of the interface parameter as the initial interface parameter;
[0042] The reinforcement learning model has been pre - trained with historical data;
[0043] The historical data includes: the load scores corresponding to different historical time points and the theoretical values of the corresponding interface parameters.
[0044] Preferably, the intelligent optimization calculation module includes:
[0045] A state modeling unit is configured to obtain the initial interface parameters output by the dynamic configuration management module, and construct a reinforcement learning state space S(t) in combination with real - time load data L(t), system resource status R(t), historical load data, and future load prediction;
[0046] An action decision - making unit uses the reinforcement learning model to make decisions based on the reinforcement learning state space S(t) and generate multiple candidate interface parameter adjustment schemes;
[0047] A reward calculation unit is configured to evaluate the candidate interface parameter schemes and obtain the fitness value of each candidate interface parameter adjustment scheme;
[0048] An optimal parameter selection unit determines the optimal interface parameter adjustment scheme based on the fitness values of each candidate interface parameter adjustment scheme.
[0049] Preferably,
[0050] The reinforcement learning state space S(t) includes: real - time load data L(t), system resource status R(t), historical load data, and future load prediction;
[0051] The historical load data includes: the traffic volume within T time steps in a second historical period; the resource occupancy rates within T time steps in a second historical period, where the resource occupancy rates include: CPU usage rate, memory occupancy rate;
[0052] The future load prediction includes: the data of the predicted traffic volume for the next K time steps using an LSTM model based on the traffic volume within T time steps in a second historical period;
[0053] The data of the predicted resource occupancy rates for the next K time steps using an XGBoost model based on the resource occupancy rates within T time steps in a second historical period.
[0054] Preferably, the reinforcement learning model includes:
[0055] The input layer is used to receive the reinforcement learning state space S(t).
[0056] The hidden layer is used to extract key features from the state information through a deep neural network and learn how to adjust the interface parameters according to these features.
[0057] The output layer is used to generate the Q value of each possible interface parameter adjustment scheme according to the current state S(t) and the learned features.
[0058] Among them, the multiple candidate interface parameter adjustment schemes generated are the interface parameter adjustment schemes corresponding to the top M highest Q values calculated by the reinforcement learning model respectively.
[0059] Preferably,[[]]END]]
[0060] The reward calculation unit is used to evaluate the candidate interface parameter schemes and obtain the fitness value of each candidate interface parameter adjustment scheme, specifically including:[[]]END]]
[0061] The reward calculation unit calculates the fitness value of each candidate interface parameter scheme respectively using formula (5); the formula (5) is:[[]]END]]
[0062] R a = w 1 · T a - w 2 · V a ;
[0063] T a is the throughput score of the a-th candidate interface parameter adjustment scheme.
[0064] V a is the load balancing score of the a-th candidate interface parameter adjustment scheme.
[0065] w 1 is the first weight coefficient; w 2 is the second weight coefficient.
[0066] Preferably,[[]]END]]
[0067] The throughput score of the a-th candidate interface parameter adjustment scheme is calculated by formula (6);
[0068] The formula (6) is:[[]]END]]
[0069]
[0070] T is the throughput of the a-th candidate interface parameter adjustment scheme;
[0071] T min is the preset minimum throughput;
[0072] Tmax is the preset maximum throughput;
[0073] ∈ is the first adjustment parameter;
[0074] ε is the second adjustment parameter;
[0075] c 1 is the first weight coefficient;
[0076] c 2 is the second weight coefficient;
[0077] The load balancing score of the a-th candidate interface parameter adjustment scheme is obtained by formula (7);
[0078] The formula (7) is:
[0079] V a = 1 - c 3 ·C - c 4 ·D;
[0080] C is the CPU usage rate in the a-th candidate interface parameter adjustment scheme;
[0081] D is the memory occupancy rate in the a-th candidate interface parameter adjustment scheme;
[0082] c 3 is the third weight coefficient;
[0083] c 4 is the fourth weight coefficient.
[0084] Preferably, the platform further includes: a protocol quality monitoring module;
[0085] The protocol quality monitoring module is used to obtain the monitoring indicators of the platform, and determine whether the monitoring indicators exceed the preset range. If so, an alarm message is sent;
[0086] The monitoring indicators include the packet loss rate:
[0087] The packet loss rate is calculated by formula (8);
[0088] The formula (8) is:
[0089]
[0090] t res,m is the platform response time of the m-th data request;
[0091] l pkt,m is the number of lost packets;
[0092] t pkt,m is the total number of packets.
[0093] The beneficial effects of the present invention are as follows: A multi - protocol interface configuration management platform based on a microservices architecture of the present invention standardizes the data requests of different protocols received by the protocol adaptation module, the dynamic configuration management module dynamically adjusts the interface parameters according to real - time load data and system resource status, and further analyzes through the intelligent optimization calculation module to obtain the optimal interface parameter combination. Finally, the policy execution module realizes the automated deployment and execution of these optimal parameters. Compared with the prior art, it can effectively solve the complexity problem of multi - protocol support and realize the intelligent and automated management of interface configuration. This not only improves the system's response speed and resource utilization rate, but also enhances the flexibility and adaptability of the service, achieving the effect of improving the overall service quality and user experience. In addition, the platform can significantly reduce the need for manual intervention, reduce operation and maintenance costs, and ensure stable service performance under high - load conditions.
[0094] The protocol adaptation module standardizes the data requests of different protocols into an intermediate representation, simplifies the subsequent processing flow, and improves the compatibility and scalability of the system. The dynamic configuration management module can automatically adjust the interface parameters according to real - time data, ensuring that the system can still operate efficiently in the face of changes, improving the response speed and service quality. The intelligent optimization calculation module uses algorithms to analyze the initial interface parameters and obtain the optimal combination. This method can more accurately match the current workload situation, thereby improving the system performance and resource utilization rate. The policy execution module realizes the automated deployment and execution of the optimal interface parameter combination, reduces the need for manual operations, reduces operation and maintenance costs, and at the same time ensures the timeliness and accuracy of policy adjustment. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 It is a schematic diagram of a multi - protocol interface configuration management platform based on a microservices architecture of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0096] In order to better explain the present invention for easy understanding, the present invention will be described in detail below in conjunction with the drawings through specific embodiments.
[0097] In order to better understand the above - mentioned technical solutions, the exemplary embodiments of the present invention will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be more clearly and thoroughly understood, and the scope of the present invention can be completely conveyed to those skilled in the art.
[0098] Embodiment 1
[0099] SeeFigure 1 , this embodiment provides a multi - protocol interface configuration management platform based on a microservices architecture, characterized in that the platform includes:
[0100] A protocol adaptation module, which is used to receive data requests from multiple protocols and standardize the data requests into an intermediate representation N(P);
[0101] A dynamic configuration management module, which is used to receive the intermediate representation N(P) and dynamically adjust the interface parameters according to the real - time load data L(t) and the system resource status R(t) to obtain the initial interface parameters and output them to the intelligent optimization calculation module;
[0102] Among them, the real - time load data L(t) includes: the current traffic size and resource occupancy rate;
[0103] The system resource status R(t) includes: the data request rate;
[0104] An intelligent optimization calculation module, which further obtains the optimal interface parameter combination according to the optimal interface adaptation configuration strategy based on the initial interface parameters output by the dynamic configuration management module;
[0105] A policy execution module, which is used to receive the optimal interface parameter combination output by the intelligent optimization calculation module and adjust the actual operation parameters of the interface according to the optimal interface parameter combination. That is to say, adjust the actual operation parameters of the interface to be consistent with the optimal interface parameter combination.
[0106] For example, currently there is an online retail platform, which consists of multiple microservices, such as user authentication service, product catalog service, shopping cart service, etc. These services need to support multiple protocols (such as HTTP for web front - end requests and gRPC for communication between internal services), and need to dynamically adjust the interface parameters according to the real - time load situation and system resource status to optimize performance. Example steps:
[0107] Protocol adaptation module: When a user accesses the website through a browser, an HTTP request will be sent to obtain product information. At the same time, gRPC may be used for communication between internal services.
[0108] The protocol adaptation module receives these requests of different protocols and standardizes them into the intermediate representation N(P), so that subsequent processing can be carried out uniformly without caring about the specific protocol format of the original requests.
[0109] After the dynamic configuration management module receives the intermediate representation N(P), it analyzes the current traffic volume, resource occupancy rate, data request rate, and other real-time load data L(t) and system resource status R(t). Based on this data, the module automatically adjusts the interface parameters of relevant services, such as increasing or decreasing the thread pool size, adjusting the cache policy, etc., to adapt to the current workload situation, and outputs these initial interface parameters to the intelligent optimization calculation module.
[0110] The intelligent optimization calculation module further analyzes the initial interface parameters provided by the dynamic configuration management module, combines historical data and prediction models, and determines the optimal combination of interface parameters. For example, it may recommend enabling more server instances during high-traffic periods to disperse the load.
[0111] The policy execution module receives the optimal combination of interface parameters output by the intelligent optimization calculation module and automatically applies it to the actual operating environment, such as adjusting the number of service instances, updating the load balancing policy, etc., to ensure that the platform can efficiently handle changing workloads.
[0112] With the support of the protocol adaptation module in this embodiment, the platform can easily handle data requests of multiple protocols, enhancing the compatibility and scalability of the system. By using the dynamic configuration management and intelligent optimization calculation modules, the platform can automatically adjust interface parameters based on real-time data, reducing the need for manual intervention, improving the response speed and service quality. Through precise monitoring and optimization of the system resource status, the platform can maximize resource utilization while ensuring service quality, reducing operating costs. The policy execution module realizes the rapid deployment and execution of optimization strategies, helping to maintain the stability of the platform under high load and ensuring the consistency of the user experience.
[0113] In this embodiment, the protocol adaptation module includes:
[0114] A receiving unit, configured to receive data requests and calculate the frequency of occurrence of each data field of the received data requests according to historical data using formula (1);
[0115] The formula (1) is: p i = the number of occurrences of the i-th data field received by the receiving unit in all data requests / the total number of occurrences of all data fields within a specified time period;
[0116] p i is the frequency of occurrence of the i-th data field of the data request;
[0117] The receiving unit is further configured to calculate the maximum information entropy H using formula (2) based on the total number n of data fields of the received data requests, and the formula (2) is: H = logn;
[0118] A normalization evaluation unit is used to calculate the normalized information entropy N(P) corresponding to the data request according to the frequency of occurrence of each data field in the data request and the maximum information entropy H using formula (3);
[0119] The formula (3) is as follows:
[0120]
[0121] A field mapping unit is used to convert the received data request into a standard structure according to the normalized information entropy N(P) and a preset first threshold value.
[0122] In this embodiment, by normalizing data requests from different sources and formats into a unified intermediate representation N(P), the system's ability to process data of multiple protocols can be significantly improved, enabling various services to exchange information seamlessly, enhancing the system's compatibility and interoperability. The normalization process can help identify and filter abnormal or unnecessary data fields, reducing potential security risks. In addition, by normalizing the data, the original data structure can be hidden to a certain extent, adding a layer of privacy protection. Using information entropy as an evaluation metric can effectively measure the complexity and uncertainty of data requests. Based on this, the platform can adjust resource allocation according to actual needs, such as allocating more processing resources for data requests with high complexity, thereby optimizing the overall performance.
[0123] Specifically, the field mapping unit converts the received data request into a standard structure according to the normalized information entropy N(P) and a preset first threshold value, which specifically includes:
[0124] If the normalized information entropy N(P) is less than the first threshold value, the data request is directly mapped to a preset normalized structure, making the data request a standard structure;
[0125] If the normalized information entropy N(P) is greater than or equal to the first threshold value, a data completion method and / or a field mapping method are used to perform a normalization conversion on the data request, making the data request a standard structure.
[0126] For example, assume there is an online service system that needs to process data requests from different clients (such as mobile applications, web browsers), and these requests may be sent through different protocols (such as HTTP, gRPC), and the structure and content of each request may be different. To ensure that these requests can be uniformly processed within the system, we need to use a protocol adaptation module to convert them into a standard structure.
[0127] The example scenario considers the following two cases:
[0128] In the first case, assume that the data request received from a mobile application contains only a small amount of information, such as the user ID and the product ID being queried. Since this request is relatively simple, the calculated value of its normalized information entropy N(P) is small, less than a preset first threshold. In this case, the field mapping unit can directly map this data request into a preset standard structure without additional processing. For example, if the standard structure requires the mandatory inclusion of "user identification", "operation type", and "product identification", the field mapping unit can automatically fill in the missing "operation type" field (assuming the default is "query") and directly incorporate it into the standard process for subsequent processing.
[0129] Another case is that the data request received from another service is very complex, containing a large amount of information. For example, in addition to basic user and product information, it also includes detailed order history, preference settings, etc. This results in a large normalized information entropy N(P), greater than or equal to the preset first threshold. At this time, the field mapping unit needs to perform a normalization conversion on this data request using data completion methods and / or field mapping methods. For example, for those fields that are not defined in the standard structure but exist in the original request, necessary metadata can be added through data completion methods or these information can be reorganized through field mapping methods to meet the requirements of the standard structure. The purpose of doing this is to ensure that all input data can be processed in a consistent manner while retaining as much useful information as possible.
[0130] For simple requests, direct mapping to the standard structure reduces unnecessary conversion steps and improves processing efficiency. For complex requests, data completion and field mapping ensure that all data entering the system follows a unified standard format, enhancing data consistency and integrity. The system can flexibly handle data requests of various complexities. Whether simple or complex, they can be effectively converted into the standard structure, increasing the system's adaptability and expandability.
[0131] In this embodiment, the dynamic configuration management module includes:
[0132] A load scoring calculation unit, configured to calculate and obtain a load score based on the intermediate representation N(P) and according to real-time load data L(t) and system resource status R(t) using formula (4);
[0133] The formula (4) is:
[0134]
[0135] where C t is the current CPU usage rate; C min is the minimum value of the preset CPU usage rate; C maxis the maximum value of the preset CPU usage rate; D t is the current memory occupancy rate; D min is the minimum value of the preset memory occupancy rate; D max is the maximum value of the preset memory occupancy rate; E t is the current data request rate; E min is the minimum value of the preset data request rate; E max is the maximum value of the preset data request rate; N(P) min is the minimum value of the preset normalized information entropy; N(P) max is the maximum value of the preset normalized information entropy; F is the load score; α is the first weighting coefficient; β is the second weighting coefficient; γ is the third weighting coefficient; τ is the fourth weighting coefficient;
[0136] In this embodiment, by comprehensively considering multiple key indicators (CPU usage rate, memory occupancy rate, data request rate, and normalized information entropy), the load score calculation unit can more comprehensively evaluate the real-time load situation of the system, thereby providing a more accurate load score.
[0137] The interface parameter adjustment unit is used to input the load score into a reinforcement learning model pre-constructed by using the deep Q-network DQN. The reinforcement learning model outputs the target value of the interface parameter and uses the target value of the interface parameter as the initial interface parameter; in this embodiment, by using the deep reinforcement learning (DQN) model, the interface parameter adjustment unit can automatically adjust the interface parameter according to the real-time load score, ensuring that the system can quickly adapt when facing changes, improving the response speed and service quality. By dynamically adjusting the interface parameter, the system can reasonably allocate resources according to the current load situation, maximize resource utilization, reduce resource waste, and improve the overall performance.
[0138] The reinforcement learning model is pre-trained with historical data; the historical data includes: the load scores corresponding to different historical time points and the theoretical values of the corresponding interface parameters.
[0139] In this embodiment, the deep Q-network is a technology that combines deep learning and reinforcement learning, and is particularly suitable for dealing with problems with high-dimensional input spaces.
[0140] Among them, the intelligent optimization calculation module includes:
[0141] The state modeling unit is used to obtain the initial interface parameter output by the dynamic configuration management module, and construct a reinforcement learning state space S(t) by combining the real-time load data L(t), the system resource state R(t), the historical load data, and the future load prediction.
[0142] An action decision-making unit, using a reinforcement learning model, makes decisions based on the reinforcement learning state space S(t) and generates multiple candidate interface parameter adjustment schemes;
[0143] A reward calculation unit, used to evaluate the candidate interface parameter schemes and obtain the fitness value of each candidate interface parameter adjustment scheme;
[0144] An optimal parameter selection unit, based on the fitness value of each candidate interface parameter adjustment scheme, determines the optimal interface parameter adjustment scheme.
[0145] In this embodiment, the state modeling unit integrates various real-time data (such as load information, system resource status), historical data, and future predictions to construct a comprehensive reinforcement learning state space S(t), providing a solid data foundation for subsequent decision-making. The action decision-making unit uses the reinforcement learning model to generate multiple possible interface parameter adjustment schemes under the given state space S(t), improving the ability to cope with complex and changing environments. The reward calculation unit evaluates each candidate scheme to determine its fitness value, ensuring that the selected scheme can maximize the overall system performance metrics (such as throughput, response time, etc.). Based on the results of the reward calculation, the optimal parameter selection unit can select the most suitable interface parameter adjustment strategy from numerous candidate schemes, thereby maximizing the system performance.
[0146] In summary, the intelligent optimization calculation module integrates real-time data, historical data analysis, and prediction models, and uses reinforcement learning technology to achieve intelligent optimization adjustment of interface parameters, greatly improving the flexibility, reliability, and performance of the system.
[0147] In this embodiment, the reinforcement learning state space S(t) includes: real-time load data L(t), system resource status R(t), historical load data, and future load prediction;
[0148] The historical load data includes: the traffic volume within T time steps in the second historical time period; the resource occupancy rate within T time steps in the second historical time period, and the resource occupancy rate includes: CPU usage rate, memory occupancy rate;
[0149] The future load prediction includes: the data of the traffic volume in the predicted future K time steps based on the traffic volume within T time steps in the second historical time period using the LSTM model;
[0150] The data of the resource occupancy rate in the future K time steps obtained using the XGBoot model based on the resource occupancy rate within T time steps in the second historical time period.
[0151] In this embodiment, the above-mentioned information together constitutes the state space S(t) of reinforcement learning, enabling the reinforcement learning algorithm to make more accurate action decisions based on comprehensive historical and predictive information. By combining real-time data, historical data, and future predictions, the state space S(t) can provide a more comprehensive perspective to evaluate the current state of the system, thereby helping the action decision-making unit generate a more accurate interface parameter adjustment plan. Using LSTM and XGBoost models to predict future load and resource occupancy can identify in advance factors that may affect system performance, enabling the system to take preventive measures before potential problems occur, enhancing the system's adaptability and response speed. Based on the accurate prediction of future load and resource requirements, system resources can be allocated more effectively, avoiding resource waste or insufficiency, and thus improving the overall service quality and user experience. This data-driven approach reduces the need for manual intervention, realizes automatic optimization and adjustment of interface parameters, helps reduce operation and maintenance costs, and improves management efficiency.
[0152] Specifically, the reinforcement learning model includes:
[0153] An input layer for receiving the reinforcement learning state space S(t);
[0154] A hidden layer for extracting key features in the state information through a deep neural network and learning how to adjust interface parameters based on these features;
[0155] An output layer for generating Q-values for each possible interface parameter adjustment plan based on the current state S(t) and the learned features;
[0156] Among them, the multiple candidate interface parameter adjustment plans generated are the interface parameter adjustment plans corresponding to the top M highest Q-values calculated by the reinforcement learning model.
[0157] Q - learning is a model - free reinforcement learning algorithm that can learn the optimal policy without a complete model of the environment. By estimating the long - term return (i.e., Q - value) for each state - action pair, Q - learning can find a policy that maximizes the expected reward for the agent's action in a given state. The model uses a deep neural network to approximate the complex Q - function, thus expanding the application scope of traditional Q - learning. Using the deep neural network as part of the model structure, the hidden layer can automatically extract useful features from the raw input data without manual intervention. This method is particularly suitable for dealing with problems with high - dimensional input spaces, such as the state space S(t) described above, which contains information such as real - time load data, system resource status, historical load data, and future predictions. The reinforcement learning model can continuously learn and optimize its own behavior strategy during the interaction with the environment. This means that the model can flexibly adjust its decision - making process according to new information or changing environmental conditions, enhancing the adaptability and flexibility of the system. In many real - world applications, the future state is usually uncertain. The reinforcement learning model can effectively learn the optimal policy in an unknown environment through the balance between exploration and exploitation (exploration vs exploitation trade - off), which is crucial for dealing with complex and changeable situations.
[0158] Reinforcement learning has achieved remarkable success in many fields, such as game AI (AlphaGo), robot control, autonomous vehicles, etc. These successful cases prove that the reinforcement learning model is not only theoretically reasonable but also very effective in practice. In a specific application scenario, such as the intelligent optimization calculation module described above, through accurate state representation, effective decision - making, and continuous learning and improvement, the reinforcement learning model can significantly improve the operation efficiency and service quality of the system.
[0159] In summary, the reinforcement learning model is not only based on a solid theoretical foundation but also has strong adaptability and the ability to solve complex problems, and has demonstrated good performance in practical applications, which fully proves its rationality. By combining deep learning techniques, this model can effectively handle complex decision - making problems and provide strong support for realizing intelligent management.
[0160] In this embodiment, the reward calculation unit is used to evaluate the candidate interface parameter schemes and obtain the fitness value of each candidate interface parameter adjustment scheme, specifically including:
[0161] The reward calculation unit calculates the fitness value of each candidate interface parameter scheme using formula (5); the formula (5) is:
[0162] R a =w 1 ·T a-w 2 ·V a ;
[0163] T a is the throughput score of the a-th candidate interface parameter adjustment scheme;
[0164] V a is the load balancing score of the a-th candidate interface parameter adjustment scheme;
[0165] w 1 is the first weight coefficient; w 2 is the second weight coefficient.
[0166] In this embodiment, by combining the throughput score T a and the load balancing score V a , this formula can comprehensively evaluate the performance of each candidate interface parameter adjustment scheme. The throughput score reflects the processing capacity of the system, while the load balancing score ensures the effective allocation and utilization of resources. By introducing the weight coefficients w 1 and w 2 , the importance of different metrics can be flexibly adjusted. For example, in some scenarios, throughput may be more emphasized (i.e., w 1 is larger), while in other scenarios, load balancing may be more emphasized (i.e., w 2 is larger). In summary, this reward calculation unit can effectively select the optimal interface parameter adjustment scheme by comprehensively evaluating the throughput score and the load balancing score and quantifying them in combination with the weight coefficients, thereby improving the overall performance and stability of the system. This design not only has theoretical rationality but also shows remarkable effects in practical applications.
[0167] Specifically, the throughput score of the a-th candidate interface parameter adjustment scheme is calculated by formula (6);
[0168] The formula (6) is:
[0169]
[0170] T is the throughput of the a-th candidate interface parameter adjustment scheme;
[0171] T min is the preset minimum throughput;
[0172] T max is the preset maximum throughput;
[0173] ∈ is the first adjustment parameter;
[0174] ε is the second adjustment parameter;
[0175] c1 is the first weight coefficient;
[0176] c 2 is the second weight coefficient;
[0177] The load balancing score of the a-th candidate interface parameter adjustment scheme is obtained through formula (7);
[0178] The formula (7) is:
[0179] V a = 1 - c 3 ·C - c 4 ·D;
[0180] C is the CPU usage rate in the a-th candidate interface parameter adjustment scheme;
[0181] D is the memory occupancy rate in the a-th candidate interface parameter adjustment scheme;
[0182] c 3 is the third weight coefficient;
[0183] c 4 is the fourth weight coefficient.
[0184] In a specific embodiment, the platform further includes: a protocol quality monitoring module;
[0185] The protocol quality monitoring module is used to obtain the monitoring indicators of the platform, and determine whether the monitoring indicators exceed a preset range. If so, an alarm message is sent;
[0186] The monitoring indicators include the packet loss rate:
[0187] The packet loss rate is calculated through formula (8);
[0188] The formula (8) is:
[0189]
[0190] t res,m is the platform response time for the m-th data request;
[0191] l pkt,m is the number of lost packets;
[0192] t pkt,m is the total number of packets.
[0193] For example, assume there is an online trading system based on a microservices architecture. This system needs to handle a large number of user requests and data transmissions. The specific application scenario is as follows:
[0194] Users conduct trading operations on the platform, such as purchasing goods or trading stocks.
[0195] The system needs to process these requests in real time and ensure the accuracy and reliability of data transmission.
[0196] The system uses a protocol quality monitoring module to monitor the transmission of data packets.
[0197] The monitoring metrics include the packet loss rate (G), which is calculated by formula (8). By monitoring the packet loss rate (G), problems in the data transmission process can be detected in a timely manner. If the packet loss rate exceeds the preset threshold, the system will immediately send an alarm message to alert the operation and maintenance personnel to intervene, thereby improving the reliability of data transmission.
[0198] If the packet loss rate is high, it may be due to network congestion or high server load. The operation and maintenance personnel can solve the problem by adjusting resource allocation or optimizing network settings. The timely alarm mechanism can quickly locate the problem and reduce the fault time. This helps to improve the system availability and user experience and reduce business interruptions caused by faults. By continuously monitoring and optimizing the data transmission quality, the overall service quality can be significantly improved. The user experience is improved, and complaints and dissatisfaction caused by data transmission problems are reduced. The automated monitoring and alarm mechanism reduces the need for manual intervention. The operation and maintenance personnel can focus more on other important tasks, improving the operation and maintenance efficiency.
[0199] Embodiment 2
[0200] This embodiment provides a multi - protocol interface configuration management platform based on a microservices architecture. This platform can automatically adapt to data requests of different protocols and dynamically adjust interface parameters according to real - time load and system resource status to optimize performance. In a specific implementation of the protocol adaptation module, assume there is an e - commerce platform that supports data requests from the web - side (HTTP protocol) and mobile applications (gRPC protocol). When a user browses product information through the web, the system will receive an HTTP request; when the mobile application queries inventory information, it may send a request using the gRPC protocol. The protocol adaptation module receives these data requests of different protocols and standardizes them into an intermediate representation N(P). For example, for an HTTP request, the module extracts information such as the URL path and query parameters; for a gRPC request, it parses out the method name, message body, etc. All this information is converted into an intermediate representation N(P) in a unified format for subsequent processing. The dynamic configuration management module receives the intermediate representation N(P) and, in combination with the real - time load data L(t) of the current system (such as traffic volume and CPU occupancy) and the system resource status R(t) (such as data request rate), dynamically adjusts the interface parameters. For example, during high - traffic periods, the module may recommend increasing the number of server instances or expanding the cache capacity to handle higher request volumes.
[0201] The intelligent optimization calculation module further analyzes the initial interface parameter combinations provided by the dynamic configuration management module. Using historical data and prediction models, the module can evaluate the impact of different parameter combinations on system performance. For example, by simulating the impact of different thread pool sizes on response time, the optimal parameter settings can be found.
[0202] The policy execution module receives the optimal interface parameter combination output by the intelligent optimization calculation module and adjusts the actual operation of the interface according to this combination. For example, if the optimal solution recommends increasing the thread pool size from 50 to 100, the policy execution module will automatically update the relevant configuration without manual intervention. Conclusion Through the above embodiments, it can be seen how to deploy and use this multi - protocol interface configuration management platform based on a microservices architecture in practical applications. This platform not only improves the processing ability of interface requests but also can automatically adjust parameters according to actual situations to ensure that the system is always in the best performance state. This method is particularly suitable for application scenarios that need to handle a large number of concurrent requests and must respond quickly to changes.
[0203] Embodiment Three
[0204] Background Technology of Interface Configuration Platform Based on Microservice Architecture In a Java Web system, system integration interface docking is a common and important function that allows different systems to exchange data and information. Common interface docking methods include HTTP REST API and SOAP protocol. Generally speaking, docking a system requires steps such as clarifying interface requirements, writing interface code, handling data formats, exception handling, and joint debugging tests. However, this method brings the problem of low interface docking efficiency, and when the system undergoes business changes, redevelopment and joint debugging are required. There are many disadvantages of the prior art, mainly including the following points:
[0205] 1. It involves the connection and integration of multiple systems, and the technical implementation is complex.
[0206] 2. It is necessary to adapt services with different protocols, increasing the development workload.
[0207] 3. Maintaining complex service call relationships in a microservice architecture has a high coupling degree.
[0208] 4. The authentication mechanisms are different, and unified authentication cannot be achieved, making it easy to have unauthorized calls.
[0209] 5. There are network restrictions for the communication between internal network services and external systems.
[0210] 6. It is impossible to effectively control service calls, such as monitoring and flow limiting.
[0211] 7. The interface is integrated inside the system, resulting in problems such as reduced system stability, increased deployment and maintenance difficulty, and increased online risk.
[0212] This embodiment aims to introduce an interface configuration platform product. By uniformly managing all capabilities and shielding the differences between capabilities, the business system can more conveniently and simply dock various capabilities to solve the deficiencies in the prior art. The front end of a multi-protocol interface configuration management platform based on the microservice architecture in this embodiment uses the Vue 3.0 framework to provide a user-friendly interface for configuring and managing interfaces. The back end uses Spring WebFlux and WebClient to support non-blocking request processing. The middleware is Redis for caching and session management; the database supports MySQL and H2. Netty is selected as the server because it can well support asynchronous event-driven network applications.
[0213] Example of Key Steps Taking the mall's docking with JD.com to obtain product inventory information as an example:
[0214] 1. Configure the interface information for obtaining product inventory information on the interface configuration platform.
[0215] 2. The interface platform provides the service address for external calls.
[0216] 3. The mall calls the configured address of the interface through the HTTP protocol and transfers the request message information to the interface platform.
[0217] 4. After receiving the message, the interface platform executes the routing logic and routes to the correct service partition according to the hsn value.
[0218] 5. Determine whether the current call protocol is supported based on the protocol type in the request header.
[0219] 6. If the landing address is multiple IP addresses, load selection is required.
[0220] 7. Determine whether extended operations (such as field conversion, calculation, etc.) need to be executed. After completion, send the real request message to the JD VOP interface.
[0221] Sub - process description
[0222] Application subscription verification process: Ensure that only subscribed applications can initiate calls.
[0223] Token verification process: Perform permission authentication through the token in the request message.
[0224] Protocol conversion process: Convert data of different protocols according to the configuration information.
[0225] Message conversion process: Further process the message after protocol conversion and initiate a real interface call.
[0226] In this embodiment, the interface configuration platform product can achieve automated configuration, reduce coding work, and accelerate the deployment speed. It supports dynamic adjustment of field mapping and message format, facilitating subsequent expansion. It centrally manages and monitors all interface docking configurations, reducing errors. It implements data encryption and verification, as well as refined access control. It enables business personnel to complete interface docking independently without in - depth understanding of technical details. It formulates unified standards and improves the quality of interface docking.
[0227] Through the above - mentioned embodiments, the interface configuration platform not only simplifies the process of interface docking, but also improves the flexibility, security, and reliability of the system, promotes the efficiency of team collaboration, and solves various problems existing in the prior art.
[0228] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality" means two or more unless otherwise specifically defined.
[0229] In the present invention, unless otherwise clearly defined or limited, terms such as "installed", "connected", "linked", "fixed", etc. shall be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium; it may be the communication inside two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0230] In the present invention, unless otherwise clearly defined or limited, when the first feature is "on" or "under" the second feature, it may be that the first and second features are in direct contact, or the first and second features are indirectly in contact through an intermediate medium. Moreover, when the first feature is "above", "over" and "on top of" the second feature, it may be that the first feature is directly above or obliquely above the second feature, or merely indicates that the horizontal height of the first feature is higher than that of the second feature. When the first feature is "under", "beneath" and "underneath" the second feature, it may be that the first feature is directly below or obliquely below the second feature, or merely indicates that the horizontal height of the first feature is lower than that of the second feature.
[0231] In the description of this specification, the descriptions of terms such as "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0232] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A multi-protocol interface configuration management platform based on microservice architecture, characterized in that: The platform includes: A protocol adaptation module, used for receiving data requests from multiple protocols and standardizing the data requests into an intermediate representation N(P); A dynamic configuration management module is used to receive the intermediate representation N(P) and dynamically adjust the interface parameters according to the real-time load data L(t) and the system resource status R(t), obtain the initial interface parameters, and output them to the intelligent optimization calculation module; The real-time load data L(t) includes: the current traffic size and resource occupancy rate; The system resource status R(t) includes: data request rate; The intelligent optimization calculation module obtains the optimal interface parameter combination according to the initial interface parameters output by the dynamic configuration management module and the optimal interface adaptation configuration strategy; The strategy execution module is used to receive the optimal interface parameter combination output by the intelligent optimization calculation module, and adjust the actual operation parameters of the interface according to the optimal interface parameter combination.
2. The multi-protocol interface configuration management platform based on microservice architecture according to claim 1, characterized in that: The protocol adaptation module comprises: A receiving unit, used for receiving a data request and calculating the frequency of occurrence of each data field of the received data request using formula (1) based on historical data; The formula (1) is: i = the number of occurrences of the i-th data field received by the receiving unit in all data requests / the total number of occurrences of all data fields in the specified time period; p i The frequency of occurrence of the i-th data field in the data request; The receiving unit is further configured to calculate the maximum information entropy H using formula (2) based on the total number n of data fields of the received data request, wherein the formula (2) is: H=logn; A standardized evaluation unit, used to calculate the standardized information entropy N(P) corresponding to the data request according to the frequency of occurrence of each data field of the data request and the maximum information entropy H using formula (3); The formula (3) is: The field mapping unit is used to convert the received data request into a standard structure according to the standardized information entropy N(P) and a preset first threshold.
3. The multi-protocol interface configuration management platform based on microservice architecture according to claim 2 is characterized in that: The field mapping unit converts the received data request into a standard structure according to the standardized information entropy N(P) and a preset first threshold, specifically including: If the standardized information entropy N(P) is less than the first threshold, directly mapping the data request to a preset standardized structure so that the data request becomes a standard structure; If the standardized information entropy N(P) is greater than or equal to the first threshold, the data request is standardized and converted by using a data completion method and / or a field mapping method so that the data request becomes a standard structure.
4. The multi-protocol interface configuration management platform based on microservice architecture according to claim 3, characterized in that: The dynamic configuration management module includes: A load score calculation unit, configured to calculate and obtain the load score by using formula (4) based on the intermediate representation N(P) and according to the real-time load data L(t) and the system resource status R(t); The formula (4) is: Among them, C t is the current CPU usage; C min The preset minimum CPU usage; C max The maximum value of the preset CPU usage; D t is the current memory usage; D min It is the preset minimum memory usage; D max It is the preset maximum value of memory usage; E t is the current data request rate; E min is the preset minimum data request rate; E max The preset maximum value of the data request rate; N(P) min is the preset minimum normalized information entropy; N(P) max is the preset maximum standardized information entropy; F is the load score; α is the first weighting coefficient; β is the second weighting coefficient; γ is the third weighting coefficient; τ is the fourth weighting coefficient; An interface parameter adjustment unit, configured to input the load score into a reinforcement learning model pre-constructed using a deep Q network DQN, wherein the reinforcement learning model outputs a target value of an interface parameter, and uses the target value of the interface parameter as an initial interface parameter; The reinforcement learning model is pre-trained with historical data; The historical data includes: load scores corresponding to different historical time points and theoretical values of corresponding interface parameters.
5. The multi-protocol interface configuration management platform based on microservice architecture according to claim 4, characterized in that: Intelligent optimization calculation module, including: The state modeling unit is used to obtain the initial interface parameters output by the dynamic configuration management module, and to construct the reinforcement learning state space S(t) by combining the real-time load data L(t), the system resource status R(t), the historical load data, and the future load prediction; The action decision unit uses the reinforcement learning model to make decisions based on the reinforcement learning state space S(t) and generates multiple candidate interface parameter adjustment schemes; A reward calculation unit, used to evaluate the candidate interface parameter solutions and obtain the fitness value of each candidate interface parameter adjustment solution; The optimal parameter selection unit determines the optimal interface parameter adjustment scheme based on the fitness value of each candidate interface parameter adjustment scheme.
6. The multi-protocol interface configuration management platform based on microservice architecture according to claim 5, characterized in that: The reinforcement learning state space S(t) includes: real-time load data L(t), system resource status R(t), historical load data, and future load prediction; The historical load data includes: the flow size within T time steps in the second historical time period; the resource occupancy rate within T time steps in the second historical time period, and the resource occupancy rate includes: CPU usage rate and memory occupancy rate; The future load prediction includes: using the LSTM model to predict the traffic data of the future K time steps based on the traffic size in T time steps in the second historical time period; The XGBoot model is used to obtain the resource occupancy data for the next K time steps based on the resource occupancy within T time steps in the second historical time period.
7. The multi-protocol interface configuration management platform based on microservice architecture according to claim 6, characterized in that: The reinforcement learning model includes: Input layer, used to receive the reinforcement learning state space S(t); Hidden layer, used to extract key features from state information through deep neural network and learn how to adjust interface parameters based on these features; The output layer is used to generate the Q value of each possible interface parameter adjustment scheme based on the current state S(t) and the learned features; The generated multiple candidate interface parameter adjustment schemes are interface parameter adjustment schemes corresponding to the highest first M Q values calculated by the reinforcement learning model.
8. The multi-protocol interface configuration management platform based on microservice architecture according to claim 6, characterized in that: The reward calculation unit is used to evaluate the candidate interface parameter solutions and obtain the fitness value of each candidate interface parameter adjustment solution, including: The reward calculation unit uses formula (5) to calculate the fitness value of each candidate interface parameter solution; the formula (5) is: R a =w1·T a -w2·V a ; T a is the throughput score of the ath candidate interface parameter adjustment solution; V a is the load balancing score of the ath candidate interface parameter adjustment solution; w1 is the first weight coefficient; w2 is the second weight coefficient.
9. The multi-protocol interface configuration management platform based on microservice architecture according to claim 8, characterized in that: The throughput score of the ath candidate interface parameter adjustment scheme is calculated by formula (6); The formula (6) is: T is the throughput of the ath candidate interface parameter adjustment scheme; T min is the pre-set minimum throughput; T max is the preset maximum throughput; ∈ is the first adjustment parameter; ε is the second adjustment parameter; c1 is the first weight coefficient; c2 is the second weight coefficient; The load balancing score of the ath candidate interface parameter adjustment scheme is obtained by formula (7); The formula (7) is: V a =1-c3·C-c4·D; C is the CPU usage in the ath candidate interface parameter adjustment scheme; D is the memory occupancy rate in the ath candidate interface parameter adjustment scheme; c3 is the third weight coefficient; c4 is the fourth weight coefficient.
10. The multi-protocol interface configuration management platform based on microservice architecture according to claim 1, characterized in that: The platform also includes: a protocol quality monitoring module; The protocol quality monitoring module is used to obtain the monitoring indicators of the platform and determine whether the monitoring indicators exceed a preset range, and if so, issue an alarm message; The monitoring indicators include packet loss rate: The packet loss rate is calculated by formula (8); The formula (8) is: t res,m is the platform response time for the mth data request; l pkt,m is the number of lost packets; t pkt,m is the total number of packets.
Citation Information
Patent Citations
Robot fleet management and additive manufacturing for value chain networks
CA3177985A1
Multi-point cooperative networking method for heterogeneous local communication network
CN117499937A
Industrial park management system driven by cloud computing
CN117891606A
Multi-platform spatial information resource collaborative sharing method
CN118093867A
Communication network intelligent management system based on multi-agent reinforcement learning
CN119254646A