CN113742111A - Micro-service RPC adaptive scheduling method and related device - Google Patents
Micro-service RPC adaptive scheduling method and related device Download PDFInfo
- Publication number
- CN113742111A CN113742111A CN202111071037.XA CN202111071037A CN113742111A CN 113742111 A CN113742111 A CN 113742111A CN 202111071037 A CN202111071037 A CN 202111071037A CN 113742111 A CN113742111 A CN 113742111A
- Authority
- CN
- China
- Prior art keywords
- rpc
- data
- service
- weight
- request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5011—Pool
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5021—Priority
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Telephonic Communication Services (AREA)
Abstract
The application discloses a micro-service RPC self-adaptive scheduling method and a related device, which comprise the following steps: when the RPC module runs, selecting a communication mode according to the type of data to be called, performing dyeing processing and package serialization operation on the head of the data to be called, and then sending the data to the RPC Proxy module, wherein the RPC Proxy module responds to a request of the RPC module, sets the priority weight of the request, and updates the weight at intervals; carrying out dimensionality reduction on the load information through PCA to obtain a load weight factor, and thus obtaining RPC service routing information according to the load weight factor; then the RPC Proxy module calls resource nodes in the RPC service resource pool based on the priority weight of the request and the RPC service routing information, and finally returns a calling result to the RPC module. The method and the device solve the technical problems that proper bottom layer communication modes cannot be selected according to inherent attributes of the service data, the priority of the calling process is specified to be relatively solidified, and limited callable resources cannot be efficiently coordinated.
Description
Technical Field
The application relates to the technical field of cloud computing micro-services, in particular to a micro-service RPC adaptive scheduling method and a related device.
Background
The microservice architecture is a new technology for deploying applications and services in the cloud. With the popularity of microservice architectures, more and more developers are coming into contact with and learning microservice architectures. In the micro service architecture, communication and scheduling services are a more critical ring. Therefore, the development of communication services in the microservice architecture is a significant issue of concern.
Remote Procedure Call (RPC) is a common inter-service communication method, and is widely used in system environment construction and application programming in distributed systems. A typical remote procedure call service includes a public registry, where service providers register services in the registry, and a service caller obtains a list of service providers that can provide services through the registry, and then selects an actually called service provider according to a certain route to complete the call.
The existing Remote Procedure Call (RPC) bottom layer communication mode is specified when a user code is executed by calling or is solidified in a specific service scene through a configuration mode, a proper bottom layer communication mode cannot be selected according to inherent attributes of service data, and the existing Remote Procedure Call (RPC) bottom layer communication mode is not transparent to a user on the level of the bottom layer communication mode. In addition, the existing micro-service framework load balancing criterion mostly adopts a strategy of distributing requests according to proportion according to a preset weight proportion or heartbeat and load information uploading based on time intervals to perform balanced switching based on CPU occupancy rate, so that the problems that the uploading of the load information frequently occupies system resources, the load information cannot be smoothly switched in a load balancing scheduling in a blank window period, and meanwhile, the priority intention of calling the service cannot be effectively judged are easily caused.
Disclosure of Invention
The application provides a micro-service RPC adaptive scheduling method and a related device, which are used for solving the technical problems that in the prior art, a proper bottom layer communication mode cannot be selected according to inherent attributes of service data, the priority of a calling process is specified to be relatively solidified, and limited callable resources cannot be efficiently coordinated.
In view of this, the first aspect of the present application provides a micro-service RPC adaptive scheduling method, which is applied to an RPC adaptive scheduling system composed of an RPC module, an RPC Proxy module, and an RPC service resource pool, and the method includes:
when the RPC module runs, selecting a corresponding preset communication mode according to the type of data to be called, dyeing the head of the data to be called, packaging and serializing the data to be called, and then sending the data to the RPC Proxy module;
the RPC Proxy module responds to a request of the RPC module, sets the position of the data to be called in a queue to be sent according to the priority weight of the request, and updates the request priority weight of the calling data in the queue to be sent according to a preset weight updating time interval;
the RPC Proxy module judges whether the RPC service is in a running state, if so, the step S1 is executed, otherwise, the information of no available service is returned to the RPC module;
s1, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit or not, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain a load weight factor;
s2, sorting the load weight factors, and selecting the optimal load weight factor to set RPC service routing information;
and S3, based on the position of the data to be called in the queue to be sent, calling the resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module according to the priority weight of the data to be called.
Optionally, the method further comprises:
when the request of the RPC module is a priority preemption request and a resource node is not obtained, the RPC Proxy module suspends a call service corresponding to a first request, wherein the priority weight of the first request is lower than that of the priority preemption request;
and according to the RPC service routing information, calling resource nodes in the RPC service resource pool, and returning a calling result to the RPC module.
Optionally, the method further comprises: and the RPC module receives the call result returned by the RPC Proxy module, and performs deserialization unpacking operation on the call result.
Optionally, the performing dimension reduction on the load information through PCA to obtain a load weight factor specifically includes:
constructing a matrix with n rows and m columns according to the load information, wherein n is the dimension of the load information, and m is the number of the load information;
after zero averaging is carried out on the incoming line of the matrix, solving to obtain a covariance matrix;
solving the eigenvalue of the covariance matrix and the corresponding eigenvector;
and arranging the eigenvectors into a first matrix from top to bottom according to the size of the corresponding eigenvalue, and taking the front k rows to form a second matrix to obtain a load weight factor, wherein n, m and k are positive integers.
Optionally, the selecting a corresponding preset communication mode according to the type of the data to be called specifically includes:
the types of the data to be called comprise: the system comprises reliable data, unreliable data, streaming data and time sensitive data, wherein a preset communication mode corresponding to the reliable data is TCP, a preset communication mode corresponding to the unreliable data is UDP, a preset communication mode corresponding to the streaming data is QUIC, and a preset communication mode of the time sensitive data is KCP;
and setting the prior communication mode as http, so as to construct the corresponding relation between the data to be called and the communication mode, and enabling the RPC module to select the corresponding communication mode according to the type of the data to be called based on the corresponding relation.
Optionally, the updating the request priority weight of the call data in the queue to be sent according to the preset weight update time interval specifically includes:
setting the request priority weight to be composed of a priority preemption weight and a message blocking factor weight;
updating the message blocking factor weight based on a message blocking factor weight calculation formula, thereby updating the request priority weight;
wherein, the message blocking factor weight calculation formula is as follows:
Q=ΔtnB;
in the formula, Q is a low 16-bit blocking weight factor, Δ tn is the number of message blocking time intervals, B is a weight operator and is defined as arctan (X × δ) × 65535 × 2/π, wherein δ is a message blocking factor coefficient, and X is an arbitrary input parameter.
The second aspect of the present application provides a micro-service RPC adaptive scheduling system, the system includes:
the RPC module is used for selecting a corresponding preset communication mode according to the type of the data to be called during operation, dyeing the head of the data to be called, performing packet serialization operation on the data to be called, and then sending the data to the RPC Proxy module;
the RPC Proxy module is used for responding to a request of the RPC module, setting the position of the data to be called in the queue to be sent according to the priority weight of the request, and updating the request priority weight of the calling data in the queue to be sent according to a preset weight updating time interval;
judging whether the RPC service is in an operating state, if so, executing a step S1, otherwise, returning information of no available service to the RPC module;
s1, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit or not, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain a load weight factor;
s2, sorting the load weight factors, and selecting the optimal load weight factor to set RPC service routing information;
and S3, based on the position of the data to be called in the queue to be sent, calling the resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module according to the priority weight of the data to be called.
Optionally, the RPC Proxy module is further configured to:
when the request of the RPC module is a priority preemption request and a resource node is not obtained, suspending a call service corresponding to a first request, wherein the priority weight of the first request is lower than that of the priority preemption request;
and according to the RPC service routing information, calling resource nodes in the RPC service resource pool, and returning a calling result to the RPC module.
The third aspect of the present application provides a micro-service RPC adaptive scheduling device, which includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the steps of the micro-service RPC adaptive scheduling method according to the first aspect, according to instructions in the program code.
A fourth aspect of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store program codes, and the program codes are used to execute the micro-service RPC adaptive scheduling method of the first aspect.
According to the technical scheme, the method has the following advantages:
1. in the RPC calling process of the user interface, when the RPC module runs internally and on the premise that a user does not forcibly specify a communication mode, the inherent characteristics of data input by the user are hidden, a proper underlying data transmission mode is selected in a self-adaptive manner, and details of dyeing processing are carried out on corresponding fields of interactive data, so that the process is more transparent than that of a traditional mode;
2. in the priority processing of request distribution, because data is sent to the RPC Proxy module for unified processing, compared with the traditional mode, the user layer does not need to care about the priority distribution processing and the selection and designation details of the load balancing resource nodes. And because the unified judgment criterion combining the preemptive priority and the non-preemptive priority is adopted, the insertion and sorting operation depending on the request priority and the priority processing difficulty are simplified, so that the time complexity of the RPC Proxy module for realizing the distribution based on the priority weight is reduced;
3. the adaptive scheduling strategy for preemptive priority request resource allocation under high resource load can adaptively and dynamically regulate the running state of each task according to the resource occupation condition in the whole system to realize the timeliness and operability of preemptive priority processing, and provides adaptive strategy guarantee for preempting the resource by the task with high priority in the system;
4. the load factor method based on the combination of the Markov process and the PCA can efficiently carry out load sequencing on the resource pool and predict the current load information of the overdue load information, thereby reducing the overall performance loss of the framework caused by the load information of each resource node in the interactive resource pool on the premise of improving the fairness of load balancing under the micro-service framework.
Compared with the traditional distribution strategy of distributing requests according to proportion based on weight proportion, the method can better reflect the fairness of resource node load balance; compared with a balanced switching mode of the CPU occupancy rate, the load intensity is not only reflected on the CPU occupancy rate, and the real load condition of the resource node can be reflected more fully by the criterion. Due to the adoption of the load factor method, the system performance loss caused by frequent reporting of the resource node load information can be further reduced; the method for selecting the executable resource node by the user layer according to the executable resource node list information is transparent to the user layer, hides the selection details and reduces the development difficulty of the user. Therefore, the technical problems that in the prior art, a proper bottom layer communication mode cannot be selected according to inherent attributes of service data, the priority of a calling process is assigned to be relatively solidified, and limited available resources cannot be efficiently coordinated are solved.
Drawings
Fig. 1 is a schematic flow chart of a first embodiment of a micro-service RPC adaptive scheduling method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a second embodiment of a micro-service RPC adaptive scheduling method provided in the embodiment of the present application;
fig. 3 is a schematic structural diagram of an embodiment of a micro-service RPC adaptive scheduling system provided in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Interpretation of terms:
RPC: (Remote Procedure Call) a protocol that requests services from a Remote computer program over a network without knowledge of the underlying network technology. That is to say, two servers a and B, one application is deployed on the server a, and it is desired to call the method provided by the application on the server B, because there is no memory space, it cannot be called directly, and it is necessary to express the semantics of the call and to communicate the data of the call through the network.
RPC Proxy: the remote procedure call proxy.
Load balancing: the load (work task) is balanced and distributed to a plurality of operation units for operation. The method is built on the original network structure, and provides a transparent, cheap and effective method for expanding the bandwidth of the server and the network equipment, strengthening the network data processing capacity, increasing the throughput and improving the availability and flexibility of the network.
It should be noted that, an RPC Proxy module (RPC Proxy) is deployed in a distributed manner on a plurality of resource nodes in a system resource pool, and controls the whole micro-service invocation behavior through a control center, data transceiving of each micro-service node is completed through a data Proxy module, and a micro-service code is only communicated with the data Proxy module. The control center is a central control node and is responsible for regulating and controlling all micro service nodes, realizing service registration, configuration issuing and access authority configuration, having the authority for controlling the data agent module, and having the capability of collecting any data from the data agent module, thereby sensing the service operation state of the whole micro service framework network in detail according to the operation state of the data agent module. The RPC agent module provides a uniform message receiving and service query interface for upper-layer application, is responsible for realizing service discovery, flow control and communication load balancing access in a micro-service environment, is controlled by a control center, and provides functions of flow monitoring and request tracking.
Referring to fig. 1, a micro-service RPC adaptive scheduling method provided in an embodiment of the present application is applied to an RPC adaptive scheduling system including an RPC module, an RPC Proxy module, and an RPC service resource pool, and as shown in fig. 3, the method includes:
101, when the RPC module runs, selecting a corresponding preset communication mode according to the type of the data to be called, dyeing the head of the data to be called, performing packet serialization operation on the data to be called, and then sending the data to the RPC Proxy module.
It should be noted that, the RPC module supports a synchronous mode and an asynchronous mode during operation, and the data types to be called include: reliable, unreliable, stream, short message, etc., the application selects the bottom communication mode through real-time self-adaptation.
The service RPC calling process is based on the RPC module to perform dyeing processing on the head of the data to be called of the RPC according to the service and the parameters transmitted by the RPC calling; and the default self-adaptive preference strategy is http, reliable TCP, unreliable UDP, flow mode QUIC and time sensitive data KCP. And after the dyeing treatment is finished, performing packet serialization operation on the data, and sending the data to an RPC Proxy module.
And 102, responding to the request of the RPC module by the RPC Proxy module, setting the position of the data to be called in the queue to be sent according to the priority weight of the request, and updating the request priority weight of the calling data in the queue to be sent according to a preset weight updating time interval.
It should be noted that, after receiving the request of the service RPC module, the RPC Proxy module updates the state of the relevant state machine according to the request and the response attribute of the data, and inserts the data to be called into the queue to be sent according to the request priority weight.
Specifically, the RPC Proxy module responds to the RPC module service request, and after receiving the RPC module service request, the RPC Proxy module inserts the service request into the request queue according to the priority weight in the request.
In order to accelerate the request priority operation in the RPC Proxy, the priority weight is defined to be realized by a 32-Bit field, the higher 16 bits of the field are used for preempting the priority weight, and the lower 16 bits are used for the message blocking factor weight. An ordered queue based on the weight field is maintained in the RPC Proxy.
Defining an operator B as a message blocking factor weight operator, wherein the operator has the following characteristic requirements:
the output range of the parameter X (X is more than or equal to 0) is [0,65535 ], the output result is increased more slowly as X is increased (when X is very large, the system has a very serious fault problem, and priority selection strategy execution is preferentially ensured when the system is normal).
The operator B is defined as arctan (X δ) 65535X 2/pi, where δ is the message blocking factor coefficient; and delta tn is the number of message blocking time intervals, Q is Q obtained by delta tnB, and Q is a low 16-Bit blocking weight factor, so that the remote procedure call data priority of 32 bits is obtained.
And the RPC Proxy module updates the message data priority in each time window of the message priority update, so that the data with high message data priority has higher data sending right.
And 103, judging whether the RPC service is in a running state or not by the RPC Proxy module, if so, executing the step 104, and otherwise, returning information of no available service to the RPC module.
It should be noted that, the RPC Proxy module interacts with the control center, first determines whether the RPC service is available, if not, returns to the unavailable service, and if so, executes step 104.
And step 104, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain the load weight factor.
It should be noted that, if available, it is determined whether the difference between the host load information timestamp and the current timestamp is out of limit when the RPC service is running.
If the load information is outdated data (the difference between the timestamp of the host load information and the current timestamp is out of limit), the load information is predicted through a Markov process. Because the server load data is similar to a random process and has Markov property, the application adopts the Markov method to predict the server running load. Then, considering that the multidimensional property of the load information (including CPU occupancy rate, memory occupancy, network bandwidth occupancy and disk IO of resource nodes) is not beneficial to rapid scheduling and sorting, the method and the device extract valuable information quantity after dimension reduction by using a principal component analysis dimension reduction mode, and facilitate subsequent unified sorting processing.
And (4) carrying out dimensionality reduction on the load information through PCA to obtain a load weight factor, and selecting an optimal load weight factor. The dimensionality reduction steps are as follows:
there are m pieces of n-dimensional data (load information).
1) The original data is grouped into a matrix X of n rows and m columns by columns.
2) Each row of X (representing an attribute field) is zero-averaged, i.e., the average of this row is subtracted.
3) And solving a covariance matrix.
4) And solving the eigenvalue of the covariance matrix and the corresponding eigenvector r.
5) And arranging the eigenvectors into a matrix from top to bottom according to the size of the corresponding eigenvalue, and taking the first k rows to form the matrix P.
6) Namely, the data after dimension reduction to 1 dimension, namely, the load weight factor.
And if the difference value between the timestamp of the host load information and the current timestamp is not out of limit, directly performing dimensionality reduction on the load information through the PCA to obtain a load weight factor.
And 105, sequencing the load weight factors, and selecting the optimal load weight factor to set RPC service routing information.
It should be noted that the load weight factors are obtained in step 104, and the optimal load weight factors are obtained in step 105 according to the load factor sorting, and the route information of the optimal RPC service is obtained when the load weight factors meet the preset conditions.
And 106, based on the position of the data to be called in the queue to be sent, calling resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module according to the priority weight of the data to be called.
And finally, the RPC Proxy module selects (requests) a certain resource node in the PRC service resource pool according to the request priority (request sequence) of the data to be called in the queue to be requested and the RPC service routing information. After the resource node (calling result) is obtained, the calling result is returned to the return RPC module according to the priority weight of the resource node.
The foregoing is an embodiment first of a micro-service RPC adaptive scheduling method provided in the embodiment of the present application, and the following is an embodiment second of the micro-service RPC adaptive scheduling method provided in the embodiment of the present application.
Referring to fig. 2, a micro-service RPC adaptive scheduling method provided in an embodiment of the present application is applied to an RPC adaptive scheduling system including an RPC module, an RPC Proxy module, and an RPC service resource pool, and the method includes:
And step 203, judging whether the RPC service is in a running state by the RPC Proxy module, if so, executing step 204, and otherwise, returning information of no available service to the RPC module.
And 204, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain the load weight factor.
And step 205, sequencing the load weight factors, and selecting the optimal load weight factor to set RPC service routing information.
And step 206, based on the position of the data to be called in the queue to be sent, calling resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module according to the priority weight of the data to be called.
It should be noted that the description of steps 201-206 is the same as the description of step 101-106 in the embodiment, please refer to the description of step 101-106, and the description thereof is not repeated herein.
And step 207, when the request of the RPC module is a priority preemption request and a resource node is not obtained, suspending the call service corresponding to the first request by the RPC Proxy module, wherein the priority weight of the first request is lower than that of the priority preemption request.
And step 208, calling the resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module.
It should be noted that in step 207-.
The request with lower priority level exists on the resource node, and the request with lower priority level is in the running state, and the average value of the request priority levels of all the requests in the running state is the lowest. And realizing the strategy of the self-adaptive scheduling method of the limited resources under the preemptive task request by suspending the low-priority service processing logic on the resource node and distributing the request task to the resource node for operation.
And step 209, the RPC module receives the call result returned by the RPC Proxy module and performs deserialization unpacking operation on the call result.
It should be noted that, when the RPC is running, the deserialization unpacking operation is performed after waiting for the RPC Proxy result response.
The foregoing is an embodiment of a micro-service RPC adaptive scheduling method provided in this embodiment, and the following is an embodiment of a micro-service RPC adaptive scheduling system provided in this embodiment.
Referring to fig. 3, in an embodiment of the present application, a micro-service RPC adaptive scheduling system includes:
the RPC module is used for selecting a corresponding preset communication mode according to the type of the data to be called during operation, dyeing the head of the data to be called, performing packet serialization operation on the data to be called, and then sending the data to the RPC Proxy module;
the RPC Proxy module is used for responding to the request of the RPC module, setting the position of the data to be called in the queue to be sent according to the priority weight of the request, and updating the request priority weight of the calling data in the queue to be sent according to a preset weight updating time interval;
judging whether the RPC service is in an operating state, if so, executing a step S1, otherwise, returning information of no available service to the RPC module;
s1, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit or not, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain a load weight factor;
s2, sorting the load weight factors, and selecting the optimal load weight factor to set RPC service routing information;
and S3, based on the position of the data to be called in the queue to be sent, calling the resource nodes in the RPC service resource pool according to the RPC service routing information, and returning the calling result to the RPC module according to the priority weight of the data to be called.
Further, the embodiment of the present application further provides a micro-service RPC adaptive scheduling device, where the device includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is used for executing the micro-service RPC adaptive scheduling method according to the method embodiment according to the instruction in the program code.
Further, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used to store program codes, and the program codes are used to execute the micro-service RPC adaptive scheduling method described in the foregoing method embodiment.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (10)
1. A micro-service RPC adaptive scheduling method is characterized by being applied to an RPC adaptive scheduling system composed of an RPC module, an RPC Proxy module and an RPC service resource pool, and comprising the following steps:
when the RPC module runs, selecting a corresponding preset communication mode according to the type of data to be called, dyeing the head of the data to be called, packaging and serializing the data to be called, and then sending the data to the RPC Proxy module;
the RPC Proxy module responds to a request of the RPC module, sets the position of the data to be called in a queue to be sent according to the priority weight of the request, and updates the request priority weight of the calling data in the queue to be sent according to a preset weight updating time interval;
the RPC Proxy module judges whether the RPC service is in a running state, if so, the step S1 is executed, otherwise, the information of no available service is returned to the RPC module;
s1, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit or not, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain a load weight factor;
s2, sorting the load weight factors, and selecting the optimal load weight factor to set RPC service routing information;
and S3, based on the position of the data to be called in the queue to be sent, calling the resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module according to the priority weight of the data to be called.
2. The micro-service RPC adaptive scheduling method of claim 1, further comprising:
when the request of the RPC module is a priority preemption request and a resource node is not obtained, the RPC Proxy module suspends a call service corresponding to a first request, wherein the priority weight of the first request is lower than that of the priority preemption request;
and according to the RPC service routing information, calling resource nodes in the RPC service resource pool, and returning a calling result to the RPC module.
3. The micro-service RPC adaptive scheduling method of claim 2, further comprising: and the RPC module receives the call result returned by the RPC Proxy module, and performs deserialization unpacking operation on the call result.
4. The micro-service RPC adaptive scheduling method of claim 1, wherein the performing dimension reduction on the load information by PCA to obtain the load weight factor specifically comprises:
constructing a matrix with n rows and m columns according to the load information, wherein n is the dimension of the load information, and m is the number of the load information;
after zero averaging is carried out on the incoming line of the matrix, solving to obtain a covariance matrix;
solving the eigenvalue of the covariance matrix and the corresponding eigenvector;
and arranging the eigenvectors into a first matrix from top to bottom according to the size of the corresponding eigenvalue, and taking the front k rows to form a second matrix to obtain a load weight factor, wherein n, m and k are positive integers.
5. The method for adaptive scheduling of micro-service RPC as claimed in claim 1, wherein the selecting of the corresponding preset communication mode according to the type of the data to be called specifically comprises:
the types of the data to be called comprise: the system comprises reliable data, unreliable data, streaming data and time sensitive data, wherein a preset communication mode corresponding to the reliable data is TCP, a preset communication mode corresponding to the unreliable data is UDP, a preset communication mode corresponding to the streaming data is QUIC, and a preset communication mode of the time sensitive data is KCP;
and setting the prior communication mode as http, so as to construct the corresponding relation between the data to be called and the communication mode, and enabling the RPC module to select the corresponding communication mode according to the type of the data to be called based on the corresponding relation.
6. The micro-service RPC adaptive scheduling method of claim 2, wherein the updating the request priority weight of the call data in the queue to be sent according to the preset weight update time interval specifically comprises:
setting the request priority weight to be composed of a priority preemption weight and a message blocking factor weight;
updating the message blocking factor weight based on a message blocking factor weight calculation formula, thereby updating the request priority weight;
wherein, the message blocking factor weight calculation formula is as follows:
Q=ΔtnB;
in the formula, Q is a low 16-bit blocking weight factor, Δ tn is the number of message blocking time intervals, B is a weight operator and is defined as arctan (X × δ) × 65535 × 2/π, wherein δ is a message blocking factor coefficient, and X is an arbitrary input parameter.
7. A micro-service RPC adaptive scheduling system is characterized by comprising:
the RPC module is used for selecting a corresponding preset communication mode according to the type of the data to be called during operation, dyeing the head of the data to be called, performing packet serialization operation on the data to be called, and then sending the data to the RPC Proxy module;
the RPC Proxy module is used for responding to a request of the RPC module, setting the position of the data to be called in the queue to be sent according to the priority weight of the request, and updating the request priority weight of the calling data in the queue to be sent according to a preset weight updating time interval;
judging whether the RPC service is in an operating state, if so, executing a step S1, otherwise, returning information of no available service to the RPC module;
s1, judging whether the difference value between the timestamp of the host load information and the current timestamp is out of limit or not, if so, predicting the load information through a Markov process, and performing dimensionality reduction on the load information through PCA to obtain a load weight factor, otherwise, performing dimensionality reduction on the load information through PCA to obtain a load weight factor;
s2, sorting the load weight factors, and selecting the optimal load weight factor to set RPC service routing information;
and S3, based on the position of the data to be called in the queue to be sent, calling the resource nodes in the RPC service resource pool according to the RPC service routing information, and returning a calling result to the RPC module according to the priority weight of the data to be called.
8. The micro-service RPC adaptive scheduling system of claim 7, wherein the RPC Proxy module is further configured to:
when the request of the RPC module is a priority preemption request and a resource node is not obtained, suspending a call service corresponding to a first request, wherein the priority weight of the first request is lower than that of the priority preemption request;
and according to the RPC service routing information, calling resource nodes in the RPC service resource pool, and returning a calling result to the RPC module.
9. A micro-service RPC adaptive scheduling device, the device comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the micro-service RPC adaptive scheduling method of any of claims 1-6 according to instructions in the program code.
10. A computer readable storage medium for storing program code for performing the micro-service RPC adaptive scheduling method of any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111071037.XA CN113742111B (en) | 2021-09-13 | 2021-09-13 | Micro-service RPC adaptive scheduling method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111071037.XA CN113742111B (en) | 2021-09-13 | 2021-09-13 | Micro-service RPC adaptive scheduling method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113742111A true CN113742111A (en) | 2021-12-03 |
CN113742111B CN113742111B (en) | 2023-01-13 |
Family
ID=78738417
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111071037.XA Active CN113742111B (en) | 2021-09-13 | 2021-09-13 | Micro-service RPC adaptive scheduling method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113742111B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114301875A (en) * | 2021-12-21 | 2022-04-08 | 锐捷网络股份有限公司 | Management and control method and device for DHCP proxy side and electronic equipment |
CN114915663A (en) * | 2022-03-21 | 2022-08-16 | 北京沃东天骏信息技术有限公司 | Request response method, device, system, electronic equipment and medium |
WO2024085969A1 (en) * | 2022-10-17 | 2024-04-25 | Intel Corporation | Microservice deployments using accelerators |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109618002A (en) * | 2019-01-11 | 2019-04-12 | 武汉斗鱼鱼乐网络科技有限公司 | A kind of micro services gateway optimization method, device and storage medium |
CN112437147A (en) * | 2020-11-19 | 2021-03-02 | 浙江大学滨海产业技术研究院 | Micro-service load balancing optimal routing algorithm, device, equipment and medium |
-
2021
- 2021-09-13 CN CN202111071037.XA patent/CN113742111B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109618002A (en) * | 2019-01-11 | 2019-04-12 | 武汉斗鱼鱼乐网络科技有限公司 | A kind of micro services gateway optimization method, device and storage medium |
CN112437147A (en) * | 2020-11-19 | 2021-03-02 | 浙江大学滨海产业技术研究院 | Micro-service load balancing optimal routing algorithm, device, equipment and medium |
Non-Patent Citations (1)
Title |
---|
冯径等: "应用层通信任务调度模型", 《东南大学学报(自然科学版)》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114301875A (en) * | 2021-12-21 | 2022-04-08 | 锐捷网络股份有限公司 | Management and control method and device for DHCP proxy side and electronic equipment |
CN114915663A (en) * | 2022-03-21 | 2022-08-16 | 北京沃东天骏信息技术有限公司 | Request response method, device, system, electronic equipment and medium |
WO2024085969A1 (en) * | 2022-10-17 | 2024-04-25 | Intel Corporation | Microservice deployments using accelerators |
Also Published As
Publication number | Publication date |
---|---|
CN113742111B (en) | 2023-01-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113742111B (en) | Micro-service RPC adaptive scheduling method and related device | |
EP1472846B1 (en) | Method and apparatus for web farm traffic control | |
Zhang et al. | Online adaptive interference-aware VNF deployment and migration for 5G network slice | |
Qi et al. | Spright: Extracting the server from serverless computing! high-performance ebpf-based event-driven, shared-memory processing | |
US6766348B1 (en) | Method and system for load-balanced data exchange in distributed network-based resource allocation | |
US5504894A (en) | Workload manager for achieving transaction class response time goals in a multiprocessing system | |
US9092269B2 (en) | Offloading virtual machine flows to physical queues | |
US7076545B2 (en) | Load balancing the servicing of received packets | |
Boukerche et al. | A task-centric mobile cloud-based system to enable energy-aware efficient offloading | |
CN110221920B (en) | Deployment method, device, storage medium and system | |
Szalay et al. | Real-time faas: Towards a latency bounded serverless cloud | |
CN116032767A (en) | Intelligent fusion identification network-oriented computing power service chain management and control system architecture | |
CN101114984A (en) | Multithreading network load control method | |
Shifrin et al. | Optimal control of VNF deployment and scheduling | |
Staffolani et al. | RLQ: Workload allocation with reinforcement learning in distributed queues | |
Jyothi et al. | Towards An Application {Objective-Aware} Network Interface | |
CN111752728B (en) | Message transmission method and device | |
CN117076133B (en) | Cloud game platform heterogeneous resource allocation method, computer device and storage medium | |
Pakhrudin et al. | Cloud service analysis using round-robin algorithm for quality-of-service aware task placement for internet of things services | |
US7693988B2 (en) | Subject/observer update control method and apparatus | |
Wang | Resource management for Edge computing systems | |
Sang et al. | A simulation testbed based on lightweight processes | |
US20230110930A1 (en) | Method and system for multi-core load scheduling in an operating system (os) less communication network | |
Li | Algorithm Design for Kubernetes Load Saturation Scheduling in Deep Learning | |
US20230007102A1 (en) | Request scheduling |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |