Service preheating method, device, computer equipment, storage medium and program product

By receiving the service provider identification information of the registration center, we determine the new service provider and make preheating service calls, which solves the problem of request timeout failure when the service provider is started, and improves the business success rate and the accuracy of service warm-up .

CN115766885BActive Publication Date: 2024-12-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211422761.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2024-12-10
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

In the microservice architecture, the problem of the request timeout failure when the service provider is just started, resulting in a low business success rate.

Method used

By receiving the service provider identification information sent by the registration center, the new service provider is determined, and the custom callback function in the configuration file is used to preheat the service to ensure the real service warm-up and avoid the request timeout failure.

Benefits of technology

It realizes the accuracy and timeliness of service warm-up, improves the business success rate, and reduces the transaction failure rate when the service provider is just started.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766885B_ABST
    Figure CN115766885B_ABST
Patent Text Reader

Abstract

The present application relates to a service preheating method, device, computer equipment, storage medium and program product. The present application relates to the field of cloud computing technology, and the method includes: receiving notification information including the identification of the service provider sent by the registration center through the preheating node, and determining a new service provider from multiple current service providers based on the identification of multiple current service providers and the identification of the historical service provider received last time, and then sequentially calling the preheating service of the new service provider using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service. Since calling the preheating service is equivalent to calling the real service, it is a real remote procedure call, and the code at the communication level will be called, the service preheating in the remote procedure call scenario becomes more accurate and more timely, and the preheating range is more comprehensive, which can avoid the request timeout failure when the service provider is just started, and improve the business success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a service preheating method, apparatus, computer equipment, storage medium and program product. Background Art

[0002] The classic service registration and subscription model in the microservice architecture is that the production client publishes its own services to the registration center, and the consumer client subscribes to the services it is interested in from the registration center. When the registration center finds that a production client is online, it will push the services that the production client can provide to the consumer client, and the consumer client can call the services that the production client can provide.

[0003] At present, in order to improve the speed and success rate of service request processing, the following method is used to preheat the service: after startup, the production client first calls the entry method of the core service by itself, so that most of the business layer code can be preheated, and then the service is published to the registration center for consumer clients to call.

[0004] However, the current service preheating method has the problem of some requests timing out and failing. Summary of the invention

[0005] Based on this, it is necessary to provide a service preheating method, device, computer equipment, storage medium and program product to address the above technical problems, which can avoid request timeout failure when the service provider is just started and improve the service success rate.

[0006] In a first aspect, the present application provides a service preheating method, which is applied to preheating a node. The method comprises:

[0007] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0008] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0009] The preheating service of the newly added service provider is called in sequence using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0010] In one embodiment, the method further comprises:

[0011] Get the call information of calling the preheating service;

[0012] If the calling information meets the preset conditions, the calling of the preheating service is stopped.

[0013] In one embodiment, the call information includes the total number of calls to the preheating service; if the call information meets a preset condition, stopping the call to the preheating service includes:

[0014] If the total number of calls is greater than or equal to the preset call number threshold, stop calling the preheating service.

[0015] In one embodiment, the call information includes an average call duration of the most recent preset number of calls to the preheating service; if the call information meets a preset condition, stopping the call to the preheating service includes:

[0016] If the average call duration is less than or equal to the preset duration threshold, stop calling the preheating service.

[0017] In one embodiment, the method further comprises:

[0018] A subscription request is sent to a registration center; the subscription request includes a preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send the notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

[0019] In one embodiment, determining a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time includes:

[0020] Comparing the identifiers of the multiple current service providers with the identifier of the historical service provider to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers;

[0021] The current service provider corresponding to the identifier of the newly added service provider is used as the newly added service provider.

[0022] In a second aspect, the present application also provides a service preheating method, which is applied to a registration center, and the method includes:

[0023] Receive a subscription request sent by a preheating node; the subscription request includes a preheating service identifier;

[0024] Obtain preheating services corresponding to the preheating service identifier issued by multiple current service providers;

[0025] When it is determined that the multiple current service providers include a newly added service provider, a notification message is sent to the preheating node, so that the preheating node, based on the notification message, sequentially calls the preheating service of the newly added service provider using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service; the notification message includes the identifiers of the multiple current service providers.

[0026] In one embodiment, the method further comprises:

[0027] After receiving the preheating service issued by the newly added service provider, the real service issued by the newly added service provider is received after a first preset time delay.

[0028] In a third aspect, the present application further provides a service preheating device, which is applied to a preheating node. The device is arranged at the preheating node, and the device comprises:

[0029] A first receiving module is used to receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0030] A first determining module, configured to determine a newly added service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0031] The calling module is used to call the preheating service of the newly added service provider in sequence by using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0032] In one embodiment, the device further comprises:

[0033] A first acquisition module is used to acquire the call information of calling the preheating service;

[0034] The first processing module is used to stop calling the preheating service if the calling information meets a preset condition.

[0035] In one of the embodiments, the call information includes a total number of calls to the preheating service; the first processing module is specifically configured to stop calling the preheating service if the total number of calls is greater than or equal to a preset call number threshold.

[0036] In one of the embodiments, the call information in the service preheating device includes the average call duration of the most recent preset number of calls to the preheating service;

[0037] The first processing module is specifically used to stop calling the preheating service if the average calling duration is less than or equal to a preset duration threshold.

[0038] In one embodiment, the device further comprises:

[0039] A sending module is used for the preheating node to send a subscription request to the registration center; the subscription request includes the preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send the notification information to the preheating node when it is determined that the newly added service provider corresponding to the preheating service is online.

[0040] In one embodiment, the first determination module includes:

[0041] A first determining unit, configured to compare the identifiers of multiple current service providers with the identifier of the historical service provider to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers;

[0042] The second determining unit is configured to use the current service provider corresponding to the identifier of the newly added service provider as the newly added service provider.

[0043] In a fourth aspect, the present application also provides a service preheating device, which is arranged in a registration center.

[0044] The device includes:

[0045] A first receiving module is used to receive a subscription request sent by a preheating node; the subscription request includes a preheating service identifier;

[0046] An acquisition module, used for acquiring preheating services corresponding to the preheating service identifier issued by multiple current service providers;

[0047] A sending module is used to send notification information to the preheating node when it is determined that the multiple current service providers include a newly added service provider, so that the preheating node can call the preheating service of the newly added service provider in turn using the custom callback function in the configuration file according to the notification information to preheat the real service corresponding to the preheating service; the notification information includes the identifiers of the multiple current service providers.

[0048] In one embodiment, the apparatus further comprises:

[0049] The second receiving module is used to receive the real service published by the newly added service provider after delaying for a first preset time after receiving the preheating service published by the newly added service provider.

[0050] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0051] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0052] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0053] The preheating service of the newly added service provider is called in sequence using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0054] In a sixth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0055] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0056] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0057] The preheating service of the newly added service provider is called in sequence using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0058] In a seventh aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0059] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0060] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0061] The preheating service of the newly added service provider is called in sequence using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0062] The above-mentioned service preheating method, device, computer equipment, storage medium and program product receive notification information including the identification of the service provider sent by the registration center through the preheating node, and determine the newly added service provider from the multiple current service providers according to the identification of multiple current service providers and the identification of the historical service provider received last time, and then use the custom callback function in the configuration file to call the preheating service of the newly added service provider in turn to preheat the real service corresponding to the preheating service. Since the preheating service is only an alias for the real service, calling the preheating service is equivalent to calling the real service, and this call is a real remote procedure call, and the code at the communication level will also be called. Therefore, the service preheating in the remote procedure call scenario becomes more accurate and more timely, and the preheating range is more comprehensive, which can avoid the request timeout failure when the service provider is just started, and improve the business success rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 This is a schematic diagram of a service preheating scenario provided by an embodiment of the present application;

[0064] Figure 2 This is one of the flow charts of a service preheating method provided in an embodiment of the present application;

[0065] Figure 3 It is a flowchart of a method for stopping calling a custom callback function provided in an embodiment of the present application;

[0066] Figure 4 It is a flowchart of a method for determining a new service provider provided in an embodiment of the present application;

[0067] Figure 5 This is the second flow chart of a service preheating method provided in an embodiment of the present application;

[0068] Figure 6 It is one of the structural schematic diagrams of a service preheating device provided in an embodiment of the present application;

[0069] Figure 7 This is the second structural schematic diagram of a service preheating device provided in an embodiment of the present application;

[0070] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0072] The service preheating method provided in the embodiment of the present application can be applied to Figure 1 In the environment shown, Figure 1 This is a schematic diagram of a service preheating scenario provided by an embodiment of the present application. The scenario includes a registration center, a preheating node, and a service provider. The scenario is a remote procedure call (RPC) framework scenario. Among them, the preheating node is a node used to preheat the real service provided by the service provider. The preheating node can be regarded as a service consumer. Based on Figure 1 In the scenario shown, the service preheating method provided in the embodiment of the present application may include: receiving the current notification information including the identifiers of multiple current service providers sent by the registration center, and determining a new service provider from the multiple current service providers based on the identifiers of the multiple current service providers and the identifier of the historical service provider received last time, and then using the custom callback function in the configuration file to call the preheating service of the new service provider in turn to preheat the real service corresponding to the preheating service, which solves the problem of some request timeout failures in traditional technologies.

[0073] Figure 2 This is one of the flow diagrams of a service preheating method provided in an embodiment of the present application. The method is applied to a preheating node. The preheating node can be deployed on a computer device. The method includes the following steps:

[0074] S201. Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers.

[0075] The identifier of the current service provider may be a protocol address (IP, Internet Protocol Address), a port, etc., for interconnection between networks.

[0076] Specifically, the preheating node is essentially a consumer, and the preheating node receives the current notification information sent by the registration center, where the notification information includes the identifiers of multiple current service providers.

[0077] S202: Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time.

[0078] The historical service provider may refer to the service provider corresponding to the service provider identifier included in the last notification information received by the preheating node. For example, the last notification information includes 50 service provider identifiers A1, A2, A3, ... A50, and the current notification information includes 100 service provider identifiers A1, A2, A3, ... A99, A100, then it can be determined that the newly added service provider includes the service provider corresponding to the identifiers of the 50 service providers A51, ... A100.

[0079] It should be noted that the registration center can determine whether there is a new service provider in the current service provider of the preheating service. When the registration center finds that the current service provider list of the preheating service includes the identifier of the new service provider, it is determined that there is a new service provider in the current service provider of the preheating service. In this case, the preheating node will receive the current service provider list pushed by the registration center, and then the preheating node determines the new service provider from the current service provider corresponding to the identifier of the current service provider in the current service provider list, and then executes the following S203 to realize the processing of the change of the current service provider, that is, the preheating service of the new service provider is called in turn by using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0080] S203: Use the custom callback function in the configuration file to call the preheating service of the newly added service provider in sequence to preheat the real service corresponding to the preheating service.

[0081] The custom callback function refers to the callback function configured in the configuration file. The custom callback function can be multiple or one. The service name of the preheating service is different from the service name of the corresponding real service. The service name of the preheating service includes the service name of the real service. For example, if the service name of the real service is A, the service name of the preheating service is, for example, WarmUpA, so as to associate the preheating service with the corresponding real service. WarmUpA completely reuses the implementation logic of the real service with the service name A, and can be regarded as an alias of the real service with the service name A.

[0082] Specifically, the preheating node sequentially calls the custom callback function set in the configuration file, and calls the preheating service of the newly added service provider through the custom callback function. Since the preheating service is only an alias for the real service, calling the preheating service is equivalent to calling the real service corresponding to the preheating service.

[0083] In traditional technology, after startup, the service provider first calls the entry method of the core service, which can preheat most of the business layer code, and then publish the service to the registration center for the consumer server to call. However, because this preheating strategy is a local call, it cannot preheat the remote communication related code. When real business requests come, some requests often time out and fail due to the slow processing of the remote communication related code.

[0084] The service preheating method provided in the embodiment of the present application receives notification information including the identification of the service provider sent by the registration center through the preheating node, and determines the newly added service provider from the multiple current service providers according to the identification of multiple current service providers and the identification of the historical service provider received last time, and then sequentially calls the preheating service of the newly added service provider using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service. Since the preheating service is only an alias for the real service, calling the preheating service is equivalent to calling the real service, and this call is a real remote procedure call, and the code at the communication level will also be called, so that the service preheating in the remote procedure call scenario becomes more accurate and more timely, and the preheating range is more comprehensive, which can effectively reduce the transaction failure rate when the service provider is just started.

[0085] It should be noted that common RPC frameworks are based on the registration-notification mechanism for service discovery, but this process is generally not modifiable. Taking the open source distributed service framework Dubbo framework as an example, the service discovery of the consumer server is done as follows:

[0086] 1: Developers write business codes based on the framework and specify the remote services to subscribe to.

[0087] 2: The framework subscribes to the target service from the registry.

[0088] 3: The framework specifies a notification callback function locally. This function is built into the framework and developers do not need to pay attention to it and cannot adjust it.

[0089] 4: When the registration center finds a new service provider, the framework will receive a notification pushed by the registration center, and then the framework will automatically call the callback function specified in step 3 to handle these changes. Handling these changes means updating the locally cached service provider list.

[0090] In the embodiment of the present application, the service discovery of the preheating node is as follows:

[0091] 1: The developer writes business code based on the framework, specifies the remote preheating service to subscribe to, and configures a custom callback function for the preheating service.

[0092] 2: The framework subscribes to the preheating service from the registration center.

[0093] 3: The framework specifies a callback function list locally. The content of this callback function list is as follows [built-in callback function, custom callback function 1, custom callback function 2, ...], ensuring that the framework's built-in callback function comes first and the custom callback function comes last.

[0094] 4: When the registration center finds a new service provider, the framework will receive a notification message pushed by the registration center, and then the framework will call the callback method list specified in step 3 in sequence to handle these changes. Among them, handling these changes includes updating the locally cached service provider list and using a custom callback function to call the preheating service of the new service provider to preheat the real service corresponding to the preheating service. The framework refers to the preheating node in the embodiment of the present application, for example.

[0095] After the above S203, in which the custom callback function in the configuration file is used to call the preheating service of the newly added service provider in turn to preheat the real service corresponding to the preheating service, the embodiment of the present application may further include the following steps: Figure 3 Refer to the steps shown. Figure 3 , Figure 3 : is a flowchart of a method for stopping calling a custom callback function provided in an embodiment of the present application, the method also includes:

[0096] S301, obtaining the calling information of calling the preheating service.

[0097] The preheating node can obtain the calling information of the preheating service, and the calling information of the preheating service may include the total number of calls to the preheating service and the average calling duration of the most recent preset number of calls to the preheating service.

[0098] Specifically, the preheating node is a newly developed node, which is essentially a consumer. Taking the Dubbo framework as an example of the microservice framework, developers write business codes based on the framework and specify the preheating service to be subscribed. At the same time, they configure a custom callback function for the preheating service. There can be multiple custom callback functions, and the preheating service is called using the custom callback function. Among them, after the framework subscribes to the preheating service from the registration center, the framework specifies the notification callback function list locally. The content of this list is as follows [built-in callback function, custom callback function 1, custom callback function 2, ...], ensuring that the callback function built into the framework is in front and the custom callback function is in the back.

[0099] S302: If the calling information meets the preset conditions, stop calling the preheating service.

[0100] Specifically, the preheating node determines whether it is necessary to stop calling the preheating service based on whether the calling information meets the preset conditions, that is, whether it is necessary to stop calling the preheating service. If the calling information of the preheating service meets the preset conditions, it means that the preheating has been completed and can be stopped. In this case, the action of preheating the real service corresponding to the preheating service by using the custom callback function is stopped.

[0101] The custom callback function determines whether the newly added service provider is online. If so, it immediately starts preheating the preheating service on the newly added service provider. The end time of the call action can be designed according to actual needs, and the following strategies can be considered: the preheating node obtains the call information of the preheating service. If the total number of calls is greater than or equal to the call number threshold, and the average call duration of the most recent preset number of calls to the preheating service is less than or equal to the preset duration threshold, then stop calling the preheating service.

[0102] For example, set the call count threshold to 99 times, the preset duration threshold to 10ms, and the most recent preset call count to 10 times. If the total number of calls is 100 times, it means that the total number of calls is greater than the call count threshold; the 91st to 100th times, a total of 10 times, are the most recent preset call counts, and the average call duration of the most recent preset call count of 10 times is 9ms, which means that the average call duration of the most recent preset call counts for calling the preheating service is less than the preset duration threshold. Since the total number of calls is greater than the call count threshold, and the average call duration of the most recent preset call counts for calling the preheating service is less than the preset duration threshold, the preheating service is stopped.

[0103] The service preheating method provided in the embodiment of the present application obtains the call information of the preheating service through the preheating node, and stops calling the preheating service if the call information meets the preset condition. Since the preset condition is compared with the call information, the preheating can be stopped in time to avoid unnecessary waste of resources caused by too long preheating time.

[0104] The above embodiment describes when to stop calling the preheating service after calling the custom callback function. Here, the following two embodiments further describe the calling information used in the service preheating and when to stop calling the preheating service. In one embodiment, the calling information includes the total number of calls to the preheating service; if the calling information meets the preset conditions, the preheating service is stopped. Including:

[0105] If the total number of calls is greater than or equal to the preset call number threshold, stop calling the preheating service.

[0106] Specifically, the preheating node obtains the call information of calling the preheating service, wherein the call information may include the total number of calls of the custom callback function, for example, the total number of calls is 100 times, and the preset call number threshold is set to 99 times, then the total number of calls is greater than the preset call number threshold, and the preset condition is met, then the call to the preheating service is stopped, that is, the call to the preheating service is stopped. When the total number of calls is equal to the preset call number threshold, the call to the preheating service is also stopped, that is, the call to the preheating service is stopped.

[0107] In another embodiment, the call information includes an average call duration of the most recent preset number of calls to the preheating service; if the call information meets a preset condition, then stopping the call to the preheating service includes:

[0108] If the average call duration is less than or equal to the preset duration threshold, stop calling the preheating service.

[0109] Consider the following strategy: the preheating node obtains the call information of calling the preheating service. If the average call duration of the most recent preset number of calls to the preheating service is less than or equal to the preset duration threshold, the preheating service is stopped.

[0110] For example, if the current total number of calls is 100, the 91st to 100th calls are the most recent preset number of calls, and the average call duration of these 10 calls is 9ms. If the preset duration threshold is 10ms, it means that the average call duration of these 10 calls is less than the preset duration threshold of 10ms. Therefore, the call information meets the preset conditions and the preheating service needs to be stopped.

[0111] In the service preheating method provided in the embodiment of the present application, the call information includes the average call duration of the most recent preset number of calls to the preheating service. When the call information meets the preset conditions, the preheating service is stopped from being called. If the average call duration is less than or equal to the preset duration threshold, the preheating service is stopped from being called. Since the preset conditions are compared with the call information, the service preheating becomes more accurate and more timely. Therefore, when a real business request arrives, the occurrence of successful timeout of some requests is increased.

[0112] In one embodiment, the service preheating method, based on the above embodiment, further includes:

[0113] A subscription request is sent to the registration center; the subscription request includes the preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

[0114] Specifically, the preheating node sends a subscription request to the registration center, wherein the subscription request includes the preheating service identifier corresponding to the preheating service. When the registration center determines that the newly added service provider corresponding to the preheating service is online, the registration center sends notification information to the preheating node.

[0115] The service preheating method provided in the embodiment of the present application is that the preheating node sends a subscription request to the registration center, and the subscription request includes the preheating service identifier of the preheating service. The preheating service identifier is used to instruct the registration center to send notification information to the preheating node to indicate the preheating service to be subscribed, so that when the registration center finds that the new service provider corresponding to the preheating service is online, it sends notification information to the preheating node, so that the preheating node can preheat the real service corresponding to the preheating service of the new service provider according to the identifiers of the multiple current service providers included in the notification information, thereby improving the preheating effect and reducing the occurrence of some request timeout failures.

[0116] Figure 4 This is a flow chart of a method for determining a newly added service provider provided in an embodiment of the present application. This embodiment relates to a possible implementation method of how to determine a newly added service provider from multiple current service providers based on the identifiers of multiple current service providers and the identifier of the historical service provider received last time. Based on the above embodiment, the above S202 may include the following steps:

[0117] S401: Compare identifiers of multiple current service providers with identifiers of historical service providers to determine an identifier of a newly added service provider from among the identifiers of the multiple current service providers.

[0118] S402: The current service provider corresponding to the identifier of the newly added service provider is used as the newly added service provider.

[0119] Specifically, the historical service provider may refer to the service provider corresponding to the service provider identifier included in the last notification information received by the preheating node. For example, the last notification information includes 50 service provider identifiers A1, A2, A3, ... A50, and the current notification information includes 100 service provider identifiers A1, A2, A3, ... A99, A100, then it can be determined that the newly added service provider includes the service provider corresponding to the identifiers of the 50 service providers A51, ... A100.

[0120] In the service preheating method provided in the embodiment of the present application, the preheating node compares the identifiers of multiple current service providers and the identifiers of the historical service providers received last time to determine the identifier of the newly added service provider, thereby determining that the service provider corresponding to the identifier of the newly added service provider is the newly added service provider. In the remote procedure call scenario, the real service of the newly added service provider is preheated in a timely and accurate manner, thereby improving the transaction success rate when the service provider is just started.

[0121] Figure 5 This is a flow chart of a service preheating method provided in an embodiment of the present application. In one embodiment, a service preheating method is applied to a registration center, and the method includes:

[0122] S501. Receive a subscription request sent by a preheating node; the subscription request includes a preheating service identifier.

[0123] Specifically, the registration center receives a subscription request sent by the preheating node, where the subscription request includes a preheating service identifier.

[0124] S502: Acquire preheating services corresponding to the preheating service identifiers issued by multiple current service providers.

[0125] Specifically, the registration center obtains preheating services published by multiple current service providers, wherein the preheating service corresponds to a preheating service identifier.

[0126] S503. When it is determined that the multiple current service providers include a newly added service provider, a notification message is sent to the preheating node, so that the preheating node calls the preheating service of the newly added service provider in turn using the custom callback function in the configuration file according to the notification message, so as to preheat the real service corresponding to the preheating service; the notification message includes the identifiers of the multiple current service providers.

[0127] Specifically, the preheating node compares the identifiers of multiple current service providers and the identifiers of the historical service providers received last time to determine the identifier of the newly added service provider, and judges that the service provider corresponding to the identifier of the newly added service provider is the newly added service provider. When the newly added service provider included in the multiple current service providers has been determined, the registration center sends a notification message to the preset node, and the notification message includes the identifiers of the multiple current service providers. Then, the preheating node sequentially uses the custom callback function in the configuration file to call the preheating service of the newly added service provider to preheat the real service corresponding to the preheating service.

[0128] The service preheating method provided in the embodiment of the present application, when it is determined that multiple current service providers include a newly added service provider, the registration center sends a notification message to the preheating node, and the preheating node calls the preheating service of the newly added service provider in turn using the custom callback function in the configuration file according to the notification message, so as to preheat the real service corresponding to the preheated service. Since the preheating service is only an alias of the real service, calling the preheating service is equivalent to calling the real service, and this call is a real remote procedure call, and the code at the communication level will also be called. Therefore, the service preheating in the remote procedure call scenario becomes more accurate and more timely, and the preheating scope is more comprehensive, which can effectively reduce the transaction failure rate when the service provider is just started.

[0129] In one embodiment, the method further comprises:

[0130] After receiving the preheating service issued by the newly added service provider, the real service issued by the newly added service provider is received after a first preset time delay.

[0131] Specifically, after receiving the preheating service published by the newly added service provider, the registration center delays for the first preset time, which means that after the first preset time, the service provider believes that the preheating node has completed the preheating process of the real service. In this case, the newly added service provider can publish the real service to the registration center, and correspondingly, the registration center receives the real service published by the newly added service provider. Since the real service is published after preheating, the real service delays registration. For example, in the common Dubbo framework, users can configure a delay attribute of 30 seconds for the real service, which means that after the process is started, wait 30 seconds before publishing the real service to the registration center. Therefore, the registration center receives the real service published by the newly added service provider, so that the newly added service provider can publish the real service in time.

[0132] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0133] Based on the same inventive concept, the embodiment of the present application also provides a service preheating device for implementing the service preheating method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more service preheating device embodiments provided below can refer to the limitations of the service preheating method above, and will not be repeated here.

[0134] Figure 6 1 is one of the structural diagrams of a service preheating device provided in an embodiment of the present application. The device is arranged at a preheating node. The device 600 includes:

[0135] The first receiving module 601 is used to receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0136] A first determining module 602, configured to determine a new service provider from among the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0137] The calling module 603 is used to sequentially call the preheating service of the newly added service provider by using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service.

[0138] In one embodiment, the device further comprises:

[0139] The first acquisition module is used to obtain the call information of calling the preheating service;

[0140] The first processing module is used to stop calling the preheating service if the calling information meets the preset conditions.

[0141] In one of the embodiments, the call information includes a total number of calls to the preheating service; the first processing module is specifically configured to stop calling the preheating service if the total number of calls is greater than or equal to a preset call number threshold.

[0142] In one of the embodiments, the call information in the service preheating device includes the average call duration of the most recent preset number of calls to the preheating service;

[0143] The first processing module is specifically used to stop calling the preheating service if the average calling duration is less than or equal to a preset duration threshold.

[0144] In one embodiment, the device further comprises:

[0145] A sending module is used for the preheating node to send a subscription request to the registration center; the subscription request includes the preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send the notification information to the preheating node when it is determined that the newly added service provider corresponding to the preheating service is online.

[0146] In one embodiment, the first determining module 602 includes:

[0147] A first determining unit, configured to compare the identifiers of multiple current service providers with the identifier of the historical service provider to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers;

[0148] The second determining unit is configured to use the current service provider corresponding to the identifier of the newly added service provider as the newly added service provider.

[0149] Figure 7 2 is a structural diagram of a service preheating device provided in an embodiment of the present application. The device is arranged in a registration center. The device 700 includes:

[0150] The first receiving module 701 is used to receive a subscription request sent by a preheating node; the subscription request includes a preheating service identifier;

[0151] An acquisition module 702 is used to acquire preheating services corresponding to the preheating service identifiers issued by multiple current service providers;

[0152] The sending module 703 is used to send notification information to the preheating node when it is determined that multiple current service providers include a newly added service provider, so that the preheating node can call the preheating service of the newly added service provider in turn using the custom callback function in the configuration file according to the notification information to preheat the real service corresponding to the preheating service; the notification information includes the identifiers of multiple current service providers.

[0153] In one embodiment, the apparatus further comprises:

[0154] The second receiving module is used to receive the real service published by the newly added service provider after delaying for a first preset time after receiving the preheating service published by the newly added service provider.

[0155] Each module in the above service preheating device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0156] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a communication 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 communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a service preheating method 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 covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0157] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application 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.

[0158] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0159] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0160] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0161] The custom callback function in the configuration file is used in turn to call the preheating service of the newly added service provider to preheat the real service corresponding to the preheating service.

[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0163] Get the call information of calling the preheating service;

[0164] If the call information meets the preset conditions, stop calling the preheating service.

[0165] In one embodiment, the call information includes the total number of calls to the preheating service; when the processor executes the computer program, the following steps are also implemented:

[0166] If the total number of calls is greater than or equal to the preset call number threshold, stop calling the preheating service.

[0167] In one embodiment, the call information includes the average call duration of the most recent preset number of calls to the preheating service; when the processor executes the computer program, the following steps are also implemented:

[0168] If the average call duration is less than or equal to the preset duration threshold, stop calling the preheating service.

[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0170] A subscription request is sent to the registration center; the subscription request includes the preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

[0171] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0172] Comparing the identifiers of the multiple current service providers with the identifiers of the historical service providers to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers;

[0173] The current service provider corresponding to the identifier of the newly added service provider is used as the newly added service provider.

[0174] In one embodiment, the processor further implements the following steps when executing the computer program:

[0175] Receive a subscription request sent by the preheating node; the subscription request includes a preheating service identifier;

[0176] Obtain preheating services corresponding to preheating service identifiers issued by multiple current service providers;

[0177] When it is determined that multiple current service providers include a newly added service provider, a notification message is sent to the preheating node, so that the preheating node, based on the notification message, sequentially calls the preheating service of the newly added service provider using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service; the notification message includes the identifiers of multiple current service providers.

[0178] In one embodiment, the processor further implements the following steps when executing the computer program:

[0179] After receiving the preheating service issued by the newly added service provider, the real service issued by the newly added service provider is received after a first preset time delay.

[0180] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0181] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0182] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0183] The custom callback function in the configuration file is used in turn to call the preheating service of the newly added service provider to preheat the real service corresponding to the preheating service.

[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0185] Get the call information of calling the preheating service;

[0186] If the call information meets the preset conditions, stop calling the preheating service.

[0187] In one embodiment, the call information includes the total number of calls to the preheating service; when the computer program is executed by the processor, the following steps are also implemented:

[0188] If the total number of calls is greater than or equal to the preset call number threshold, stop calling the preheating service.

[0189] In one embodiment, the call information includes the average call duration of the most recent preset number of calls to the preheating service; when the computer program is executed by the processor, the following steps are also implemented:

[0190] If the average call duration is less than or equal to the preset duration threshold, stop calling the preheating service.

[0191] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0192] A subscription request is sent to the registration center; the subscription request includes the preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0194] Comparing the identifiers of the multiple current service providers with the identifiers of the historical service providers to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers;

[0195] The current service provider corresponding to the identifier of the newly added service provider is used as the newly added service provider.

[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0197] Receive a subscription request sent by the preheating node; the subscription request includes a preheating service identifier;

[0198] Obtain preheating services corresponding to preheating service identifiers issued by multiple current service providers;

[0199] When it is determined that multiple current service providers include a newly added service provider, a notification message is sent to the preheating node, so that the preheating node, based on the notification message, sequentially calls the preheating service of the newly added service provider using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service; the notification message includes the identifiers of multiple current service providers.

[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0201] After receiving the preheating service issued by the newly added service provider, the real service issued by the newly added service provider is received after a first preset time delay.

[0202] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0203] Receive the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers;

[0204] Determine a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time;

[0205] The custom callback function in the configuration file is used in turn to call the preheating service of the newly added service provider to preheat the real service corresponding to the preheating service.

[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0207] Get the call information of calling the preheating service;

[0208] If the call information meets the preset conditions, stop calling the preheating service.

[0209] In one embodiment, the call information includes the total number of calls to the preheating service; when the computer program is executed by the processor, the following steps are also implemented:

[0210] If the total number of calls is greater than or equal to the preset call number threshold, stop calling the preheating service.

[0211] In one embodiment, the call information includes the average call duration of the most recent preset number of calls to the preheating service; when the computer program is executed by the processor, the following steps are also implemented:

[0212] If the average call duration is less than or equal to the preset duration threshold, stop calling the preheating service.

[0213] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0214] A subscription request is sent to the registration center; the subscription request includes the preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0216] Comparing the identifiers of the multiple current service providers with the identifiers of the historical service providers to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers;

