Remote procedure calling method and device, computer equipment, system and storage medium
By obtaining and analyzing the operating index data of the nodes provided by the service, selecting the node with the largest load balancing weight value to process the request, and using the machine learning model to perform load prediction and resource adjustment, the problem of poor load balancing in the existing technology is solved and improved Resource utilization and service stability.
Patent Information
- Application Number
- CN202411132415.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-24
AI Technical Summary
When the performance differences between service provider nodes are large, the existing load balancing methods lead to poor load balancing effects in the service cluster and low resource utilization rate.
By obtaining the operation index data of each service provider node, determining its load balancing weight value, and selecting the node with the largest load balancing weight value to process service requests, and using a pre-trained machine learning model to perform load prediction and resource configuration adjustment.
It improves load balancing effect and resource utilization, prioritizes the allocation of service requests to service provider nodes with better performance, and improves service stability and availability.
Smart Images

Figure CN119179587A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a remote procedure call method, apparatus, computer equipment, system and storage medium. Background Art
[0002] In application scenarios such as microservices and distributed systems, Remote Procedure Call (RPC) technology is widely used for remote calls between service provider nodes. Through RPC, different modules or services in a distributed system can be connected to achieve cross-process or cross-computer communication and collaboration. As the scale of service clusters continues to expand, load balancing strategies are usually used to select a target service provider node from multiple service provider nodes on the remote end to process client service requests.
[0003] However, existing load balancing methods, such as random weight method, hash method or polling method, select the target service provider node based on a simple algorithm. When the performance difference between service provider nodes is large, the load balancing effect of the entire service cluster is poor and the resource utilization rate is low. Summary of the invention
[0004] Based on this, it is necessary to provide a remote procedure call method, apparatus, computer equipment, system and storage medium that can improve load balancing effect and resource utilization in response to at least one of the above technical problems.
[0005] In a first aspect, an embodiment of the present disclosure provides a remote procedure call method, which may include the following steps:
[0006] Obtain the operating indicator data of each service provider node;
[0007] Determine the load balancing weight value of each service provider node based on the operating indicator data of each service provider node;
[0008] In response to the first remote call service request, selecting a service providing node with the largest load balancing weight value from each service providing node as a target service providing node;
[0009] A first remote service invocation request is sent to a target service providing node, so that the target service providing node processes the first remote service invocation request.
[0010] Among them, the operating indicator data includes CPU usage, memory occupancy, request response time and occupied memory space. The load balancing weight value is positively correlated with the performance status of the service provider node.
[0011] In some embodiments, the remote procedure call method may further include the following steps:
[0012] Obtain the load prediction data of each service provider node, input the load prediction data into a pre-trained machine learning model, obtain the load prediction weight value of each service provider node, and adjust the resource configuration of each service provider node according to the load prediction weight value of each service provider node.
[0013] The pre-trained machine learning model is trained by multiple sample data of each service provider node, and the sample data includes multiple sets of load balancing weight values and load prediction data corresponding to the load balancing weight values. The load prediction data includes environmental data, system event data, traffic data, and user behavior data.
[0014] In some embodiments, the remote procedure call method may further include the following steps:
[0015] Before obtaining the operating indicator data of each service provider node, determine the current state of each service provider node. When the current state of each service provider node is the initialization state, in response to the second remote call service request, use the load prediction weight value of each service provider node as the load balancing weight value to determine the target service provider node.
[0016] Acquiring the operation index data of each service providing node may include the steps of: acquiring the operation index data of each service providing node when the current state of each service providing node is a non-initialized state.
[0017] In some embodiments, the environmental data includes temperature and humidity values of the environment in which the server corresponding to the service providing node is located.
[0018] System event data includes system event type, event ID, and event level.
[0019] Traffic data refers to the network traffic of the service provider node.
[0020] User behavior data includes user access path, visit duration and visit frequency.
[0021] In some embodiments, determining the load balancing weight value of each service providing node according to the operation indicator data of each service providing node may include the following steps:
[0022] According to the corresponding relationship between the operation indicator data and the preset score, a plurality of operation indicator scores corresponding to each operation indicator data are determined, and the load balancing weight value is determined according to the plurality of operation indicator scores.
[0023] Among them, the preset score correspondence is used to represent the correspondence between different interval range values of each operating indicator data and the operating indicator scores. The multiple operating indicator scores include a CPU score corresponding to CPU usage, a first memory score corresponding to memory occupancy, a response score corresponding to request response time, and a second memory score corresponding to occupied content space.
[0024] In some embodiments, the remote procedure call method may further include the following steps:
[0025] An outlier detection is performed on the first remote call service request according to a preset machine learning algorithm, abnormal request data present in the first remote call service request is determined, and the abnormal request data is intercepted.
[0026] In a second aspect, an embodiment of the present disclosure provides a remote procedure call device, which may include an indicator data acquisition module, a weight value determination module, a call response module and a request sending module.
[0027] The indicator data acquisition module is used to periodically obtain the operating indicator data of each service provider node, where the operating indicator data includes CPU usage, memory occupancy, request response time, and occupied memory space.
[0028] The weight value determination module is used to determine the load balancing weight value of each service providing node according to the operation indicator data of each service providing node. The load balancing weight value is positively correlated with the performance status of the service providing node.
[0029] The call response module is used to select a service providing node with the largest load balancing weight value from each service providing node as a target service providing node in response to the first remote call service request.
[0030] The request sending module is used to send a first remote service call request to a target service providing node, so that the target service providing node processes the first remote service call request.
[0031] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the remote procedure call method provided in any embodiment of the present disclosure in the first aspect are implemented.
[0032] In a fourth aspect, an embodiment of the present disclosure provides a computer system, the system comprising a client and a service provider.
[0033] The client is a computer device provided in any embodiment of the third aspect of the present disclosure.
[0034] The service provider includes multiple service provider nodes, which are used to process remote call service requests sent by the client.
[0035] In some embodiments, the computer system may further include: a remote procedure call configuration center, the remote procedure call configuration center is used for operators to dynamically configure the interface method, input parameters and output parameters of the service provider.
[0036] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the remote procedure call method provided in any embodiment of the present disclosure in the first aspect.
[0037] The above-mentioned remote procedure call method, device, computer equipment, system and storage medium obtain the operating indicator data of each service provider node, determine the load balancing weight value according to the operating indicator data, and select the target service provider node for receiving and processing the first remote call service request based on the load balancing weight value. The load balancing weight value can be used to determine the target service provider node with better performance status from multiple service provider nodes, and then send the first remote call service request to the target service provider node for processing. It can give priority to allocating service requests to high-performance service provider nodes, thereby improving the load balancing effect and resource utilization of the service provider. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A diagram of an application environment of a remote procedure call method in some embodiments;
[0039] Figure 2 A schematic diagram of a flow chart of a remote procedure call method in some embodiments;
[0040] Figure 3 A schematic diagram of a flow chart of steps for adjusting service providing node resources in some embodiments;
[0041] Figure 4 Schematic diagram of a flow chart of a remote procedure call method in some other embodiments;
[0042] Figure 5 It is a structural block diagram of a remote procedure call device in some embodiments;
[0043] Figure 6 is an internal structure diagram of a computer device in some embodiments;
[0044] Figure 7 1 is a diagram of the internal structure of a computer system in some embodiments. DETAILED DESCRIPTION
[0045] In order to make the technical solutions and advantages of the present disclosure more clearly understood, the embodiments of the present disclosure and related technical contents are further described in detail below in combination with the accompanying drawings and text descriptions. It should be understood that the implementation methods described below are only used to explain the technical solutions of the embodiments of the present disclosure, and are not used to limit more possible implementation methods of the present disclosure.
[0046] It should be noted that the relational terms such as "first", "second" and the like appearing in this document are only used to distinguish things, states or actions, and do not necessarily indicate or imply relative importance or sequential relationships. The terms "include", "comprises" or any other variants thereof are used to indicate non-exclusive inclusion, and the included objects may not be limited to the objects listed in this document. The term "plurality" or other variants are used to indicate that the number of objects is two or more.
[0047] In a first aspect, an embodiment of the present disclosure provides a remote procedure call method. The method can be applied to Figure 1 In the application environment shown. Among them, the client 101 can communicate with the service provider 102 through the network. The client 101 can be various terminal devices or personal computers, laptops, smart phones, tablet computers and portable wearable devices. The client 101 installs or runs a client program with an RPC framework, which is responsible for sending remote procedure call requests to the service provider and receiving the results returned by the service provider. The service provider 102 can be a server cluster, including multiple service provider nodes. The service provider 102 runs a server program with an RPC framework, which is used to monitor remote procedure call service requests from the client 101 and call the corresponding service interface according to the request.
[0048] Among them, Remote Procedure Call (RPC) is a programming model and communication protocol widely used in distributed computing environments. It allows a program (a program in the client 101) to call a procedure or function in another address space (usually a program on another computer, i.e., a program in the service provider 102) like calling a local method.
[0049] In related technologies, the RPC calling process may include the following steps:
[0050] Step 1: The program in the client 101 initiates a method call request and transmits the method call request to the remote service provider 102 through the network;
[0051] Step 2: The service provider 102 receives the request from the client 101, parses the method call and parameter information in the request, and executes the corresponding method in its own process or computer according to the method call and parameters in the request;
[0052] Step 3: The service provider 102 packages the result of the method execution and sends it back to the client 101 via the network;
[0053] Step 4: The client 101 receives the result returned by the service provider 102, and parses and processes it.
[0054] Remote procedure call method is applied to Figure 1 The client 101 in FIG. 1 is taken as an example to illustrate, in some embodiments, Figure 2 As shown, the remote procedure call method includes steps S201 to S204 that can be executed by the client 101. Each step is described below.
[0055] Step S201: Acquire the operation indicator data of each service providing node.
[0056] The operating indicator data includes CPU usage, memory usage, request response time, and occupied memory space.
[0057] Specifically, the client 101 may obtain the operating indicator data of each service providing node at a scheduled time or at irregular intervals based on a specific trigger event. In the case of scheduled acquisition, the acquisition time period may be 10 seconds, 60 seconds, 300 seconds, or other time intervals. The client 101 may obtain the operating indicator data of each service providing node actively or passively, and there is no particular limitation here.
[0058] The operation indicator data can be obtained by each service provider node sending its heartbeat information to the client 101 through a heartbeat mechanism, in which the heartbeat information includes the operation indicator data of the service provider node. The operation indicator data can also be collected from each service provider node and then sent to the client 101 through an additional service monitoring system or service monitoring program.
[0059] Step S202: Determine the load balancing weight value of each service providing node according to the operation indicator data of each service providing node.
[0060] The load balancing weight value is calculated from the operation index data and is used to represent the performance status of the service providing node. The load balancing weight value of the service providing node is positively correlated with its performance status. The larger the load balancing weight value, the better the performance status of the service providing node.
[0061] Specifically, the client 101 calculates the load balancing weight value of each service providing node according to the CPU usage, memory occupancy, request response time and occupied memory space of each service providing node and according to a preset load balancing strategy.
[0062] In some specific embodiments, the preset load balancing strategy can be to convert the operation index data into scores respectively, obtain the scores of the operation index data of the service providing node, perform calculation processing, and obtain the load balancing weight value. In some other specific embodiments, the preset load balancing strategy can be a set of calculation formulas, and the operation index data of the service providing node are brought into the formula for calculation to obtain the load balancing weight value. There is no special limitation on the preset load balancing strategy, and those skilled in the art can set it according to actual needs.
[0063] Step S203: In response to the first remote service call request, a service providing node with the largest load balancing weight value is selected from each service providing node as a target service providing node.
[0064] The first remote call service request may be a service request automatically initiated by a specific program in the client 101, or may be a service request initiated based on a user's operation. Specifically, the first remote call service request may be a service request constructed with the method name, parameter information, and optional metadata that the client 101 needs to call. The first remote call service request may also include the client IP address, front-end and back-end mapping relationship, the version number of the calling interface, user login information, etc.
[0065] Specifically, when initiating the first remote service call request, the client 101 responds to the first remote service call request and selects a service providing node with the largest load balancing weight value from multiple service providing nodes as the target service providing node according to the load balancing weight value.
[0066] Step S204: Sending a first remote service invocation request to a target service providing node, so that the target service providing node processes the first remote service invocation request.
[0067] The client 101 sends the first remote service call request to the target service providing node. After receiving the first remote service call request, the target service providing node calls the corresponding interface to process the service request.
[0068] In some specific embodiments, after receiving the first remote call service request, the target service provider node parses the service request, which may be deserialization to obtain the method name, parameter information and metadata contained in the service request, calls the response interface or method based on the information obtained from the analysis, performs business processing to obtain results, and returns the results to the client 101.
[0069] In some specific embodiments, an RPC calling program runs in the client 101 and is used to send the first remote calling service request to the service provider 102 .
[0070] In the above-mentioned remote procedure call method, by obtaining the operating indicator data of each service provider node, the load balancing weight value is determined according to the operating indicator data, and the target service provider node for receiving and processing the first remote call service request is selected based on the load balancing weight value. The load balancing weight value can be used to determine the target service provider node with better performance status from multiple service provider nodes, and then the first remote call service request is sent to the target service provider node for processing. Service requests can be preferentially allocated to high-performance service provider nodes, thereby improving the load balancing effect and improving the resource utilization of the service provider end.
[0071] At the same time, when the operation indicator data is obtained in a regular manner, the performance status of each service provider node can be determined in a timely manner, and service providers with insufficient performance can be found for optimization, thereby improving the stability and availability of the service provider node operation. Based on the regularly obtained operation indicator data, the load balancing weight value of each service provider node is dynamically updated to achieve adaptive adjustment of the load balancing weight value.
[0072] In some embodiments, when there are multiple target service providing nodes with the same load balancing weight value, any target service providing node can be determined from the multiple target service providing nodes to process the first remote call service request based on a random weight method, a hash method, or a polling method.
[0073] In some embodiments, Figure 3 As shown, the remote procedure call method may further include steps S301 to S303. Each step is described below.
[0074] Step S301: Obtain load prediction data of each service providing node.
[0075] Load prediction data includes environmental data, system event data, traffic data, and user behavior data.
[0076] In some embodiments, the environmental data may include the temperature and humidity of the environment in which the server corresponding to the service providing node is located. The environmental data may be acquired through a pre-set sensor device.
[0077] System event data may include system event type, event ID and event level. Specifically, it may be data on events such as software updates, hardware maintenance or system errors occurring at service provider nodes, which can be obtained through log files or monitoring tools.
[0078] Traffic data can be the network traffic of the service provider node, which can be used to reflect the network communication between the service provider node and other nodes, and can include traffic request size, response time, network bandwidth utilization, and number of requests, etc. Traffic data can be monitored and recorded between service provider nodes through preset traffic monitoring tools and network analysis equipment.
[0079] User behavior data may include user access paths, access duration, and access frequency. User behavior data may be a record of user operation behavior on the client, or it may be user operation behavior data on the service provider node. Specifically, user behavior data may be obtained by analyzing the log files of the server where the service provider node is located, or it may be obtained through other third-party data sources.
[0080] Step S302: Input the load prediction data into a pre-trained machine learning model to obtain the load prediction weight value of each service providing node.
[0081] The pre-trained machine learning model is obtained by training multiple sample data of each service provider node, and the sample data includes multiple groups of load balancing weight values and load prediction data corresponding to the load balancing weight values.
[0082] In some specific embodiments, the remote procedure call method may also include: while obtaining the operating indicator data of each service provider node, synchronously obtaining the load prediction data corresponding to each service provider node, and integrating the load prediction data with the load balancing weight value determined according to the operating indicator data into a set of sample data for storage.
[0083] Step S303: adjusting the resource configuration of each service providing node according to the load prediction weight value of each service providing node.
[0084] Specifically, when the load prediction weight value indicates that the future performance state of a specific service providing node is poor, the resource configuration of the specific service providing node can be adjusted to improve its performance state. The resource configuration to be adjusted may include the service providing node CPU resources, memory resources, storage resources, network resources or other resource configuration items that affect the performance state of the service providing node.
[0085] Since the load prediction weight value of each service provider node can represent the future performance status of the service provider node, by dynamically adjusting the resource configuration of the service provider node according to the load prediction weight value, system resource allocation can be realized in advance, further improving the utilization of system resources.
[0086] In some specific embodiments, the remote procedure call method may also include the following steps: during the operation of each service provider node, the machine learning model is updated according to the updated load balancing weight value and the acquired load prediction data, and the load prediction data is input into the updated machine learning model to obtain the load prediction weight value of each service provider node.
[0087] In some specific embodiments, the remote procedure call method may further include a data preprocessing step, in which the operation indicator data or the load forecast data is segmented into time series by a time series segmentation technique to analyze the periodic trend thereof.
[0088] In some embodiments, Figure 4 As shown, the remote procedure call method may further include step S401, step S402 and step S403.
[0089] Step S401: before acquiring the operation indicator data of each service providing node, determine the current status of each service providing node.
[0090] Step S402: when the current state of each service providing node is the initialization state, in response to the second remote call service request, the load prediction weight value of each service providing node is used as the load balancing weight value to determine the target service providing node.
[0091] Step S403: when the current state of each service providing node is a non-initialized state, obtaining the operation indicator data of each service providing node.
[0092] After step S403 is executed, steps S202 to S204 are further executed.
[0093] The initialization state indicates that the service providing node is in a state after initialization but has not yet started running. Correspondingly, in the initialization state, the running index data of the service providing node is reset to zero due to the initialization operation, and the client 101 cannot obtain the running index data of each service providing node. Therefore, when the current state of each service providing node is the initialization state, in response to the second remote call service request, the load prediction weight value of each service providing node is used as the load balancing weight value to determine the target service providing node.
[0094] The non-initialized state indicates that the service provider node is in a stable operating state, and the operating indicator data of the service provider node can be obtained.
[0095] In some embodiments, step S202 may include the following steps: determining a plurality of operation indicator scores corresponding to each operation indicator data one by one according to the correspondence between the operation indicator data and the preset scores, and determining a load balancing weight value according to the plurality of operation indicator scores.
[0096] The operating indicator data include CPU usage, memory usage, request response time, and occupied memory space.
[0097] The preset score correspondence is used to represent the correspondence between different interval range values of each operating indicator data and the operating indicator scores. The multiple operating indicator scores include a CPU score corresponding to CPU usage, a first memory score corresponding to memory occupancy, a response score corresponding to request response time, and a second memory score corresponding to occupied content space.
[0098] In some specific embodiments, the preset score correspondence relationship may be in the form of a correspondence table, as shown in Table 1, and the preset score correspondence relationship may be:
[0099] Table 1:
[0100]
[0101]
[0102] Specifically, according to the correspondence between the operating indicator data and the preset scores, the CPU score corresponding to the CPU usage rate, the first memory score corresponding to the memory occupancy rate, the response score corresponding to the request response time, and the second memory score corresponding to the occupied content space can be determined respectively, and then multiple operating indicator scores (i.e., the CPU score, the first memory score, the response score, and the second memory score) are calculated and processed to obtain the load balancing weight value of the service provider node corresponding to the group of operating indicator data.
[0103] In some specific embodiments, multiple operation indicator scores may be accumulated to obtain a load balancing weight value. A higher load balancing weight value indicates a better performance status of the service provider node corresponding to the load balancing weight value.
[0104] In some embodiments, the remote procedure call method may further include the following steps: performing outlier detection on the first remote call service request according to a preset machine learning algorithm, determining abnormal request data present in the first remote call service request, and intercepting the abnormal request data.
[0105] Among them, abnormal request data may include request data corresponding to illegal operations or abnormal operation events such as interface abnormality, IP abnormality, response time abnormality, etc.
[0106] In some specific embodiments, the preset machine learning algorithm may be a clustering algorithm, an isolation forest algorithm, or other machine learning algorithms that can perform anomaly detection.
[0107] By detecting abnormal request data in remote call service requests through a preset machine learning algorithm and processing the abnormal request data, the security and stability of the remote procedure call method can be improved.
[0108] It should be understood that although Figure 2-4 The steps in the flowchart are displayed in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Figure 2-4 Unless otherwise specified herein, the steps shown and the steps involved in other embodiments are not strictly limited in order of execution, and the steps can be executed in other orders. Moreover, at least a part of the steps in the aforementioned embodiments may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0109] In a second aspect, an embodiment of the present disclosure provides a remote procedure call device, such as Figure 5 As shown, the remote procedure call device 500 may include: an indicator data acquisition module 501, a weight value determination module 502, a call response module 503 and a request sending module 504. Each module is described below.
[0110] The indicator data acquisition module 501 is used to acquire the operation indicator data of each service providing node, wherein the operation indicator data includes CPU usage, memory occupancy, request response time and occupied memory space.
[0111] The weight value determination module 502 is used to determine the load balancing weight value of each service providing node according to the operation index data of each service providing node. The load balancing weight value is positively correlated with the performance status of the service providing node.
[0112] The call response module 503 is used to select a service providing node with the largest load balancing weight value from each service providing node as a target service providing node in response to the first remote call service request.
[0113] The request sending module 504 is used to send a first remote service invocation request to a target service providing node, so that the target service providing node can process the first remote service invocation request.
[0114] In some embodiments, the remote procedure call apparatus 500 may further include a prediction data acquisition module, a future load prediction module, and a resource adjustment module.
[0115] The prediction data acquisition module is used to obtain the load prediction data of each service providing node. The load prediction data includes environmental data, system event data, flow data and user behavior data.
[0116] The future load prediction module is used to input the load prediction data into the pre-trained machine learning model to obtain the load prediction weight value of each service provider node.
[0117] The resource adjustment module is used to adjust the resource configuration of each service providing node according to the load prediction weight value of each service providing node.
[0118] Among them, the pre-trained machine learning model is obtained by training multiple sample data of each service provider node, and the sample data includes multiple groups of load balancing weight values and load prediction data corresponding to the load balancing weight values.
[0119] In some embodiments, the remote procedure call apparatus 500 may further include a node status determination module and a target service node determination module.
[0120] The node status judgment module is used to judge the current status of each service providing node before obtaining the operation indicator data of each service providing node.
[0121] The target service node determination module is used to determine the target service node by using the load prediction weight value of each service providing node as the load balancing weight value in response to the second remote call service request when the current state of each service providing node is the initialization state.
[0122] The indicator data acquisition module 501 is further used to acquire the operation indicator data of each service providing node when the current state of each service providing node is a non-initialized state.
[0123] In some embodiments, the weight value determination module 502 may include an operation indicator score determination unit and a load balancing weight value determination unit.
[0124] The operation index score determination unit is used to determine a plurality of operation index scores corresponding to each operation index data one by one according to the corresponding relationship between the operation index data and the preset scores.
[0125] The load balancing weight value determining unit is used to determine the load balancing weight value according to multiple operation indicator scores.
[0126] The preset score correspondence is used to represent the correspondence between different interval range values of each operating indicator data and the operating indicator scores. The multiple operating indicator scores include a CPU score corresponding to CPU usage, a first memory score corresponding to memory occupancy, a response score corresponding to request response time, and a second memory score corresponding to occupied content space.
[0127] In some embodiments, the remote procedure call device 500 may also include an anomaly detection and processing module for performing anomaly detection on the first remote call service request according to a preset machine learning algorithm, determining abnormal request data present in the first remote call service request, and intercepting the abnormal request data.
[0128] For more specific limitations on the remote procedure call device 500, please refer to the limitations on the remote procedure call method above. The remote procedure call device can also be used to execute more steps of the remote procedure call method in the embodiment of the present disclosure, which will not be repeated here. Each module in the above remote procedure call device 500 can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0129] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the remote procedure call method provided in any embodiment of the present disclosure in the first aspect when executing the computer program.
[0130] In some embodiments, the computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the remote procedure call method in any embodiment of the present invention is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0131] Those skilled in the art will understand that Figure 6The structure shown in the figure is merely a block diagram of a partial structure related to the embodiment scheme of the present disclosure, and does not constitute a limitation on the computer device to which the embodiment scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] In a fourth aspect, an embodiment of the present disclosure provides a computer system, which can be as follows: Figure 7 As shown, the computer system 700 may include a client 710 and a service provider 720, wherein the client 710 may be a computer device provided in any embodiment of the third aspect of the present disclosure.
[0133] The service provider 720 may include multiple service provider nodes ( 721 , 722 , 723 ) for processing the remote call service request sent by the client 710 .
[0134] In some specific embodiments, the service provider may be a server or a server cluster, and the multiple service provider nodes may be service nodes corresponding to a physical device or may be multiple virtual service nodes virtualized from one physical device.
[0135] In some embodiments, the computer system 700 may further include a remote procedure call configuration center for allowing operators to dynamically configure the interface methods, input parameters, and output parameters of the service provider.
[0136] In some specific embodiments, the remote procedure call configuration center is a visual configuration center, which allows operators to configure the interface methods, input parameters, and output parameters of each service providing node of the service providing end in the corresponding configuration interface, so that when the client calls the service providing node to process the remote call service request, it can call the latest interface method and verify the remote call service request by updating the configured input parameters and output parameters. Compared with the traditional configuration center, it can improve the flexibility and scalability of the system.
[0137] In some specific embodiments, the remote procedure call configuration center is deployed in an independent computer device or a server cluster. When each service provider node of the service provider end 720 is started, the service information, including the address, port, version, etc. of the service, is registered with the remote procedure call configuration center, so that the client can query the location information of each service provider node through the remote procedure call configuration center to send and process remote call service requests.
[0138] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the remote procedure call method provided in any embodiment of the present disclosure in the first aspect.
[0139] The computer readable storage medium may be Figure 6 A computer-readable storage medium in the computer device shown.
[0140] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The aforementioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments of the present disclosure may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0141] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present disclosure.
[0142] The above embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the protection scope of the present disclosure. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A remote procedure call method, characterized in that: The method comprises: Obtaining the operating indicator data of each service providing node, wherein the operating indicator data includes CPU usage, memory occupancy, request response time, and occupied memory space; Determine a load balancing weight value of each service providing node according to the operation indicator data of each service providing node, wherein the load balancing weight value is positively correlated with the performance status of the service providing node; In response to the first remote call service request, selecting a service providing node with the largest load balancing weight value from the service providing nodes as a target service providing node; The first remote invocation service request is sent to the target service providing node, so that the target service providing node processes the first remote invocation service request.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining load prediction data of each service providing node, wherein the load prediction data includes environmental data, system event data, traffic data, and user behavior data; Inputting the load prediction data into a pre-trained machine learning model to obtain a load prediction weight value of each service providing node; Adjusting resource configuration of each service providing node according to the load prediction weight value of each service providing node; Among them, the pre-trained machine learning model is obtained by training with multiple sample data of each service providing node, and the sample data includes multiple groups of load balancing weight values and load prediction data corresponding to the load balancing weight values.
3. The method according to claim 2, characterized in that The method further comprises: Before obtaining the operation indicator data of each service providing node, determining the current state of each service providing node; When the current state of each service providing node is an initialization state, in response to a second remote call service request, the load prediction weight value of each service providing node is used as a load balancing weight value to determine the target service providing node; The acquiring of the operation index data of each service providing node includes: when the current state of each service providing node is a non-initialized state, acquiring the operation index data of each service providing node.
4. The method according to claim 2, characterized in that: The environmental data includes the temperature and humidity of the environment in which the server corresponding to the service providing node is located; The system event data includes system event type, event ID and event level; The traffic data is the network traffic of the service providing node; The user behavior data includes user access path, access dwell time and access frequency.
5. The method according to claim 1, characterized in that Determining the load balancing weight value of each service providing node according to the operation indicator data of each service providing node includes: According to the corresponding relationship between the operating indicator data and the preset scores, a plurality of operating indicator scores corresponding to each of the operating indicator data are determined; Determining the load balancing weight value according to the multiple operation indicator scores; Among them, the preset score correspondence is used to represent the correspondence between different interval range values of the various operating indicator data and the operating indicator scores, and the multiple operating indicator scores include a CPU score corresponding to the CPU usage rate, a first memory score corresponding to the memory occupancy rate, a response score corresponding to the request response time, and a second memory score corresponding to the occupied content space.
6. The method according to claim 1, characterized in that The method further comprises: Performing outlier detection on the first remote call service request according to a preset machine learning algorithm to determine abnormal request data present in the first remote call service request; The abnormal request data is intercepted.
7. A remote procedure call device, characterized in that: The device comprises: The indicator data acquisition module is used to periodically acquire the operating indicator data of each service providing node, wherein the operating indicator data includes CPU usage, memory occupancy, request response time, and occupied memory space; A weight value determination module, used to determine the load balancing weight value of each service providing node according to the operation indicator data of each service providing node, wherein the load balancing weight value is positively correlated with the performance status of the service providing node; A call response module, configured to respond to the first remote call service request and select a service providing node with the largest load balancing weight value from the service providing nodes as a target service providing node; The request sending module is used to send the first remote service call request to the target service providing node, so that the target service providing node processes the first remote service call request.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer system, characterized in that: The system includes a client and a service provider; The client is a computer device as claimed in claim 8; The service provider includes a plurality of service provider nodes, which are used to process the remote invocation service request sent by the client.
10. The system according to claim 9, characterized in that The system further comprises: a remote procedure call configuration center, wherein the remote procedure call configuration center is used for operators to dynamically configure the interface method, input parameters and output parameters of the service provider.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
