Service preheating method, electronic equipment and computer readable storage medium

By calculating the hit parameters of the service node and filtering the hit node, the balance and stability of service warm-up are achieved, and the problem of large performance overhead in the existing technology is solved.

CN119473302APending Publication Date: 2025-02-18SHANGHAI SHOUQIANBA INTERNET TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411526747.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art requires intercepting inbound and outbound traffic from the server during service warm-up, resulting in high performance overhead and inability to effectively warm up the internal state of service components.

Method used

By obtaining the warm-up configuration file, calculate the hit parameters of the service node, filter out the hit node, and use the hit node to process the service tasks, achieving balanced warm-up of the service node.

Benefits of technology

It significantly improves the stability of the service, optimizes resource utilization, avoids additional performance overhead, and adapts to changes in service node processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473302A_ABST
    Figure CN119473302A_ABST
Patent Text Reader

Abstract

The invention provides a service preheating method, electronic equipment and a computer readable storage medium. The method comprises the following steps: obtaining a preheating configuration file; wherein the preheating configuration file comprises a preheating factor of each service node of the target service; for a first target node of the target service, calculating a hit parameter of the first target node according to the preheating factor of the first target node and the current preheating duration; wherein the first target node is any one of the nodes needing to be preheated in the target service; for a second target node of the target service, calculating a hit parameter of the second target node according to the default weight; wherein the second target node is another service node in the target service; screening out hit nodes according to the hit parameters of all service nodes in the target service; and processing the task of the target service by using the hit node. Through the method, the service node preheating of the service can be more balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a service preheating method, an electronic device, and a computer-readable storage medium. Background Art

[0002] When a service is started, for example, a Java program has only completed simple Bean initialization, and the internal state of the component has not yet reached expectations. Therefore, the service needs to be preheated. However, the existing common preheating method requires intercepting the inbound and outbound traffic of the server. This processing method requires additional performance overhead, and the preheating of the internal state of the service component does not reach expectations. Summary of the invention

[0003] The purpose of the present application is to provide a service preheating method, an electronic device and a computer-readable storage medium, which can achieve more balanced preheating of service nodes of a service.

[0004] In a first aspect, the present invention provides a service preheating method, comprising: obtaining a preheating configuration file; wherein the preheating configuration file includes the preheating factors of each service node of the target service; for a first target node of the target service, calculating a hit parameter of the first target node according to the preheating factor of the first target node and the current preheating duration; wherein the first target node is any one of the nodes to be preheated in the target service; for a second target node of the target service, calculating a hit parameter of the second target node according to a default weight; wherein the second target node is another service node in the target service; according to the hit parameters of all service nodes in the target service, screening out hit nodes; and using the hit nodes to process tasks of the target service.

[0005] In the above implementation, the hit parameter of the service node that needs to be preheated can change over time, so that the probability of the service node being hit during the preheating process can also change with the preheating time, so that the preheating of the service node is not fixed, but adapts to its changes over time. In this way, it can also meet the change of its processing capacity gradually increasing over time, and the hit probability also changes accordingly. In this way, the stability of the service can be significantly improved, and the resources that need to be preheated can be better utilized.

[0006] In an optional embodiment, the hit parameter of the first target node is calculated based on the preheating factor of the first target node and the current preheating duration, including: calculating the preheating real-time weight of the first target node based on the preheating factor of the first target node and the current preheating duration; wherein the preheating real-time weight is proportional to the current preheating duration; and generating the hit parameter of the first target node based on a random number and the preheating real-time weight.

[0007] In the above implementation, the preheating real-time weight of the service node is proportional to the preheating duration, which can improve the processing capacity of the service node over time. Its preheating real-time weight also increases accordingly, making it easier to be hit, which can better utilize the service node resources.

[0008] In an optional embodiment, the preheating real-time weight of the first target node is calculated based on the preheating factor of the first target node and the current preheating duration, including: judging whether to end the preheating based on the current preheating duration; if not, calculating the preheating real-time weight of the first target node based on the preheating factor of the first target node and the current preheating duration; if so, marking the first target node as ending preheating, and setting the weight of the target node to the default weight.

[0009] In the above implementation, the preheating duration can be combined to determine whether it is necessary to end the preheating of the service node. The preheating is ended when the service node can better complete the service task, thereby increasing its probability of being hit, and thus being able to better balance the pressure on other service nodes and improve the stability of the service.

[0010] In an optional embodiment, the preheating configuration file also includes preheating initial weights of each service node of the target service; calculating the hit parameter of the first target node based on the preheating factor of the first target node and the current preheating duration includes: calculating the hit parameter of the first target node based on the preheating initial weight, preheating factor and current preheating duration of the first target node; wherein the preheating initial weight is inversely proportional to the hit parameter.

[0011] In the above implementation, the preheating initial weights can also be adaptively configured for different service nodes, so that the preheating can adapt to service nodes with different processing capabilities and different response requirements, making the preheating of the service nodes personalized and differentiated.

[0012] In an optional implementation, the method of screening out hit nodes according to the hit parameters of all service nodes in the target service includes: sorting all service nodes in the target service in ascending order based on the hit parameters of all service nodes in the target service to obtain a sorting result; and determining the hit nodes based on the sorting result.

[0013] In an optional implementation, obtaining the preheating configuration file includes: obtaining the preheating configuration file through a preheating agent, wherein the preheating agent is a Java agent.

[0014] In the above implementation, Java agent can be used as a preheating agent. Compared with Envoy agent, it will add a hop for each request in and out of the service, which will increase network latency and require additional CPU and memory resource overhead. The service preheating capability is implemented in the form of integrated Java agent, without replacing the underlying RPC framework, which can be quickly integrated for the business side.

[0015] In an optional embodiment, the preheating profile is constructed by istio; before obtaining the preheating profile through the preheating agent, the method further includes: istio and the preheating agent constructing grpc protocol communication; obtaining the preheating profile through the preheating agent includes: communicating with istio using the grpc protocol through the preheating agent to obtain the preheating profile.

[0016] In the above implementation, istio can be combined with the preheating agent java agent as the data plane to achieve simpler preheating without replacing the underlying rpc framework.

[0017] In a second aspect, the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method described in any one of the aforementioned implementations.

[0018] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in any one of the aforementioned embodiments are executed.

[0019] In a fourth aspect, the present invention provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the method described in any one of the aforementioned embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of the system architecture involved in the service preheating method provided in an embodiment of the present application;

[0023] Figure 3 A flow chart of a service preheating method provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of a change trend of the weight of a service node during the preheating process under the influence of different preheating factors provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the contents included in the preheating treatment core class provided in the embodiment of the present application;

[0026] Figure 6 A logical diagram of a service node provided for an embodiment of the present application;

[0027] Figure 7 A schematic diagram comparing the effects of using and not using the service preheating method provided by an embodiment of the present application in an experiment provided by an embodiment of the present application. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.

[0029] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0030] When a service is started, for example, after the Java program is started, only simple Bean initialization is completed, and the internal state of the service components has not yet reached expectations. For example, a certain amount of traffic may be required to preheat the thread pool and connection pool; a certain amount of traffic is required to pre-fill the cache (usually Caffeine, Guava Cache, etc.); a certain amount of traffic is required for code optimization, such as JIT, etc.

[0031] If the service-level agreement (SLA) of the service is relatively high, then in the initial stage of service startup, the newly added Pods do not have the same service capabilities as the existing Pods. The monitoring side usually shows that the response time of the server is significantly improved, and there are a large number of Http timeout logs on the call side. Furthermore, if the service node is not fully prepared for initialization, it may cause a chain reaction and even cause the service to fail to start.

[0032] This type of problem is solved by introducing a service preheating function.

[0033] In one implementation, the rpc framework that can be used is an internal secondary development based on the open source jsonrpc4j framework. If the dubbo framework is used, not only does it need to solve the problem of calling the protocol with the jsonrpc4j project, but the business side also needs to rewrite the code as a whole, which is relatively complicated to implement.

[0034] In another implementation, istio-proxy can be used to implement preheating, but if istio-proxy is used, istio must be enabled to intercept the inbound and outbound traffic of the server through the envoy proxy, which also brings some other disadvantages. For example, additional performance overhead: the Envoy proxy will add a hop for each request in and out of the service, which will increase network latency; resource consumption: the Envoy proxy requires additional CPU and memory resource overhead; increased complexity: operation and maintenance, upgrade complexity, troubleshooting complexity, service dependency complexity; insufficient preheating capacity: in the preheating implemented by istio, preheating is only achieved by setting the preheating duration, which will greatly reduce the preheating effect for some services with relatively large traffic.

[0035] Based on the above research, the embodiments of the present application may provide a service preheating method, an electronic device, and a computer-readable storage medium, which can adaptively configure a preheating factor for a service node of a service, thereby enabling it to better adapt to the preheating requirements of different services.

[0036] To facilitate understanding of this embodiment, first, an electronic device that executes the service preheating method disclosed in the embodiment of the present application is introduced in detail.

[0037] like Figure 1 , which is a block diagram of an electronic device. The electronic device 100 may include a memory 111 and a processor 113. A person skilled in the art may understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the electronic device 100. For example, the electronic device 100 may further include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0038] The memory 111 and the processor 113 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The processor 113 is used to execute the executable module stored in the memory.

[0039] The memory 111 may be, but not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 111 is used to store programs, and the processor 113 executes the program after receiving the execution instruction. The method executed by the electronic device 100 defined by the process disclosed in any embodiment of the present application can be applied to the processor 113, or implemented by the processor 113.

[0040] The processor 113 may be an integrated circuit chip with signal processing capability. The processor 113 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), a dedicated integrated circuit.

[0041] (Application Specific Integrated Circuit, referred to as ASIC), Field Programmable Gate Array (Field Programmable Gate Array, referred to as FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0042] The electronic device 100 in this embodiment can be used to execute each step in each method provided in the embodiments of the present application. The implementation process of the service preheating method is described in detail below through several embodiments.

[0043] like Figure 2 As shown, Figure 2 The system architecture diagram involved in the service preheating method provided in the embodiment of the present application is shown. The preheating configuration file is transmitted through istio communicating with the preheating agent. Among them, the preheating configuration file can be configured in istio. In this example, istio communicates with the preheating agent as a control panel.

[0044] Exemplarily, the control plane of the istio can transmit the preheating configuration file with the preheating agent through the gRPC channel. The preheating agent preheats the service node of the service based on the preheating configuration file.

[0045] exist Figure 2 In the example shown, the preheating agent runs in a Java Virtual Machine (JVM), and an application is also running in the Java Virtual Machine. The Java Virtual Machine runs in a container.

[0046] The electronic device 100 in this embodiment can be used to execute each step in each method provided in the embodiments of the present application. The implementation process of the service preheating method is described in detail below through several embodiments.

[0047] See also Figure 3 , is a flow chart of the service preheating method provided in the embodiment of the present application. The service preheating method provided in the embodiment of the present application can be applied to an electronic device, and the steps in the service preheating method are performed by the electronic device. Figure 3 The specific process shown is described in detail.

[0048] Step 210: Obtain a preheating configuration file.

[0049] Among them, the preheating configuration file can be used to guide the preheating logic.

[0050] The preheating configuration file may include a preheating factor of each service node of the target service. The preheating factor may be used to influence the preheating weight of each time period of the service node during the preheating process.

[0051] Exemplarily, the preheating factor and the preheating duration may be used as independent variables and substituted into a pre-designed preheating weight formula to calculate the preheating weight of each time period of the service node during the preheating process.

[0052] In this embodiment, the preheating weight may gradually increase as the preheating time increases.

[0053] Among them, the higher the preheating weight of any service node, the higher the probability of the service node being hit.

[0054] Step 220, for the first target node of the target service, calculate the hit parameter of the first target node according to the preheating factor of the first target node and the current preheating duration.

