Supporting high-performance microservice communication method and system in distributed computing environment
By introducing an adaptive communication layer in a distributed computing environment, the communication strategy between microservices is dynamically optimized, which solves the problem of low communication efficiency between microservices, improves data collaboration efficiency, and adapts to the needs of complex communication scenarios.
Patent Information
- Application Number
- CN202310525459.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-05-10
AI Technical Summary
In a distributed computing environment, communication methods between microservices can easily lead to performance loss in data-intensive and communication-intensive scenarios, and existing technologies are unable to effectively improve communication efficiency.
An adaptive communication layer is introduced, which selects and switches communication modes by installing a client on each microservice, and the adaptive service proxy evaluates communication resources and adjusts policies. It operates in a multi-replica mode and dynamically optimizes communication strategies by combining sampled data analysis and communication resource management.
It automatically adapts and optimizes communication strategies under different data volumes and communication frequencies to improve the efficiency of data collaboration between microservices. In particular, it adapts to different communication scenarios and achieves a balance between efficiency for artificial intelligence algorithms and data analysis applications.
Smart Images

Figure CN116723076B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information technology, in particular to a high-performance micro-service communication method supporting a distributed computing environment. BACKGROUND
[0002] The rapid development of smart cities and digital twin applications has promoted the application of artificial intelligence computing and distributed parallel technology. In terms of software engineering, in order to realize the deployment and operation of intelligent business to adapt to complex cloud-edge collaborative computing environment, application development and deployment are usually carried out in the form of microservices, so that artificial intelligence algorithms, business logic, data processing and other functions are usually deployed in the form of multiple microservices collaboration to facilitate maintenance. The reference mode includes pipeline mode or graph mode.
[0003] Micro-service collaboration requires a large amount of inter-service communication. In the implementation mode of micro-service itself, inter-service communication is carried out by calling micro-service interface. From the perspective of software engineering, this mode provides a clear association relationship, and the overall management is very convenient. However, from the performance evaluation point of view, for data-intensive and communication-intensive scenarios, the use of general data transmission mode is easy to cause performance loss.
[0004] Therefore, it is necessary to propose a new technical solution to improve the above technical problems. SUMMARY
[0005] In view of the defects in the prior art, the purpose of the present application is to provide a high-performance micro-service communication method and system supporting a distributed computing environment.
[0006] According to the high-performance micro-service communication method supporting a distributed computing environment provided by the present application, the method comprises the following steps:
[0007] Step S1: Build an overall architecture mode of adaptive communication. The adaptive communication of micro-service is carried out by installing a client on each micro-service, selecting and switching the communication mode through the client, and sampling the communication by the client to assist the adaptive service agent in evaluating the communication mode;
[0008] Step S2: Perform the working mechanism of the adaptive service client. The deployment mode of the client is to replace the data communication module for micro-service collaboration in the micro-service, thereby intercepting the data communication mode and adjusting the strategy to utilize the communication resources fed back by the adaptive service agent;
[0009] Step S3: Perform the working mechanism of the adaptive service agent; the adaptive service agent runs in the form of an independent micro-service and runs in the form of multiple copies;
[0010] Step S4: the evaluation model algorithm design of the communication channel selection is completed, and the adaptive communication agent determines the communication strategy for each microservice communication channel after evaluating the communication sampling, and the selection of the communication strategy is performed in the form of a mapping table.
[0011] Preferably, the step S1 comprises the following steps:
[0012] Step S1.1: the adaptive communication client sends a communication mode request to the adaptive service agent;
[0013] Step S1.2: the adaptive service agent feeds back to the client according to the recommended communication mode and communication resources obtained by analyzing the sampling information;
[0014] Step S1.3: the adaptive communication client sends a sampling data packet to the adaptive range agent;
[0015] Step S1.4: the adaptive service agent updates the sampling data table and analyzes the data in a timing manner to generate a new communication mode recommendation;
[0016] Step S1.5: the communication completes the release of the communication resources to the adaptive service agent.
[0017] Preferably, in the step S2:
[0018] The microservice sends a string through the following API implemented based on HTTP:
[0019] Send(Data, Size); / / Data is a string
[0020] At the bottom layer of the adaptive communication client, the implementation of the API can be replaced by an RPC API or an RDMA API to apply specific data transmission channels.
[0021] The client is responsible for two aspects of work:
[0022] Communication process sampling, including: communication mode, communication frequency, data capacity, whether intra-node communication, sampling time;
[0023] Send a request for communication mode selection to the adaptive communication agent and obtain feedback from the communication agent.
[0024] Preferably, in the step S3:
[0025] The service agent includes a sampling data table, a data analysis component, a communication mode feedback component, and a communication channel management component;
[0026] The adaptive service agent builds a data table for each microservice that cooperates and each communication channel of the microservice, and a sampling analysis data segment is established for each data segment; each data segment maintains k records as follows:
[0027] Communication mode: RPC, HTTP, object storage, indicated by number;
[0028] Data capacity: indicated by the number of communication bits;
[0029] Whether the node communication: determined according to the communication target position;
[0030] Sampling time: communication initiation time;
[0031] The sampling data analysis component determines the type and frequency of communication within the time range defined by the k records according to the above information; the data segment is updated in a first-in, first-out manner, so the data segment always maintains the latest sampling information; the data analysis component is analyzed in a regular manner;
[0032] The adaptive service agent also manages a series of communication channels, including HTTP, HTTPS, RPC, RDMA, and object storage. Each type of communication channel has a number of resources that can be allocated to adaptive communication clients. The resource allocation method is first come, first served. If the client fails to release the resources in time, the adaptive service agent needs to forcibly kill the resources.
[0033] Preferably, in the step S4:
[0034] The sampling data analysis system needs to determine the communication scenario, communication frequency and data capacity, and the calculation method is as follows:
[0035] Communication scenario: communication is divided into two scenarios, intra-node and inter-node, according to the sampling information, and the scenario with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario, if there is no communication scenario with a proportion of more than 2 / 3, then the intra-node is taken as the default scenario;
[0036] Communication frequency: the communication frequency is calculated according to the time range and the number of communications defined by the sampling data segment;
[0037] Communication capacity: the average data capacity of each communication mode is determined by the records in the sampling data segment, including sending and receiving;
[0038] According to the communication frequency, the threshold Ft set by the user is used as the basis, and the frequency exceeding Ft is high; the data capacity is also based on the threshold Vt set by the user, and the capacity exceeding Vt is large.
[0039] According to the communication scenario, the communication frequency and the communication capacity information obtained by the above calculation, a recommended communication mode is obtained by being substituted into a mapping table; on the basis of the communication mode, corresponding communication resources are further obtained by a communication resource management module, if the resources cannot be allocated, the recommendation fails, the adaptive communication client and the peer negotiate to switch back to the standard micro-service communication mode, and the communication is not blocked.
[0040] The application also provides a high-performance micro-service communication system supporting a distributed computing environment, which comprises the following modules.
[0041] Module M1: the overall architecture of adaptive communication is constructed, the adaptive communication of micro-service is realized by installing a client on each micro-service, the selection and switching of the communication mode are realized by the client, and the client samples the communication to assist the adaptive service agent in evaluating the communication mode;
[0042] Module M2: the working mechanism of the adaptive service client is realized, the deployment mode of the client is to replace the data communication module for cooperation between micro-services in the micro-service, so as to intercept the data communication mode and adjust the strategy to utilize the communication resources fed back by the adaptive service agent;
[0043] Module M3: the working mechanism of the adaptive service agent is realized; the adaptive service agent is operated in the mode of independent micro-service and is operated in the mode of multiple copies;
[0044] Module M4: the evaluation model algorithm design of the communication channel selection is realized; the adaptive communication agent determines the communication strategy for the communication channel of each micro-service after sampling the communication, and the selection of the communication strategy is realized in the mode of mapping table.
[0045] Preferably, the module M1 comprises the following modules:
[0046] Module M1.1: the adaptive communication client sends a communication mode request to the adaptive service agent;
[0047] Module M1.2: the adaptive service agent feeds back the recommended communication mode and the communication resources obtained according to the analysis sampling information to the client;
[0048] Module M1.3: the adaptive communication client sends a sampling data packet to the adaptive service agent;
[0049] Module M1.4: the adaptive service agent updates the sampling data table and analyzes the data in a timing mode to generate a new communication mode recommendation;
[0050] Module M1.5: the communication completes the release of the communication resources to the adaptive service agent.
[0051] Preferably, in the module M2:
[0052] Microservices send strings through the following HTTP-based API implementation:
[0053] Send(Data, Size); / / Data is a string
[0054] At the bottom of the adaptive communication client, the implementation of this API may be replaced by an RPC API or an RDMA API to apply specific data transmission channels.
[0055] The client is responsible for two aspects of work:
[0056] Communication process sampling, including: communication method, communication frequency, data volume, whether intra-node communication, sampling time;
[0057] Send a request for communication method selection to the adaptive communication agent, and obtain feedback from the communication agent.
[0058] Preferably, in the module M3:
[0059] The service agent includes a sampling data table, a data analysis component, a communication method feedback component, and a communication channel management component.
[0060] The adaptive service agent has a data table built-in, which establishes a sampling and analysis data segment for each microservice that cooperates and each communication channel of each microservice; each data segment maintains k records as follows:
[0061] Communication method: RPC, HTTP, object storage, represented by a number;
[0062] Data volume: represented by the number of bits of communication;
[0063] Intra-node communication: determined according to the location of the communication target;
[0064] Sampling time: communication initiation time;
[0065] The sampling data analysis component determines the type and frequency of communication within the time range defined by the k records based on the above information; the data segment is updated in a first-in, first-out manner, so the data segment always maintains the latest sampling information; the data analysis component is analyzed in a regular manner.
[0066] The adaptive service agent also manages a series of communication channels, including HTTP, HTTPS, RPC, RDMA, and object storage; each type of communication channel has a number of resources available for allocation to adaptive communication clients; the resource allocation method is first-come, first-served, and if the client fails to release resources in a timely manner, the adaptive service agent needs to forcibly kill the resources.
[0067] Preferably, in the module M4:
[0068] The sampling data analysis system needs to determine the communication scenario, communication frequency and data capacity, and the calculation method is as follows:
[0069] Communication scenario: communication is divided into two scenarios of intra-node and inter-node, according to the sampling information, the scene with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario, if there is no communication scenario with a proportion of more than 2 / 3, the intra-node is taken as the default scenario;
[0070] Communication frequency: the communication frequency is calculated according to the time range and the number of communications defined by the sampling data segment;
[0071] Communication capacity: the average data capacity of each communication mode is determined by the records in the sampling data segment, including sending and receiving;
[0072] According to the communication frequency, the threshold Ft set by the user is used as the basis, and the frequency exceeding Ft is high; the data capacity is also based on the threshold Vt set by the user, and the capacity exceeding Vt is large.
[0073] According to the communication scenario, communication frequency and communication capacity information calculated above, the recommended communication mode is obtained by substituting into the mapping table; on the basis of the communication mode, the corresponding communication resource is further obtained through the communication resource management module, if the resource cannot be allocated, the recommendation fails, the adaptive communication client and the opposite end negotiate to switch back to the standard micro-service communication mode, and the communication is not blocked.
[0074] Compared with the prior art, the present application has the following beneficial effects:
[0075] 1. The present application is used to improve the efficiency of micro-service data collaboration in a distributed computing environment, by introducing a communication layer specially serving micro-service data collaboration, automatically adapting and optimizing the communication strategy under different data capacity, communication frequency and scene, and the efficiency of micro-service collaboration;
[0076] 2. The present application proposes an adaptive communication mode adaptation method, which provides a performance prompt method for micro-service collaboration, especially for application micro-services based on artificial intelligence algorithms and data analysis, which needs to consider the transmission efficiency of small amount of data and large capacity data block at the same time, and the adaptive method can effectively switch between different transmission modes to adapt to different communication scenarios and achieve efficiency balance. BRIEF DESCRIPTION OF DRAWINGS
[0077] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments, with reference to the accompanying drawings:
[0078] Figure 1A general microservice communication method for the present application;
[0079] Figure 2 A self-adaptive microservice communication method for the present application;
[0080] Figure 3 A self-adaptive communication system architecture for the present application;
[0081] Figure 4 A self-adaptive service agent architecture for the present application;
[0082] Figure 5 A self-adaptive communication channel / protocol selection architecture for the present application. DETAILED DESCRIPTION
[0083] The present application will be described in detail below with specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of changes and improvements can be made. These are within the scope of the present application.
[0084] Example 1:
[0085] According to the high-performance microservice communication method provided by the present application in a distributed computing environment, the method comprises the following steps:
[0086] Step S1: Build the overall architecture of adaptive communication. The adaptive communication of microservices is achieved by installing a client on each microservice, selecting and switching the communication mode through the client, and sampling the communication by the client to assist the adaptive service agent in evaluating the communication mode.
[0087] Step S1.1: The adaptive communication client sends a communication method request to the adaptive service agent.
[0088] Step S1.2: The adaptive service agent feeds back to the client according to the recommended communication method and communication resources obtained by analyzing the sampling information.
[0089] Step S1.3: The adaptive communication client sends a sampling data packet to the adaptive service agent.
[0090] Step S1.4: The adaptive service agent updates the sampling data table and analyzes the data according to the timing method to generate a new communication method recommendation.
[0091] Step S1.5: The communication completes the release of the communication resources to the adaptive service agent.
[0092] Step S2: Perform the working mechanism of the adaptive service client. The client is deployed in a way to replace the data communication module for inter-microservice collaboration in the microservice, thereby intercepting the data communication mode and adjusting the strategy to utilize the communication resources fed back by the adaptive service agent. The microservice sends a string through the following HTTP-based API:
[0093] Send(Data, Size); / / Data is a string
[0094] At the bottom of the adaptive communication client, the implementation of the API can be replaced by an RPC API or an RDMA API to apply specific data transmission channels. The client is responsible for two aspects of work: communication process sampling, which collects content including: communication mode, communication frequency, data capacity, whether it is intra-node communication, and sampling time; sending a request for communication mode selection to the adaptive communication agent and obtaining feedback from the communication agent.
[0095] Step S3: Perform the working mechanism of the adaptive service agent; the adaptive service agent runs in the form of an independent microservice and runs through multiple copies; the service agent includes a sampling data table, a data analysis component, a communication mode feedback component, and a communication channel management component; the adaptive service agent has a built-in data table for each microservice that collaborates and each communication channel of the microservice to establish a sampling and analysis data segment; each data segment maintains k records as follows: communication mode: RPC, HTTP, object storage, indicated by a number; data capacity: expressed in bits of communication; whether it is intra-node communication: determined according to the communication target location; sampling time: communication initiation time; the sampling data analysis component determines the type and frequency of communication within the time range defined by the k records according to the above information; the data segment is updated in a first-in, first-out manner, so the data segment always maintains the latest sampling information; the data analysis component is analyzed in a regular manner; the adaptive service agent also manages a series of communication channels, including HTTP, HTTPS, RPC, RDMA, and object storage. Each type of communication channel has a number of resources available for allocation to adaptive communication clients. The resource allocation method is first-come, first-served. If the client fails to release the resources in time, the adaptive service agent needs to forcibly kill the resources.
[0096] Step S4: the evaluation model algorithm design of the communication channel selection is completed, the adaptive communication agent determines the communication strategy for each microservice communication channel after evaluating the communication sampling, and the selection of the communication strategy is in the form of a mapping table; the sampling data analysis system needs to determine the communication scenario, communication frequency and data capacity, and the calculation method is as follows: communication scenario: communication is divided into two scenarios of node and inter-node, according to the sampling information, the scene with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario, if there is no communication scene with a proportion of more than 2 / 3, the node is taken as the default scene; communication frequency: the communication frequency is calculated according to the time range and the number of communications defined by the sampling data segment; communication capacity: the average data capacity of each communication mode is determined through the record in the sampling data segment, including sending and receiving; according to the communication frequency, the threshold Ft set by the user is taken as the basis, and the frequency higher than Ft is high; the data capacity is also based on the threshold Vt set by the user, and the capacity larger than Vt is large. According to the communication scenario, communication frequency and communication capacity information obtained by the above calculation, the recommended communication mode is obtained by substituting into the mapping table; on the basis of the communication mode, the corresponding communication resource is further obtained through the communication resource management module, if the resource cannot be allocated, the adaptive communication client and the opposite end are negotiated to switch back to the standard microservice communication mode, and the communication is not blocked.
[0097] The application also provides a high-performance microservice communication system supporting a distributed computing environment, which can be realized by executing the flow steps of the high-performance microservice communication method supporting a distributed computing environment, that is, the high-performance microservice communication method supporting a distributed computing environment can be understood as the preferred embodiment of the high-performance microservice communication system supporting a distributed computing environment by those skilled in the art.
[0098] Example 2:
[0099] The application also provides a high-performance microservice communication system supporting a distributed computing environment, which includes the following modules:
[0100] Module M1: the overall architecture of adaptive communication is constructed, the adaptive communication of microservice is realized by installing a client on each microservice, the selection and switching of the communication mode are realized through the client, and the client samples the communication to assist the adaptive service agent in evaluating the communication mode;
[0101] Module M1.1: the adaptive communication client sends a communication mode request to the adaptive service agent;
[0102] Module M1.2: the adaptive service agent feeds back to the client according to the recommended communication mode and communication resource obtained by analyzing the sampling information;
[0103] Module M1.3: Adaptive communication client sends sampling data packet to adaptive range agent;
[0104] Module M1.4: Adaptive service agent updates sampling data table, and analyzes data in a timing manner to generate new communication mode recommendation;
[0105] Module M1.5: Communication completion releases communication resources to adaptive service agent.
[0106] Module M2: Perform the working mechanism of adaptive service client. The deployment mode of the client is to replace the data communication module for inter-microservice collaboration in the microservice, thereby intercepting the data communication mode and adjusting the strategy to utilize the communication resources fed back by the adaptive service agent. The microservice sends a string through the following API implemented based on HTTP:
[0107] Send(Data, Size); / / Data is a string
[0108] At the bottom of the adaptive communication client, the implementation of the API can be replaced by an RPC API or an RDMA API to apply specific data transmission channels. The client is responsible for two aspects of work: communication process sampling, which collects content including: communication mode, communication frequency, data volume, whether intra-node communication, sampling time; sending a request for communication mode selection to the adaptive communication agent, and obtaining feedback from the communication agent.
[0109] Module M3: Perform the working mechanism of adaptive service agent; the adaptive service agent runs in the form of an independent microservice and runs through multiple copies; the service agent includes a sampling data table, a data analysis component, a communication mode feedback component, and a communication channel management component; the adaptive service agent has a built-in data table, which establishes a sampling analysis data segment for each collaborative microservice and each communication channel of the microservice; each data segment maintains k records as follows: communication mode: RPC, HTTP, object storage, indicated by a number; data volume: indicated by the number of bits of communication; whether intra-node communication: determined according to the location of the communication target; sampling time: communication initiation time; the sampling data analysis component determines the type and frequency of communication within the time range defined by the k records according to the above information; the update mode of the data segment is first-in, first-out, so the data segment always maintains the latest sampling information; the data analysis component performs periodic analysis; the adaptive service agent also manages a series of communication channels, including HTTP, HTTPS, RPC, RDMA, and object storage. Each type of communication channel has a number of resources available for allocation to adaptive communication clients. The resource allocation mode is first-come, first-served. If the client fails to release the resources in time, the adaptive service agent needs to forcibly kill the resources.
[0110] Module M4: The evaluation model algorithm design of the completion of the communication channel selection, the adaptive communication agent determines the communication strategy for each microservice communication channel after evaluating the communication sampling, and the selection of the communication strategy is in the form of a mapping table; the sampling data analysis system needs to determine the communication scenario, communication frequency and data capacity, and the calculation method is as follows: communication scenario: communication is divided into two scenarios, intra-node and inter-node, according to the sampling information, the scene with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario, if there is no communication scenario with a proportion of more than 2 / 3, the intra-node is taken as the default scenario; communication frequency: according to the time range and the number of communications defined by the sampling data segment, the communication frequency is calculated; communication capacity: the average data capacity of each communication method is determined through the records in the sampling data segment, including sending and receiving; according to the communication frequency, the threshold Ft set by the user is used as the basis, and the frequency exceeding Ft is high; the data capacity is also based on the threshold Vt set by the user, and the capacity exceeding Vt is large. According to the communication scenario, communication frequency and communication capacity information obtained by the above calculation, the mapping table is substituted to obtain the recommended communication method; on the basis of the communication method, the corresponding communication resources are further obtained through the communication resource management module, if the resources cannot be allocated, the adaptive communication client and the opposite end negotiate to switch back to the standard microservice communication mode, and the communication is not blocked.
[0111] Example 3:
[0112] A high-performance microservice communication mechanism supporting distributed computing environment, which uses an independent adaptive communication client to replace the standard microservice communication method for inter-microservice communication and collaborative operation. The adaptive communication agent service is used to analyze the sampling information of the adaptive communication client to determine the recommended optimized communication method for the microservice to which the adaptive communication client belongs. Based on the sampling information, the dynamic optimization communication method is recommended. The adaptive communication client is used to sample while communicating data to achieve dynamic optimization. The adaptive service agent end maintains a communication resource pool to dynamically allocate various types of communication resources for the adaptive communication client. The adaptive communication client and the adaptive service agent cooperate to dynamically allocate and release communication resources. The adaptive service agent itself is implemented in the form of a microservice and supports high availability in the form of multiple copies.
[0113] The standard microservice implementation transmits data through HTTP or binary data packet transmission based on RPC. Due to the fixed transmission method, it is suitable for traditional enterprise-level business systems (low input capacity, stable access mode) (see Appendix Figure 1). And the computing task of smart city type needs multiple access modes (frequency and data capacity are not fixed), so the standard way of data interaction of microservices is not applicable after microservice encapsulation. Adaptive microservice communication realizes adaptive adjustment of communication mode between microservices according to the data capacity and frequency of interaction, so as to reduce the time delay and occupation of computing and memory resources caused by communication.
[0114] The present application proposes adaptive microservice communication for high-performance microservice collaborative computing scenarios (see attached Figure 2 ), which realizes efficient data interaction between microservices by increasing adaptive communication services. The content includes three parts: microservice communication client, adaptive service agent and dynamic communication mode selection algorithm based on sampling.
[0115] The implementation of the present application is to deploy an adaptive communication client on a microservice, which communicates with an adaptive service agent to obtain a communication channel and related resources. The selection of the communication channel is obtained by the sampling system of the adaptive communication client to obtain the statistical information of the communication mode, and the adaptive service agent discriminates the specific communication channel selection through the evaluation model. Therefore, the specific implementation of the present application is introduced in the following four steps:
[0116] Overall architecture of adaptive communication;
[0117] Working mechanism of adaptive service client;
[0118] Working mechanism of adaptive service agent;
[0119] Evaluation model algorithm design of communication channel selection.
[0120] Overall architecture of adaptive communication: as shown in the attached Figure 3 , the adaptive communication of microservices installs a client on each microservice, selects and switches the communication mode through the client, and the client also samples the communication to assist the adaptive service agent in evaluating the communication mode. The adaptive service agent receives two kinds of information from the microservice adaptive communication client: 1. Service channel selection request; 2. Sampling information. The adaptive service agent continuously analyzes the communication mode of each microservice through the sampling information, and continuously updates the inter-service communication strategy to provide the best communication strategy for the microservices.
[0121] The working process of adaptive communication is as follows:
[0122] The adaptive communication client sends a communication mode request to the adaptive service agent;
[0123] The adaptive service agent feeds back to the client according to the recommended communication mode and communication resources obtained by analyzing the sampling information;
[0124] The adaptive communication client sends a sampling data packet to the adaptive range agent;
[0125] The adaptive service agent updates the sampling data table and analyzes the data in a timed manner to generate a new communication mode recommendation;
[0126] The communication is completed to release the communication resources to the adaptive service agent.
[0127] The working mechanism of the adaptive communication client: the deployment mode of the client is to replace the data communication module for inter-microservice collaboration in the microservice, thereby the data communication mode can be intercepted and the strategy can be adjusted to utilize the communication resources fed back by the adaptive service agent. For example, the microservice sends a string through the following API implemented based on HTTP:
[0128] Send(Data, Size); / / Data is a string
[0129] At the bottom of the adaptive communication client, the implementation of the API can be replaced by an RPC API or an RDMA API to apply specific data transmission channels.
[0130] As mentioned earlier, the client is responsible for two aspects of work:
[0131] Communication process sampling, the collected content includes: communication mode, communication frequency, data volume, whether intra-node communication, sampling time;
[0132] Send a request for communication mode selection to the adaptive communication agent and obtain feedback from the communication agent.
[0133] The adaptive communication client can maintain the original mode for the selection of the communication channel without sending a request to the adaptive service agent every time, which can avoid high-frequency communication pressure with the adaptive communication service agent.
[0134] The working mechanism of the adaptive service agent: the adaptive service agent runs in the form of an independent microservice, and to achieve high availability, it runs through multiple copies. The architecture of the adaptive service agent is shown in the accompanying Figure 4 The service agent includes a sampling data table, a data analysis component, a communication mode feedback component, and a communication channel management component.
[0135] The adaptive service agent has a built-in data table, which establishes a sampling analysis data segment for each microservice that collaborates and each communication channel of the microservice. Each data segment maintains k (the user can define the value of k) records as follows:
[0136] Communication mode: for example, RPC, HTTP, object storage, etc., represented by a number;
[0137] Data capacity: expressed in bits of communication;
[0138] Intra-node communication: determined according to the location of the communication target;
[0139] Sampling time: communication initiation time.
[0140] The sampling data analysis component can determine the type and frequency of communication within the time range defined by the k records based on the above information. The data segment is updated in a first-in, first-out (FIFO) manner, so the data segment always maintains the latest sampling information. The data analysis component is analyzed in a periodic manner to avoid the computational pressure caused by real-time analysis.
[0141] The adaptive service agent manages a series of communication channels, including HTTP, HTTPS, RPC, RDMA, and object storage. Each type of communication channel has a number of resources that can be allocated to the adaptive communication client, such as object storage bucket locations or RPC endpoint information. The resource allocation method is first-come, first-served. If the client fails to release the resource in time, the adaptive service agent needs to forcibly kill the resource.
[0142] Evaluation model algorithm design for communication channel selection: After the adaptive communication agent evaluates the communication sampling, it determines the communication strategy for each microservice communication channel. The communication strategy selection can be done in a mapping table manner, and the mapping relationship is determined by the following table:
[0143]
[0144]
[0145] The sampling data analysis system needs to determine the communication scenario, communication frequency, and data capacity, which can be calculated as follows:
[0146] Communication scenario: Communication is divided into intra-node and inter-node scenarios. According to the sampling information, the scenario with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario. If there is no communication scenario with a proportion greater than 2 / 3, the intra-node is taken as the default scenario;
[0147] Communication frequency: The communication frequency is calculated based on the time range defined by the sampling data segment and the number of communications;
[0148] Communication capacity: The average data capacity of each communication method, including sending and receiving, is determined by the records in the sampling data segment;
[0149] According to the communication frequency, the threshold Ft set by the user is used as the basis. If it exceeds Ft, it is considered high frequency. The data capacity is also based on the threshold Vt set by the user. If it exceeds Vt, it is considered large capacity.
[0150] According to the communication scenario, communication frequency and communication capacity information calculated above, the recommended communication mode can be obtained by substituting into the mapping table. On the basis of the communication mode, the corresponding communication resource is further obtained by the communication resource management module. If the resource cannot be allocated, the recommendation fails, and the adaptive communication client and the peer negotiate to switch back to the standard micro-service communication mode to ensure that the communication is not blocked.
[0151] Those skilled in the art can understand this embodiment as a more specific description of embodiment 1 and embodiment 2.
[0152] Those skilled in the art know that in addition to implementing the system provided by the present application and each device, module and unit thereof in a pure computer readable program code manner, the same functions can also be achieved by logically programming the method steps to make the system provided by the present application and each device, module and unit thereof in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers. Therefore, the system provided by the present application and each device, module and unit thereof can be considered as a hardware component, and the devices, modules and units included therein for achieving various functions can also be considered as structures within the hardware component; the devices, modules and units for achieving various functions can also be considered as both software modules for achieving methods and structures within the hardware component.
[0153] The specific embodiments of the present application are described above. It should be understood that the present application is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essential content of the present application. In the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A high-performance microservice communication method supporting a distributed computing environment, characterized in that, The method comprises the following steps: Step S1: constructing the overall architecture mode of adaptive communication, the adaptive communication of microservices selects and switches the communication mode through the installation of a client on each microservice, and the client samples the communication to assist the adaptive service agent in evaluating the communication mode; Step S2: performing the working mechanism of the adaptive service client, the deployment mode of the client is to replace the data communication module for cooperation between microservices in the microservice, thereby intercepting the data communication mode and adjusting the strategy to utilize the communication resources fed back by the adaptive service agent; Step S3: performing the working mechanism of the adaptive service agent; the adaptive service agent runs in the mode of an independent microservice and runs through multiple copies; Step S4: completing the evaluation model algorithm design of the communication channel selection, the adaptive communication agent determines the communication strategy for the communication channel of each microservice after sampling the communication, and the selection of the communication strategy is performed in the mode of a mapping table.
2. The method of claim 1, wherein, The step S1 comprises the following steps: Step S1.1: the adaptive communication client sends a communication mode request to the adaptive service agent; Step S1.2: the adaptive service agent feeds back the recommended communication mode and communication resources obtained according to the analysis sampling information to the client; Step S1.3: the adaptive communication client sends a sampling data packet to the adaptive service agent; Step S1.4: the adaptive service agent updates the sampling data table and analyzes the data in a timing manner to generate a new communication mode recommendation; Step S1.5: the communication completes the release of the communication resources to the adaptive service agent. 3.The method of Claim 1, wherein, In the step S2: The microservice sends a string through the following HTTP-based API: Send(Data, Size); / / Data is a string In the underlying of the adaptive communication client, the implementation of the API can be replaced by an RPC API or an RDMA API to apply specific data transmission channels; The client is responsible for two aspects of work: Communication process sampling, the collected content includes: communication mode, communication frequency, data capacity, whether it is intranode communication, and sampling time; Sending a request for communication mode selection to the adaptive communication agent and obtaining feedback from the communication agent.
4. The method of claim 1, wherein, In the step S3: The service agent comprises a sampling data table, a data analysis component, a communication mode feedback component, and a communication channel management component; The adaptive service agent internally builds a data table, establishes a sampling analysis data segment for each microservice that cooperates and each communication channel of the microservice; each data segment maintains k records as follows: Communication mode: RPC, HTTP, object storage, represented by a number; Data capacity: represented by the number of bits of communication; Whether it is intranode communication: determined according to the communication target location; Sampling time: communication initiation time; The sampling data analysis component determines the type and frequency of communication within the time range defined by the k records according to the communication mode, data capacity, whether it is intranode communication, and sampling time; the data segment is updated in a first-in-first-out manner, so that the data segment always maintains the latest sampling information; the data analysis component performs periodic analysis. The adaptive service agent manages a series of communication channels including HTTP, HTTPS, RPC, RDMA, and object storage. Each type of communication channel has a number of resources that can be allocated to adaptive communication clients. The resources are allocated on a first-come, first-served basis. If a client fails to release the resources in a timely manner, the adaptive service agent needs to forcibly kill the resources.
5. The method of claim 1, wherein, In the step S4: The sampling data analysis system needs to determine the communication scenario, communication frequency, and data capacity. The calculation method is as follows: Communication scenario: communication is divided into intra-node and inter-node scenarios. According to the sampling information, the scenario with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario. If there is no communication scenario with a proportion of more than 2 / 3, the intra-node scenario is taken as the default scenario; Communication frequency: the communication frequency is calculated according to the time range and the number of communications defined by the sampling data segment; Communication capacity: the average data capacity of each communication method is determined by the records in the sampling data segment, including sending and receiving; According to the communication frequency, the threshold Ft set by the user is used as the basis. If it exceeds Ft, it is high frequency. The data capacity is also based on the threshold Vt set by the user. If it exceeds Vt, it is large capacity; According to the communication scenario, communication frequency, and communication capacity information obtained by the above calculation, the recommended communication method is obtained by substituting into the mapping table. Based on the communication method, the corresponding communication resources are further obtained through the communication resource management module. If the resources cannot be allocated, the adaptive communication client and the opposite end are returned to negotiate and switch back to the standard micro-service communication mode. The communication is not blocked.
6. A high-performance microservice communication system supporting a distributed computing environment, characterized in that, The system includes the following modules: Module M1: build the overall architecture of adaptive communication. The adaptive communication of microservices is achieved by installing a client on each microservice, selecting and switching the communication mode through the client, and sampling the communication to assist the adaptive service agent in evaluating the communication mode; Module M2: work mechanism of adaptive service client. The deployment method of the client is to replace the data communication module in the microservice for inter-microservice collaboration. Thus, the data communication method is intercepted, and the strategy is adjusted to utilize the communication resources fed back by the adaptive service agent; Module M3: work mechanism of adaptive service agent. The adaptive service agent runs in the form of an independent microservice through multiple copies; Module M4: design of evaluation model algorithm for communication channel selection. After sampling the communication, the adaptive communication agent determines the communication strategy for each microservice communication channel. The selection of the communication strategy is performed in the form of a mapping table.
7. The system of claim 6, wherein, The module M1 includes the following modules: Module M1.1: the adaptive communication client sends a communication mode request to the adaptive service agent; Module M1.2: the adaptive service agent feeds back the recommended communication mode and communication resources to the client according to the analysis of the sampling information; Module M1.3: the adaptive communication client sends a sampling data packet to the adaptive service agent; Module M1.4: the adaptive service agent updates the sampling data table and analyzes the data at regular intervals to generate a new communication mode recommendation; Module M1.5: Communication completion releases communication resources to adaptive service agent.
8. The system of claim 6, wherein the system is configured to support high performance microservice communication in a distributed computing environment. In the module M2: Microservice sends string through the following HTTP-based API implementation: Send(Data, Size); / / Data is string At the bottom of the adaptive communication client, the implementation of this API may be replaced by RPC API or RDMA API to apply specific data transmission channels; The client is responsible for two aspects of work: Communication process sampling, collecting content including: communication mode, communication frequency, data capacity, whether intra-node communication, sampling time; Send a request for communication mode selection to the adaptive communication agent, and obtain feedback from the communication agent.
9. The system of claim 6, wherein, In the module M3: The service agent includes a sampling data table, a data analysis component, a communication mode feedback component, and a communication channel management component; The adaptive service agent has a data table built-in, which establishes a sampling analysis data segment for each microservice that cooperates and each communication channel of the microservice; each data segment maintains k records as follows: Communication mode: RPC, HTTP, object storage, represented by number; Data capacity: represented by the number of bits of communication; Whether intra-node communication: determined according to the location of the communication target; Sampling time: communication initiation time; The sampling data analysis component determines the type and frequency of communication within the time range defined by the k records according to the communication mode, data capacity, whether intra-node communication, and sampling time; the data segment is updated in a first-in, first-out manner, so the data segment always maintains the latest sampling information; the data analysis component is analyzed periodically. The adaptive service agent also manages a series of communication channels, including HTTP, HTTPS, RPC, RDMA, and object storage; each type of communication channel has a number of resources available for allocation to adaptive communication clients; the resource allocation method is first-come, first-served, and if the client fails to release resources in time, the adaptive service agent needs to forcibly kill the resources.
10. The system of claim 6, wherein the system is configured to support high performance microservice communication in a distributed computing environment. In the module M4: The sampling data analysis system needs to determine the communication scenario, communication frequency, and data capacity, and the calculation method is as follows: Communication scenario: communication is divided into intra-node and inter-node scenarios; according to the sampling information, the scenario with a proportion of more than 2 / 3 in the sampling information table is taken as the communication scenario; if there is no communication scenario with a proportion greater than 2 / 3, the intra-node is taken as the default scenario; Communication frequency: communication frequency is calculated according to the time range defined by the sampling data segment and the number of communications; Communication capacity: the average data capacity of each communication mode is determined through the records in the sampling data segment, including sending and receiving; According to the communication frequency, the threshold Ft set by the user is used as the basis, and if it exceeds Ft, it is high frequency; the data capacity is also based on the threshold Vt set by the user, and if it exceeds Vt, it is large capacity; According to the communication scenario, the communication frequency and the communication capacity information obtained by the above calculation, the recommended communication mode is obtained by substituting into the mapping table; on the basis of the communication mode, the corresponding communication resource is further obtained by the communication resource management module, if the resource cannot be allocated, the recommendation fails, the adaptive communication client and the opposite end negotiate to switch back to the standard micro-service communication mode, and the communication is not blocked.
Citation Information
Patent Citations
System architecture transformation method compatible with various development architectures and system architecture
CN112463211A
Self-adaptive micro-service operation optimization system based on operation state sampling
CN114281345A