[0217] The current service provider corresponding to the identifier of the newly added service provider is used as the newly added service provider.

[0218] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0219] Receive a subscription request sent by the preheating node; the subscription request includes a preheating service identifier;

[0220] Obtain preheating services corresponding to preheating service identifiers issued by multiple current service providers;

[0221] When it is determined that multiple current service providers include a newly added service provider, a notification message is sent to the preheating node, so that the preheating node, based on the notification message, sequentially calls the preheating service of the newly added service provider using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service; the notification message includes the identifiers of multiple current service providers.

[0222] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0223] After receiving the preheating service issued by the newly added service provider, the real service issued by the newly added service provider is received after a first preset time delay.

[0224] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0225] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0226] The technical features of the above embodiments may be combined arbitrarily. 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 this specification.

[0227] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A service preheating method, characterized in that: Applied to preheating a node, the method comprises: Receiving the current notification information sent by the registration center; the notification information includes the identifiers of multiple current service providers; the identifiers of the current service providers include the protocol address and port for interconnection between networks; Determining a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time; Using the custom callback function in the configuration file in turn to call the preheating service of the newly added service provider to preheat the real service corresponding to the preheating service; Wherein, the method further comprises: Send a subscription request to a registration center; the subscription request includes a preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send the notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining call information for calling the preheating service; If the calling information meets the preset condition, the calling of the preheating service is stopped.

3. The method according to claim 2, characterized in that The call information includes the total number of calls to the preheating service; If the calling information meets the preset condition, then stopping calling the preheating service includes: If the total number of calls is greater than or equal to a preset number of calls threshold, the preheating service is stopped.

4. The method according to claim 2, characterized in that: The calling information includes an average calling duration of the most recent preset calling times of calling the preheating service; if the calling information meets a preset condition, stopping calling the preheating service includes: If the average calling duration is less than or equal to the preset duration threshold, the calling of the preheating service is stopped.

5. The method according to any one of claims 1 to 4, characterized in that: The step of determining a new service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time includes: Comparing the identifiers of the multiple current service providers with the identifiers of the historical service providers to determine the identifier of the newly added service provider from among the identifiers of the multiple current service providers; The current service provider corresponding to the identifier of the newly added service provider is used as the newly added service provider.

6. A service preheating method, characterized in that: Applied to a registration center, the method comprises: Receiving a subscription request sent by a preheating node; the subscription request includes a preheating service identifier; Acquire preheating services corresponding to the preheating service identifiers issued by multiple current service providers; When it is determined that the multiple current service providers include a newly added service provider, a notification message is sent to the preheating node, so that the preheating node calls the preheating service of the newly added service provider in turn using the custom callback function in the configuration file according to the notification message, so as to preheat the real service corresponding to the preheating service; the notification message includes the identifiers of the multiple current service providers; the identifier of the current service provider includes the protocol address and port for interconnection between networks.

7. The method according to claim 6, characterized in that The method further comprises: After receiving the preheating service published by the newly added service provider, the real service published by the newly added service provider is received after a first preset time delay.

8. A service preheating device, characterized in that: The device is arranged at a preheating node, and comprises: The first receiving module is used to receive the current notification information sent by the registration center; the notification information includes multiple identifiers of current service providers; the identifiers of the current service providers include the protocol address and port of the interconnection between networks; A first determining module, configured to determine a newly added service provider from the multiple current service providers according to the identifiers of the multiple current service providers and the identifier of the historical service provider received last time; A calling module, used to call the preheating service of the newly added service provider in sequence by using the custom callback function in the configuration file, so as to preheat the real service corresponding to the preheating service; A sending module, used for sending a subscription request to a registration center; the subscription request includes a preheating service identifier of the preheating service; the preheating service identifier is used to instruct the registration center to send the notification information to the preheating node when determining that the newly added service provider corresponding to the preheating service is online.

9. A service preheating device, characterized in that: The device is arranged in a registration center, and comprises: A first receiving module, configured to receive a subscription request sent by a preheating node; the subscription request includes a preheating service identifier; An acquisition module, used for acquiring preheating services corresponding to the preheating service identifier issued by multiple current service providers; A sending module is used to send notification information to the preheating node when it is determined that the multiple current service providers include a newly added service provider, so that the preheating node can call the preheating service of the newly added service provider in turn according to the notification information using the custom callback function in the configuration file to preheat the real service corresponding to the preheating service; the notification information includes the identifiers of the multiple current service providers; the identifier of the current service provider includes the protocol address and port for interconnection between networks.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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 7 are implemented.

12. A computer program product, comprising a computer program, 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 7 are implemented.