[0055] The first target node is any one of the nodes that need to be preheated in the target service.

[0056] Exemplarily, for a service node that needs to be preheated, its real-time preheating weight may be calculated first, and then the hit parameter may be calculated based on the real-time preheating weight and a random number.

[0057] Step 230, for the second target node of the target service, calculate the hit parameter of the second target node according to the default weight.

[0058] The second target node is another service node in the target service.

[0059] Exemplarily, a real-time random number may be generated first, and the hit parameter of the second target node may be calculated based on the real-time random number and a default weight.

[0060] In this embodiment, all service nodes can use the same set calculation method to calculate the hit parameter. Since the determination of the random number is random, even if two service nodes with the same weight use the same calculation method to calculate the hit parameter, it may be different.

[0061] Step 240, screening out hit nodes according to hit parameters of all service nodes in the target service.

[0062] Optionally, in the above-mentioned setting calculation method, the weight of the service node may be inversely proportional to the hit parameter. After the random number is determined, the greater the weight of the service node, the smaller the determined hit parameter. The service node with the smallest hit parameter may be selected from all service nodes as the hit node.

[0063] Optionally, in the above-mentioned setting calculation method, the weight of the service node may be proportional to the hit parameter. After the random number is determined, the greater the weight of the service node, the greater the hit parameter determined. The service node with the largest hit parameter may be selected from all service nodes as the hit node.

[0064] Exemplarily, based on the hit parameters of all service nodes in the target service, all service nodes in the target service are sorted in ascending order to obtain a sorting result; based on the sorting result, the hit node is determined. For example, the service node that is ranked first in the sorting result can be used as the hit node.

[0065] Step 250, using the hit node to process the target service task.

[0066] Through the above method, different weights can be used for service nodes that are operating normally and service nodes that need to be preheated, so that the probability of hitting the service nodes that need to be preheated is different from that of the service nodes that are operating normally, and the probability of hitting the service nodes that need to be preheated is relatively lower, so that the preheated service nodes can have more time to achieve buffered startup, avoiding the situation where the service nodes that need to be preheated are assigned many tasks at once. In this way, the stability of the service can be significantly improved, and the resources that need to be preheated can be better utilized.

[0067] In an optional implementation, the above step 230 may include: calculating the preheating real-time weight of the first target node according to the preheating factor of the first target node and the current preheating duration, and generating a hit parameter of the first target node based on the random number and the preheating real-time weight.

[0068] Among them, the preheating real-time weight is proportional to the current preheating duration.

[0069] Exemplarily, the preheating real-time weight may be calculated through a linear function, in which the preheating duration may be an independent variable, and the preheating real-time weight may be a dependent variable of the linear function.

[0070] Exemplarily, the preheating real-time weight may be calculated through a multi-time function, the preheating duration may be the independent variable of the multi-time function, and the preheating real-time weight may be the dependent variable of the multi-time function.

[0071] Optionally, other preheating functions may be used to calculate the preheating real-time weight, and the preheating function can satisfy the requirement that the value of the preheating real-time weight increases as the preheating time increases.

[0072] Exemplarily, the target preheating time of the first target node can also be pre-set. When the preheating time has reached the target preheating time, the weight of the first target node can be changed from a changing state to a stable state, and the weight of the service node in the stable state is the above-mentioned default weight.

[0073] In one example, the hit parameter of the first target node can be obtained by directly dividing the random number by the preheating real-time weight of the first target node.

[0074] In this embodiment, the preheating duration of the service node may be limited. For example, the target preheating duration of the first target node may be set in advance. When determining the preheating real-time weight of the first target node, it may be determined whether the preheating needs to be ended. Based on this, the above-mentioned calculation of the preheating real-time weight of the first target node based on the preheating factor of the first target node and the current preheating duration may include: determining whether to end the preheating based on the current preheating duration.

[0075] Exemplarily, the current preheating duration may be compared with the target preheating duration to determine whether the preheating needs to be terminated. For example, if the current preheating duration is the same as the target preheating duration, or the current preheating duration is greater than the target preheating duration, the preheating may be terminated.

[0076] If the preheating does not need to be terminated, the preheating real-time weight of the first target node is calculated according to the preheating factor of the first target node and the current preheating duration.

[0077] If the preheating needs to be ended, the first target node may be marked to end the preheating, and the weight of the target node may be set to the default weight.

[0078] In one embodiment, the preheating configuration file also includes the preheating initial weights of each service node of the target service. The above step 230 may include: calculating the hit parameter of the first target node according to the preheating initial weight, preheating factor and current preheating duration of the first target node.

[0079] Among them, the preheating initial weight is inversely proportional to the hit parameter.

[0080] Exemplarily, the preheating real-time weight of the first target node can be calculated based on the preheating initial weight, preheating factor and current preheating duration of the first target node, and then the hit parameter of the first target node is calculated based on the preheating real-time weight.

[0081] In the above implementation, by setting the preheating factor and the preheating initial weight, the preheating requirements of service nodes of different services can be better met.

[0082] In a usage scenario, a Java Agent may be used to implement a preheating agent, and the preheating agent is used to implement the steps required for preheating.

[0083] The above-mentioned step 210 may include: obtaining a preheating configuration file through a preheating agent.

[0084] Among them, the preheating agent is a Java agent.

[0085] In this embodiment, istio can be used as the control plane, and the preheating configuration file is built through istio.

[0086] Before executing step 210, istio can first establish grpc protocol communication with the preheating agent.

[0087] So that istio can communicate with the warm-up agent through the grpc protocol.

[0088] The above-mentioned step 210 may include: communicating with istio using the grpc protocol through the preheating agent to obtain the preheating configuration file.

[0089] Optionally, the preheating configuration file may be xds protocol data.

[0090] The following uses some examples to describe the entire process of the service preheating method based on Istio and the preheating agent.

[0091] In an embodiment of the present application, a destinationRule resource is set in istio. The destinationRule resource contains a custom resource definition (Custom Resource Definition, crd for short) preheating parameter. After istio determines the preheating parameters, it forms a preheating configuration file and sends it to the preheating agent.

[0092] The CRD preheating parameters may include a preheating factor, a preheating initial weight, and a target preheating duration.

[0093] In one example, the warm-up factor directly affects the change trend of the weight of the service node during the warm-up process, such as Figure 4As shown in the figure, fourteen different preheating factor aggression are shown, whose values ​​form an arithmetic progression with a tolerance of 0.5 and a first term value of 1, and whose values ​​range from 1 to 7.5. When the target preheating time is set to 30s, the weight changes within 30s. In the fourteen weight change curves in the figure, the value of the preheating factor gradually decreases from top to bottom. From the example shown in the figure, it can be seen that the preheating factor affects the change in the weight of the service node during the preheating process. Among them, the higher the preheating factor, the higher the weight of the service node will be at the beginning, and then it will gradually rise smoothly.

[0094] In the example of this application, a proxyless loader is built in a Java agent, and the conversion of the logic and structure of istio delivery is realized. The proxyless loader acts as a preheating agent to implement the processing actions required for preheating.

[0095] The proxyless load loader and istio communicate through the grpc protocol. The data transmitted between the proxyless load loader and istio can be xds protocol data.

[0096] The loader can intercept and process the service call according to the preheating configuration file. When preheating is required, a WeightedRoundRobinPicker can be created, which is the core class for preheating processing.

[0097] like Figure 5 As shown, Figure 5 The content of the WeightedRoundRobinPicker preheating core class is shown. Among them, the class attributes of the preheating core class include:

[0098] List <server>Servers send the received server information, WrrServer (the implementation class corresponding to Server), WrrServer.getWeight (that is, obtain the latest weight according to the preheating formula),

[0099] <edfscheduler>scheduler FIFO queue. The class methods of the preheating core class may include: updateWeight (i.e., calculating the real-time weight based on the preheating time), pickServer (i.e., obtaining the next server address from the service node queue). pickServer can also be understood as selecting the next service node from the service node queue.

[0100] The Server server for the target service can have three service nodes, namely Server Pod1, Server Pod2, and Server Pod3. Among them, the service node Server Pod 1 is a newly added node, which needs to be preheated, and the initial preheating weight is set to 0.1.

[0101] When the current EdfScheduler processes concurrent requests, the logic of outputting in the queue according to the deadline is as follows.

[0102] Server Pod represents different service nodes on the server side. In this example, Server Pod2 and ServerPod3 are service nodes that have entered stable operation. Their weights are default weights. In this example, the default weight may be weight=1, which means that the service has been preheated and is running stably.

[0103] by Figure 6 Take the example shown as an example, where before selecting a service node each time, the service nodes are sorted based on the hit parameter to obtain a queue FIFO. Figure 6 In the example shown, the service nodes are screened six times, among which Server Pod2 is selected the first time, Server Pod3 is selected the second time, Server Pod2 is selected the third time, Server Pod3 is selected the fourth time, Server Pod1 is selected the fifth time, and Server Pod2 is selected the sixth time.

[0104] Figure 6 In the example shown, the service node Server Pod1 may be a newly started server node, and the initial preheating weight is 0.1. The weights of other stably running service nodes Server Pod2 and Server Pod3 are 1.

[0105] In the first screening process, the hit parameter of the service node Server Pod1 can be expressed as deadline = random (0, 1) / weight. For example, if the random number is 0.2, then the deadline in the first screening logic of Server Pod1 is 0.2 / 0.1 = 2. The hit parameter deadline is the standard for selecting service nodes. In the hit parameter queue, you can sort according to the deadline, and give priority to the Server Pod node with the smallest deadline.

[0106] exist Figure 6 In the example shown, the selected service node Server Pod is used to process the target service task. When the service node is screened next time, its hit parameter is the previous hit parameter plus 1. This reduces the probability of the same service node being selected repeatedly.

[0107] exist Figure 6 In the example shown, the first pickerServer hits Server Pod2. When the second pickerServer is hit, the deadline of the service node Server Pod2 is 1 / weight.

[0108] +deadline. That is, the deadline of Server Pod2 of the second pickerServer is 1.12.

[0109] The second pickerServer hits Server Pod3, so the third pickerServer has a deadline of Server Pod3 = 1 / weight + deadline. The third pickerServer has a deadline of 1.13.

[0110] The third time pickerServer hits the service node Server Pod2, then the deadline of the service node Server Pod2 in the fourth pickerServer is 1 / weight+deadline. Then the deadline of the service node Server Pod2 in the fourth pickerServer is 2.12.

[0111] The fourth pickerServer hits the service node Server Pod3. Then the deadline of the service node Server Pod3 in the fifth pickerServer is 1 / weight+deadline. Then the deadline of the service node Server Pod3 in the fifth pickerServer is 2.13.

[0112] The fifth pickerServer hits the service node Server Pod1. Then, at the sixth pickerServer, the deadline of the service node Server Pod1 is 1 / weight+deadline.

[0113] The sixth time, pickerServer hits service node Server Pod12.

[0114] exist Figure 6 In the example shown, when there is a change in the hit parameter deadilne of the service nodes in the queue FIFO, the service nodes in the queue may be reordered.

[0115] Exemplarily, after a service node is selected, the hit parameter of the selected service node will change at the next pickerServer. Exemplarily, when the preheating real-time weight of the service node that needs to be preheated changes, its corresponding hit parameter will also change.

[0116] Understandably, Figure 6 What is shown is only an example. In actual situations, the number of service nodes may be different, the number of service nodes that need to be preheated may also be different, and the weights of different service nodes may also be different.

[0117] exist Figure 6 In the example shown, multiple rounds of pickerServer can be performed after the random number is determined. Of course, in other examples, the hit parameters of each service node can be updated in each round of pickerServer, and the random number can be updated.

[0118] The following are the effects of using the method provided in the embodiments of the present application through some actual experiments:

[0119] like Figure 7 As shown, there is a scenario in which the elastic HPA service is expanded from 2 copies to 3 copies, and the server-side call volume is shown in the following figure: 14:50-14:55 is the effect diagram of not using the service preheating method provided in the embodiment of the present application, and the method call volume rises in a short period of time to the same level as the call volume of other online stably running service nodes Server Pod; 15:40-15:50 is the effect diagram of using the service preheating method provided in the embodiment of the present application for preheating, with a target preheating time of 10 minutes and a preheating factor of 1.5. It can be seen that the call volume on the new service node Server Pod is slower than that of other stably running Server Pods, while the call volume of other stably running Server Pods is the same.

[0120] In the embodiment of the present application, the service preheating capability can be realized in the form of integrating Java Agent under the jsonrpc4j framework, without replacing the underlying rpc framework, and the business side can quickly integrate it. Furthermore, the solution integrates the preheating capability development into the java agent system through the proxyless mesh mode implemented based on istio. Compared with the traditional proxy mode, the loss of CPU and memory is minimal, and it can better meet the end-to-end direct access.

[0121] In addition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the service preheating method described in the above method embodiment are executed.

[0122] The computer program product of the service preheating method provided in the embodiment of the present application includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the service preheating method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0123] In several embodiments provided in the present application, it should be understood that the disclosed method can also be implemented in other ways. The method embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0124] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0125] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0126] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / edfscheduler> < / server>

Claims

1. A service preheating method, characterized in that: include: Obtaining a preheating configuration file; wherein the preheating configuration file includes a preheating factor of each service node of the target service; For a first target node of a target service, a hit parameter of the first target node is calculated according to a preheating factor of the first target node and a current preheating duration; wherein the first target node is any one of the nodes that need to be preheated in the target service; For a second target node of the target service, a hit parameter of the second target node is calculated according to a default weight; wherein the second target node is another service node in the target service; Filter out hit nodes according to hit parameters of all service nodes in the target service; The hit node is used to process the task of the target service.

2. The method according to claim 1, characterized in that The calculating the hit parameter of the first target node according to the preheating factor of the first target node and the current preheating duration includes: Calculate the preheating real-time weight of the first target node according to the preheating factor of the first target node and the current preheating duration; wherein the preheating real-time weight is proportional to the current preheating duration; A hit parameter of the first target node is generated based on a random number and the preheated real-time weight.

3. The method according to claim 2, characterized in that The calculating the preheating real-time weight of the first target node according to the preheating factor of the first target node and the current preheating duration includes: Determine whether to end preheating according to the current preheating duration; If not, calculating the preheating real-time weight of the first target node according to the preheating factor of the first target node and the current preheating duration; If so, mark the first target node as finished preheating, and set the weight of the target node to the default weight.

4. The method according to claim 1, characterized in that: The preheating configuration file also includes the preheating initial weight of each service node of the target service; The calculating the hit parameter of the first target node according to the preheating factor of the first target node and the current preheating duration includes: A hit parameter of the first target node is calculated according to the preheating initial weight, the preheating factor and the current preheating duration of the first target node; wherein the preheating initial weight is inversely proportional to the hit parameter.

5. The method according to claim 1, characterized in that: The step of screening out hit nodes according to hit parameters of all service nodes in the target service includes: Based on the hit parameters of all the service nodes in the target service, sort all the service nodes in the target service in ascending order to obtain a sorting result; Based on the sorting results, the hit nodes are determined.

6. The method according to any one of claims 1 to 5, characterized in that: The step of obtaining a preheating configuration file comprises: A preheating configuration file is obtained through a preheating agent, wherein the preheating agent is a Java agent.

7. The method according to claim 6, characterized in that The preheating profile is constructed by istio; Before obtaining the preheating configuration file through the preheating agent, the method further includes: The istio and the preheating agent establish grpc protocol communication; The obtaining of the preheating configuration file through the preheating agent includes: communicating with the istio through the preheating agent using the grpc protocol to obtain the preheating configuration file.

8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.