







技术领域technical field
本公开涉及网络技术领域,具体涉及服务预热方法、设备、介质及产品。The present disclosure relates to the field of network technologies, and in particular, to a service preheating method, device, medium and product.
背景技术Background technique
随着计算机技术的不断发展,近年来,相关服务的软件架构也不断向微服务方向演进,从而将相关服务的功能单元按照独立部署和发布的标准进行抽取和隔离,以提高相关服务的可靠性,并降低对相关服务的管理难度。在实际应用中,考虑到对于刚启动的服务如果瞬间引入大量线上真实流量,则可能导致服务在较大流量的冲击下响应过慢,进而可能导致大量请求阻塞,甚至可能导致承载服务的节点宕机,从而导致服务的可靠性下降,因此,对于刚启动的服务可以先利用小流量进行预热,即在刚启动时限制服务的流量上限,以提高服务的稳定性。With the continuous development of computer technology, in recent years, the software architecture of related services has also continued to evolve towards micro-services, so that the functional units of related services are extracted and isolated according to the standards of independent deployment and release, so as to improve the reliability of related services. , and reduce the management difficulty of related services. In practical applications, considering that a large amount of online real traffic is instantly introduced to a service that has just been started, it may cause the service to respond too slowly under the impact of large traffic, which may cause a large number of requests to be blocked, and may even lead to the node hosting the service. Downtime will lead to a decrease in the reliability of the service. Therefore, the service that has just been started can be warmed up with a small amount of traffic, that is, the upper limit of the traffic of the service is limited when it is just started, so as to improve the stability of the service.
在上述方案中,虽然对于刚启动的服务先利用小流量进行预热可以有效提高服务的稳定性,但在预热过程中,服务的流量上限是不断上升的,直至上升至服务正常工作时的流量上限,若流量上限上升速度过慢、预热过程所占用的时间过长,则可能导致服务从启动至正常工作需较长时间,降低了服务的工作效率;若预热过程所占用的时间过短、流量上限上升速度过快,则可能无法有效降低对流量对服务产生的冲击,使预热效果较差。因此相关技术中,无法确保在有效降低流量所产生冲击的前提下,尽量减少预热过程所占用的时间。In the above solution, although preheating the service that has just started with a small flow rate can effectively improve the stability of the service, during the preheating process, the upper limit of the service flow continues to rise until it reaches the normal operating time of the service. Traffic upper limit. If the traffic upper limit rises too slowly and the warm-up process takes too long, it may take a long time for the service to start to work normally, reducing the work efficiency of the service; if the warm-up process takes too long If it is too short and the rate of increase of the traffic limit is too fast, it may not be able to effectively reduce the impact on the service caused by the traffic, resulting in poor preheating effect. Therefore, in the related art, it cannot be ensured that the time occupied by the preheating process can be minimized on the premise of effectively reducing the impact generated by the flow.
发明内容SUMMARY OF THE INVENTION
为了解决相关技术中的问题,本公开实施例提供了服务预热方法、设备、介质及产品。In order to solve the problems in the related art, the embodiments of the present disclosure provide a service preheating method, device, medium and product.
第一方面,本公开实施例中提供了一种服务预热方法,所述方法应用于服务预热控制端,所述方法包括:In a first aspect, an embodiment of the present disclosure provides a service preheating method, the method is applied to a service preheating control terminal, and the method includes:
获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,服务预热规则信息用于指示对应的服务实例的预热过程的规则,服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态;Obtain service preheating rule information corresponding to at least one service instance to be preheated, and receive service instance resource information corresponding to at least one service instance to be preheated. The service preheating rule information is used to indicate the preheating process of the corresponding service instance The service instance resource information is used to indicate the resource status of the resource corresponding to the corresponding service instance on the node used to carry the corresponding service instance before the warm-up process;
根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,预热控制信息用于指示在预热过程中的不同时刻,对应的服务实例与流量上限之间的对应关系;Obtain the warm-up control information corresponding to at least one service instance to be warmed up according to the service warm-up rule information and the service instance resource information. The warm-up control information is used to indicate the corresponding service instance and the traffic limit at different times during the warm-up process. Correspondence between;
发送预热控制信息。Send warm-up control information.
在本公开的一种实现方式中,其中,服务预热规则信息包括服务实例批次信息、服务实例启动信息以及批次间隔信息中至少一项,服务实例批次信息用于指示在预热过程中对应的服务实例与预热批次之间的对应关系,服务实例启动信息用于指示对应的服务实例与启动时长之间的对应关系,批次间隔信息用于指示预热过程中至少两个预热批次之间间隔的时长。In an implementation manner of the present disclosure, the service warm-up rule information includes at least one item of service instance batch information, service instance startup information, and batch interval information, and the service instance batch information is used to indicate that during the warm-up process The corresponding relationship between the corresponding service instance and the warm-up batch in The length of time between warmup batches.
在本公开的一种实现方式中,其中,资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项。In one implementation of the present disclosure, the resource status includes processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second.
在本公开的一种实现方式中,其中,根据服务预热规则信息以及服务实例资源信息获取预热控制信息,包括:In an implementation manner of the present disclosure, obtaining preheating control information according to service preheating rule information and service instance resource information includes:
获取预先训练得到的目标预热控制模型,将服务预热规则信息以及服务实例资源信息作为输入,输入目标预热控制模型,以获取输出的预热控制信息。Obtain the pre-trained target warm-up control model, take the service warm-up rule information and service instance resource information as input, and input the target warm-up control model to obtain the output warm-up control information.
在本公开的一种实现方式中,其中,获取服务预热规则信息,并接收服务实例资源信息之前,方法还包括:In an implementation manner of the present disclosure, before acquiring service preheating rule information and receiving service instance resource information, the method further includes:
获取预热历史数据,预热历史数据包括至少一个已预热的服务实例对应的服务预热规则信息、服务实例资源信息、预热控制信息以及预热效果信息,预热效果信息用于指示在预热过程中的不同时刻,承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,以及预热过程的时长;Obtain preheating historical data, which includes service preheating rule information, service instance resource information, preheating control information, and preheating effect information corresponding to at least one preheated service instance, and the preheating effect information is used to indicate At different times during the warm-up process, the resource status of the resource corresponding to the corresponding service instance on the node carrying the corresponding service instance, and the duration of the warm-up process;
在预热历史数据中确定预热效果信息满足目标预热效果要求的目标预热历史数据;In the preheating historical data, determine the target preheating historical data whose preheating effect information meets the requirements of the target preheating effect;
获取预热控制模型,并将目标预热历史数据中的服务预热规则信息以及服务实例资源信息作为输入,将目标预热历史数据中的预热控制信息作为输出,对预热控制模型进行训练,以获取目标预热控制模型。Obtain the preheating control model, use the service preheating rule information and service instance resource information in the target preheating historical data as input, and use the preheating control information in the target preheating historical data as output to train the preheating control model , to obtain the target warm-up control model.
第二方面,本公开实施例中提供了一种服务预热方法,其中,所述方法应用于服务预热执行端,所述方法包括:In a second aspect, an embodiment of the present disclosure provides a service preheating method, wherein the method is applied to a service preheating executor, and the method includes:
采集服务实例资源信息,并发送服务实例资源信息,服务实例资源信息用于指示用于承载服务实例的节点上与服务实例对应资源的资源状态;Collect service instance resource information, and send the service instance resource information, where the service instance resource information is used to indicate the resource status of the resource corresponding to the service instance on the node used to carry the service instance;
接收预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。Receive the pre-warming control information, and control the upper limit of the traffic of the pre-warmed service instance according to the pre-warming control information and the current moment.
在本公开的一种实现方式中,其中,资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项。In one implementation of the present disclosure, the resource status includes processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second.
第三方面,本公开实施例中提供了一种服务预热装置,所述装置包括:In a third aspect, an embodiment of the present disclosure provides a service preheating apparatus, and the apparatus includes:
规则信息获取模块,被配置为获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,服务预热规则信息用于指示对应的服务实例的预热过程的规则,服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态;The rule information acquisition module is configured to acquire service preheating rule information corresponding to at least one service instance to be preheated, and receive service instance resource information corresponding to at least one service instance to be preheated, and the service preheating rule information is used to indicate The rules for the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate the resource status of the resource corresponding to the corresponding service instance on the node used to carry the corresponding service instance before the warm-up process;
控制信息获取模块,被配置为根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,预热控制信息用于指示在预热过程中的不同时刻,对应的服务实例与流量上限之间的对应关系;The control information acquisition module is configured to acquire preheating control information corresponding to at least one service instance to be preheated according to the service preheating rule information and the service instance resource information, and the preheating control information is used to indicate different moments in the preheating process , the correspondence between the corresponding service instance and the traffic limit;
控制信息发送模块,被配置为发送预热控制信息。The control information sending module is configured to send the preheating control information.
第四方面,本公开实施例中提供了一种服务预热装置,所述装置包括:In a fourth aspect, an embodiment of the present disclosure provides a service preheating device, the device comprising:
资源信息发送模块,被配置为采集服务实例资源信息,并发送服务实例资源信息,服务实例资源信息用于指示用于承载服务实例的节点上与服务实例对应资源的资源状态;The resource information sending module is configured to collect service instance resource information and send the service instance resource information, where the service instance resource information is used to indicate the resource status of the resource corresponding to the service instance on the node used to carry the service instance;
预热控制模块,被配置为接收预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。The preheating control module is configured to receive the preheating control information, and control the upper limit of the traffic of the preheated service instance according to the preheating control information and the current moment.
第五方面,本公开实施例中提供了一种电子设备,包括存储器和至少一个处理器;存储器用于存储一条或多条计算机指令,一条或多条计算机指令被至少一个处理器执行以实现第一方面、第一方面的任一种实现方式、第二方面、第二方面的任一种实现方式中任一项所述的方法步骤。In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including a memory and at least one processor; the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by the at least one processor to implement the first In one aspect, any implementation manner of the first aspect, the second aspect, and any one implementation manner of the second aspect, the method steps described in any one.
第六方面,本公开实施例中提供了一种计算机可读存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现第一方面、第一方面的任一种实现方式、第二方面、第二方面的任一种实现方式中任一项所述的方法步骤。In a sixth aspect, the embodiments of the present disclosure provide a computer-readable storage medium on which computer instructions are stored, and when the computer instructions are executed by a processor, implement the first aspect, any implementation manner of the first aspect, and the first aspect. The method steps described in any one of the second aspect and any one of the implementation manners of the second aspect.
第七方面,本公开实施例中提供了一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行时实现第一方面、第一方面的任一种实现方式、第二方面、第二方面的任一种实现方式中任一项所述的方法步骤。In a seventh aspect, an embodiment of the present disclosure provides a computer program product, including computer instructions, which, when executed by a processor, implement the first aspect, any implementation manner of the first aspect, the second aspect, and the second aspect. The method steps of any one of the implementations of the aspect.
本公开实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
根据本公开实施例提供的技术方案,通过获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,并发送预热控制信息。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。According to the technical solutions provided by the embodiments of the present disclosure, by acquiring service preheating rule information corresponding to at least one service instance to be preheated, and receiving service instance resource information corresponding to at least one service instance to be preheated, according to the service preheating rules Information and Service Instance Resource Information Acquire warm-up control information corresponding to at least one service instance to be warmed up, and send the warm-up control information. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
根据本公开实施例提供的技术方案,通过限定服务预热规则信息包括服务实例批次信息、服务实例启动信息以及批次间隔信息中至少一项,可以细化对应的服务实例的预热过程的规则,便于对服务实例的预热过程的规则进行准确控制。According to the technical solutions provided by the embodiments of the present disclosure, by defining that the service preheating rule information includes at least one item of service instance batch information, service instance startup information, and batch interval information, the preheating process of the corresponding service instance can be refined. The rules are convenient to accurately control the rules of the warm-up process of the service instance.
根据本公开实施例提供的技术方案,通过限定资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项,可以确保能够根据资源状态较为清晰的获知相应节点上硬件的资源状态。According to the technical solutions provided by the embodiments of the present disclosure, the resource states include processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second, to ensure that the resource status of the hardware on the corresponding node can be clearly known according to the resource status.
根据本公开实施例提供的技术方案,通过获取预先训练得到的目标预热控制模型,将服务预热规则信息以及服务实例资源信息作为输入,输入目标预热控制模型,以获取输出的预热控制信息,可以确保所获取的预热控制信息的准确率较高。According to the technical solutions provided by the embodiments of the present disclosure, the target preheating control model obtained by pre-training is obtained, the service preheating rule information and the service instance resource information are used as inputs, and the target preheating control model is input to obtain the output preheating control model. information, which can ensure a high accuracy of the acquired preheating control information.
根据本公开实施例提供的技术方案,通过获取预热历史数据,并在预热历史数据中确定预热效果信息满足目标预热效果要求的目标预热历史数据,获取预热控制模型,并将目标预热历史数据中的服务预热规则信息以及服务实例资源信息作为输入,将目标预热历史数据中的预热控制信息作为输出,对预热控制模型进行训练,以获取目标预热控制模型,可以确保目标预热控制模型为学习到满足目标预热效果要求的预热过程对应的服务预热规则信息、服务实例资源信息与预热控制信息之间的规律,其中由于在满足目标预热效果要求的预热过程中,承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态为负载较低的状态,和/或该资源状态为稳定性较高的状态,且该预热过程的时长较短,因此在根据目标预热控制模型所输出的预热控制信息对服务实例进行预热时,该预热过程即能够满足输入该目标预热控制模型的服务预热规则信息,也不会对承载该服务实例的节点上与该服务实例对应资源造成较高的负担,和/或使该对应资源的稳定性较好,且预热时长较短。According to the technical solutions provided by the embodiments of the present disclosure, the preheating control model is obtained by acquiring the preheating historical data, and determining in the preheating historical data the target preheating historical data whose preheating effect information satisfies the requirements of the target preheating effect. The service preheating rule information and service instance resource information in the target preheating historical data are used as input, and the preheating control information in the target preheating historical data is used as output to train the preheating control model to obtain the target preheating control model , it can ensure that the target preheating control model is the law between the service preheating rule information, service instance resource information and preheating control information corresponding to the preheating process that meets the requirements of the target preheating effect. During the warm-up process required by the effect, the resource state of the resource corresponding to the corresponding service instance on the node hosting the corresponding service instance is a state of low load, and/or the state of the resource is a state of high stability, and the The duration of the thermal process is short, so when the service instance is preheated according to the preheating control information output by the target preheating control model, the preheating process can satisfy the service preheating rule information input to the target preheating control model. , it will not cause a higher burden on the node hosting the service instance and the resources corresponding to the service instance, and/or make the corresponding resources have better stability and shorter warm-up time.
根据本公开实施例提供的技术方案,通过采集服务实例资源信息,并发送服务实例资源信息,可以使服务预热控制端能够根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,从而接收服务预热控制端发送的预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。According to the technical solutions provided by the embodiments of the present disclosure, by collecting service instance resource information and sending the service instance resource information, the service preheating control terminal can obtain at least one to-be-warmed item according to the service preheating rule information and the service instance resource information. The preheating control information corresponding to the service instance is received, thereby receiving the preheating control information sent by the service preheating control terminal, and controlling the upper limit of the traffic of the preheated service instance according to the preheating control information and the current moment. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
根据本公开实施例提供的技术方案,通过限定资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项,可以确保能够根据资源状态较为清晰的获知相应节点上硬件的资源状态。According to the technical solutions provided by the embodiments of the present disclosure, the resource states include processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second, to ensure that the resource status of the hardware on the corresponding node can be clearly known according to the resource status.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
结合附图,通过以下非限制性实施方式的详细描述,本公开的其它特征、目的和优点将变得更加明显。在附图中:Other features, objects and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the attached image:
图1示出根据本公开一实施方式的服务预热系统的示意性结构图。FIG. 1 shows a schematic structural diagram of a service preheating system according to an embodiment of the present disclosure.
图2示出根据本公开一实施方式的服务预热方法的流程图。FIG. 2 shows a flowchart of a service warm-up method according to an embodiment of the present disclosure.
图3示出根据本公开一实施方式的服务预热方法的流程图。FIG. 3 shows a flowchart of a service warm-up method according to an embodiment of the present disclosure.
图4示出根据本公开一实施方式的服务预热系统的示意性框图FIG. 4 shows a schematic block diagram of a service warm-up system according to an embodiment of the present disclosure
图5示出根据本公开一实施方式的服务预热装置的结构框图。FIG. 5 shows a structural block diagram of a service preheating apparatus according to an embodiment of the present disclosure.
图6示出根据本公开一实施方式的服务预热装置的结构框图。FIG. 6 shows a structural block diagram of a service preheating apparatus according to an embodiment of the present disclosure.
图7示出根据本公开一实施方式的电子设备的结构框图。FIG. 7 shows a structural block diagram of an electronic device according to an embodiment of the present disclosure.
图8是适于用来实现根据本公开一实施方式的方法的计算机系统的结构示意图。FIG. 8 is a schematic structural diagram of a computer system suitable for implementing a method according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下文中,将参考附图详细描述本公开的示例性实施方式,以使本领域技术人员可容易地实现它们。此外,为了清楚起见,在附图中省略了与描述示例性实施方式无关的部分。Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. Also, for the sake of clarity, parts unrelated to describing the exemplary embodiments are omitted from the drawings.
在本公开中,应理解,诸如“包括”或“具有”等的术语旨在指示本说明书中所公开的标签、数字、步骤、行为、部件、部分或其组合的存在,并且不欲排除一个或多个其他标签、数字、步骤、行为、部件、部分或其组合存在或被添加的可能性。In the present disclosure, it should be understood that terms such as "comprising" or "having" are intended to indicate the presence of labels, numbers, steps, acts, components, parts, or combinations thereof disclosed in this specification, and are not intended to exclude a or multiple other labels, numbers, steps, acts, parts, sections, or combinations thereof may exist or be added.
另外还需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的标签可以相互组合。下面将参考附图并结合实施例来详细说明本公开。In addition, it should be noted that the embodiments in the present disclosure and the tags in the embodiments may be combined with each other under the condition of no conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
为了对服务进行预热,本公开发明人考虑了如下方案。In order to warm up the service, the inventors of the present disclosure have considered the following solutions.
根据预先设定的预热过程时长以及需启动的服务正常工作时的流量上限,以服务在预热开始时刻的流量上限为0,服务在预热结束时刻的流量上限为服务正常工作时的流量上限,对该服务在预热过程中不同时刻的流量上限进行计算,确保预热过程中该服务的流量上限能够匀速上升。According to the pre-set duration of the warm-up process and the upper limit of traffic when the service to be started is working normally, the upper limit of the traffic of the service at the start of the warm-up is 0, and the upper limit of the traffic of the service at the end of the warm-up is the traffic of the service when the service is working normally. Upper limit, calculate the upper limit of traffic of the service at different times during the warm-up process to ensure that the upper limit of the traffic of the service can increase at a constant speed during the warm-up process.
此方案的缺点:在上述方案中,虽然可以有效提高被预热的服务的稳定性,但由于预热过程时长往往是人为设定的,若预热过程时长被设置的较长,则可能导致服务从启动至正常工作需较长时间,降低了服务的工作效率;若预热过程时长被设置的较短,则可能导致流量上限上升速度过快,从而无法有效降低对流量对服务产生的冲击,使预热效果较差。因此上述方案无法确保在有效降低流量所产生冲击的前提下,尽量减少预热过程所占用的时间。Disadvantages of this solution: In the above solution, although the stability of the preheated service can be effectively improved, the preheating process duration is often set manually. If the preheating process duration is set longer, it may lead to It takes a long time for the service to start to work normally, which reduces the work efficiency of the service; if the warm-up process time is set to a short time, the upper limit of the traffic may increase too fast, so that the impact of the traffic on the service cannot be effectively reduced. , so that the preheating effect is poor. Therefore, the above solution cannot ensure that the time occupied by the preheating process can be minimized on the premise of effectively reducing the impact caused by the flow.
考虑以上方案的缺点,本公开发明人提出了新的方案:该方案通过获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,并发送预热控制信息。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。Considering the shortcomings of the above solutions, the inventor of the present disclosure proposes a new solution: this solution obtains service preheating rule information corresponding to at least one service instance to be preheated, and receives the service instance corresponding to at least one service instance to be preheated. Resource information: obtains the preheating control information corresponding to at least one service instance to be preheated according to the service preheating rule information and the service instance resource information, and sends the preheating control information. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
具体的,本公开提出服务预热方法、设备、介质及产品。Specifically, the present disclosure proposes a service preheating method, device, medium and product.
图1示出根据本公开一实施方式的服务预热系统的示意性结构图,如图1所示,服务预热系统包括服务预热控制端101以及服务预热执行端102。FIG. 1 shows a schematic structural diagram of a service preheating system according to an embodiment of the present disclosure. As shown in FIG. 1 , the service preheating system includes a service preheating
其中,服务预热控制端101以及服务预热执行端102Among them, the service preheating
在一些实施例中,服务预热控制端101以及服务预热执行端102可以为虚拟机,也可以为物理机。在一些实施例中,服务预热控制端101相对于服务预热执行端102,可以是本地的、也可以是远程的。例如,服务预热控制端101可以经由网络与用户端服务预热执行端102进行信息和/或数据的交互。In some embodiments, the service warm-up
需要说明的是,上述实施例中的物理机,可以理解为是相对于虚拟机而言对实体计算机的命名。物理机可以提供给虚拟机以硬件环境。示例性的,物理机可以包括移动设备、平板计算机、膝上型计算机、或机动车辆中的内置设备等,或其任意组合;在一些实施例中,移动设备可以包括智能家居设备、可穿戴设备、智能移动设备、虚拟现实设备、或增强现实设备等,或其任意组合;在一些实施例中,智能移动设备可以包括智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏设备、导航设备、或销售点(point of sale,POS)设备等,或其任意组合。It should be noted that, the physical machine in the above-mentioned embodiment can be understood as a naming of a physical computer relative to a virtual machine. A physical machine can provide a hardware environment to a virtual machine. Illustratively, physical machines may include mobile devices, tablet computers, laptop computers, or built-in devices in motor vehicles, etc., or any combination thereof; in some embodiments, mobile devices may include smart home devices, wearable devices , smart mobile devices, virtual reality devices, or augmented reality devices, etc., or any combination thereof; in some embodiments, smart mobile devices may include smart phones, personal digital assistants (Personal Digital Assistant, PDA), game devices, navigation devices , or a point of sale (POS) device, etc., or any combination thereof.
上述实施例中的虚拟机,可以被理解为运行在虚拟化平台的虚拟化层。示例性的,在云计算平台,虚拟机可以是在集群服务器上通过所述虚拟化技术划分出来的一个或多个独立主机(即云主机)或者一个或多个独立服务器(即云服务器);在其他虚拟化系统或者平台中,虚拟机可以是一个或者多个物理主机上采用所述虚拟化技术实现的一个或多个虚拟主机,或者可以是一个或者多个物理服务器上采用所述虚拟化技术实现的一个或多个虚拟专用服务器。其中,云计算平台可以包括私有云、公有云、混合云、社区云(communitycloud)、分布式云、跨云(inter-cloud)、多云(multi-cloud)等,或者它们的任意组合。The virtual machine in the above embodiment can be understood as running on the virtualization layer of the virtualization platform. Exemplarily, on a cloud computing platform, the virtual machine may be one or more independent hosts (ie cloud hosts) or one or more independent servers (ie cloud servers) divided by the virtualization technology on the cluster server; In other virtualization systems or platforms, the virtual machine may be one or more virtual hosts implemented by using the virtualization technology on one or more physical hosts, or may be one or more physical servers using the virtualization technology One or more virtual private servers implemented by technology. The cloud computing platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, etc., or any combination thereof.
上述实施例中的网络,可以用于信息和/或数据的交换。在一些实施例中,网络可以是任何类型的有线或者无线网络,或者是他们的结合。仅作为示例,网络可以包括有线网络、无线网络、光纤网络、远程通信网络、内联网、因特网、局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)、无线局域网(Wireless Local Area Networks,WLAN)、城域网(Metropolitan Area Network,MAN)、广域网(Wide Area Network,WAN)、公共电话交换网(Public Switched Telephone Network,PSTN)、蓝牙网络、ZigBee网络、或近场通信(Near Field Communication,NFC)网络等,或其任意组合。The network in the above-mentioned embodiment can be used for the exchange of information and/or data. In some embodiments, the network may be any type of wired or wireless network, or a combination thereof. By way of example only, networks may include wired networks, wireless networks, fiber optic networks, telecommunications networks, intranets, the Internet, Local Area Networks (LANs), Wide Area Networks (WANs), Wireless Local Area Networks (Wireless Local Area Networks) , WLAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), Public Switched Telephone Network (PSTN), Bluetooth network, ZigBee network, or Near Field Communication (Near Field Communication) Communication, NFC) network, etc., or any combination thereof.
图2示出根据本公开一实施方式的服务预热方法的流程图,该方法应用于服务预热控制端,如图2所示,服务预热方法包括步骤S101-S103。FIG. 2 shows a flowchart of a service preheating method according to an embodiment of the present disclosure, the method is applied to a service preheating control terminal. As shown in FIG. 2 , the service preheating method includes steps S101-S103.
在步骤S101中,获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息。In step S101, the service warm-up rule information corresponding to the at least one service instance to be warmed up is obtained, and the service instance resource information corresponding to the at least one service instance to be warmed up is received.
其中,服务预热规则信息用于指示对应的服务实例的预热过程的规则,服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态。The service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node used to carry the corresponding service instance corresponds to the corresponding service instance The resource state of the resource.
在步骤S102中,根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息。In step S102, preheating control information corresponding to at least one service instance to be preheated is acquired according to the service preheating rule information and the service instance resource information.
其中,预热控制信息用于指示在预热过程中的不同时刻,对应的服务实例与流量上限之间的对应关系。The preheating control information is used to indicate the corresponding relationship between the corresponding service instance and the traffic upper limit at different times during the preheating process.
在步骤S103中,发送预热控制信息。In step S103, preheating control information is transmitted.
在本公开的一种实施方式中,服务实例可以理解为由节点承载的,用于提供对应服务的功能模块。其中,服务可以理解为与应用程序的具体功能对应。示例性的,当应用程序是支付类应用时,扫码、转账以及提现等功能可以理解为该应用下的服务。在实际部署中,一个服务往往对应多个服务实例,其中多个服务实例可以完全对等的,即一个服务实例完全可以替代另一个服务实例。节点可以被理解为,承载有相应数据以及应用程序、具备数据处理功能的设备。节点可以包括但不限于个人电脑(Personal Computer,PC)、平板电脑、笔记本电脑、移动通讯终端、可穿戴设备、语音交互设备及服务器等。其中,服务器可以为独立的物理服务器,也可以为由多个物理服务器构成的服务器集群或者分布式系统,也可以为用于提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台中至少一项服务的云计算系统中的服务器。In an embodiment of the present disclosure, a service instance may be understood as a functional module carried by a node and used to provide a corresponding service. Among them, the service can be understood as corresponding to the specific function of the application. Exemplarily, when the application is a payment application, functions such as code scanning, transfer, and cash withdrawal can be understood as services under the application. In actual deployment, a service often corresponds to multiple service instances, and multiple service instances can be completely equivalent, that is, one service instance can completely replace another service instance. A node can be understood as a device that carries corresponding data and application programs and has data processing functions. Nodes may include, but are not limited to, personal computers (Personal Computers, PCs), tablet computers, notebook computers, mobile communication terminals, wearable devices, voice interaction devices, servers, and the like. The server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a server used to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, and network services. , cloud communication, middleware service, domain name service, security service, content delivery network (Content Delivery Network, CDN), and a server in a cloud computing system for at least one service in a big data and artificial intelligence platform.
在本公开的一种实施方式中,获取服务预热规则信息,可以理解为接收用户端发送的服务预热规则信息,也可以理解为从数据库中读取事先储存的服务预热规则信息。其中,用户可以通过用户端的人机交互装置例如键盘、鼠标、麦克风等输入该服务预热规则信息。In an embodiment of the present disclosure, acquiring the service preheating rule information can be understood as receiving the service preheating rule information sent by the client, or it can be understood as reading the pre-stored service preheating rule information from the database. Wherein, the user can input the service preheating rule information through a human-computer interaction device such as a keyboard, a mouse, a microphone, etc. on the user side.
在本公开的一种实施方式中,接收服务实例资源信息,可以理解为接收服务预热执行端发送的服务实例资源信息,也可以理解为接收其他装置或系统转发的服务实例资源信息。其中,服务预热执行端可以对承载对应的服务实例的节点进行检测,以获取该节点上与对应的服务实例对应资源的资源状态。In an embodiment of the present disclosure, receiving service instance resource information can be understood as receiving service instance resource information sent by a service warm-up execution end, or receiving service instance resource information forwarded by other devices or systems. The service warm-up execution end may detect the node bearing the corresponding service instance, so as to obtain the resource status of the resource corresponding to the corresponding service instance on the node.
在本公开的一种实施方式中,节点上与对应的服务实例对应的资源,可以理解为,节点上用于支持对应的服务实例运行的全部或部分资源,其中,所述资源可以被理解为硬件资源,也可以被理解为软件资源。示例性的,当某个节点承载有一个服务实例,即该节点与该节点承载的服务实例一一对应时,该节点上的全部资源可以被理解为与该节点承载的服务实例对应的资源;当节点承载有两个服务实例,且该节点包括两个能够单独支持服务实例运行的资源单元时,该节点上的一个资源单元中的资源可以被理解为与两个服务实例中的一个服务实例对应的资源,该节点上的另一个资源单元中的资源可以被理解为与两个服务实例中的另一个服务实例对应的资源。In an embodiment of the present disclosure, the resources corresponding to the corresponding service instances on the nodes can be understood as all or part of the resources used to support the operation of the corresponding service instances on the nodes, wherein the resources can be understood as Hardware resources can also be understood as software resources. Exemplarily, when a node carries a service instance, that is, when the node corresponds to the service instance carried by the node one-to-one, all resources on the node can be understood as resources corresponding to the service instance carried by the node; When a node hosts two service instances, and the node includes two resource units that can independently support the running of the service instances, the resources in one resource unit on the node can be understood as the same as one service instance in the two service instances. Corresponding resources, resources in another resource unit on the node can be understood as resources corresponding to another service instance in the two service instances.
在本公开的一种实施方式中,资源状态,可以理解为用于指示对应的资源被占用的程度,也可以理解为对应的资源能够用于支持对应服务实例运行的能力等。In an embodiment of the present disclosure, the resource status can be understood as indicating the degree of occupation of the corresponding resource, and can also be understood as the capability of the corresponding resource to support the running of the corresponding service instance.
在本公开的一种实施方式中,根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,可以理解为将服务预热规则信息以及服务实例资源信息代入预先获取的预热控制算法进行计算,以获取待预热的至少一个服务实例对应的预热控制信息,也可以理解为向其他装置或系统发送服务预热规则信息以及服务实例资源信息,并接收其他装置或系统根据服务预热规则信息以及服务实例资源信息获取的待预热的至少一个服务实例对应的预热控制信息。In an embodiment of the present disclosure, obtaining the preheating control information corresponding to at least one service instance to be preheated according to the service preheating rule information and the service instance resource information can be understood as obtaining the service preheating rule information and the service instance resources The information is substituted into the pre-acquired preheating control algorithm for calculation to obtain the preheating control information corresponding to at least one service instance to be preheated, which can also be understood as sending service preheating rule information and service instance resource information to other devices or systems, And receive the preheating control information corresponding to at least one service instance to be preheated obtained by other devices or systems according to the service preheating rule information and the service instance resource information.
在本公开的一种实施方式中,预热控制信息所指示的预热过程中的不同时刻,对应的服务实例与流量上限之间的对应关系中,该流量上限可以被理解为具体的流量上限值,也可以被理解为与预设的目标流量上限值之间的流量上限值比率,其中目标流量上限值可以被理解为对服务实例的预热结束后,服务实例正常工作时能够处理的流量的上限值。示例性的,可以根据计算流量上限值比率f(x),其中k为预设的固定参数,startTime是为预热开始时刻,warmupTime为预设的预热时长。In an embodiment of the present disclosure, in the correspondence between the corresponding service instance and the traffic upper limit at different times during the preheating process indicated by the preheating control information, the traffic upper limit can be understood as the specific traffic The limit value can also be understood as the ratio of the upper limit value of traffic to the preset upper limit value of target traffic, where the upper limit value of target flow can be understood as after the warm-up of the service instance is completed, when the service instance is working normally The upper limit of the flow that can be handled. Exemplary, according to Calculate the flow upper limit ratio f(x), where k is a preset fixed parameter, startTime is the start time of warm-up, and warmupTime is the preset warm-up duration.
根据本公开实施例提供的技术方案,通过获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,并发送预热控制信息。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。According to the technical solutions provided by the embodiments of the present disclosure, by acquiring service preheating rule information corresponding to at least one service instance to be preheated, and receiving service instance resource information corresponding to at least one service instance to be preheated, according to the service preheating rules Information and Service Instance Resource Information Acquire warm-up control information corresponding to at least one service instance to be warmed up, and send the warm-up control information. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
在本公开的一种实现方式中,服务预热规则信息包括服务实例批次信息、服务实例启动信息以及批次间隔信息中至少一项,服务实例批次信息用于指示在预热过程中对应的服务实例与预热批次之间的对应关系,服务实例启动信息用于指示对应的服务实例与启动时长之间的对应关系,批次间隔信息用于指示预热过程中至少两个预热批次之间间隔的时长。In an implementation of the present disclosure, the service preheating rule information includes at least one item of service instance batch information, service instance startup information, and batch interval information, and the service instance batch information is used to indicate the corresponding The corresponding relationship between the service instance and the warm-up batch, the service instance startup information is used to indicate the corresponding relationship between the corresponding service instance and the startup duration, and the batch interval information is used to indicate at least two warm-ups during the warm-up process. The length of time between batches.
在本公开的一种实施方式中,在预热过程中,可以在不同的时刻分批对不同的服务实例开始预热,其中在同一时刻开始预热的服务实例,可以被理解为属于同一个预热批次。In an embodiment of the present disclosure, during the preheating process, different service instances can be preheated in batches at different times, and the service instances that start preheating at the same time can be understood as belonging to the same Warm up the batch.
在本公开的一种实施方式中,启动时长,可以理解为从服务实例被触发的时刻至该服务实例能够正常工作的时刻的时长。In an embodiment of the present disclosure, the startup duration can be understood as the duration from the moment when the service instance is triggered to the moment when the service instance can work normally.
根据本公开实施例提供的技术方案,通过限定服务预热规则信息包括服务实例批次信息、服务实例启动信息以及批次间隔信息中至少一项,可以细化对应的服务实例的预热过程的规则,便于对服务实例的预热过程的规则进行准确控制。According to the technical solutions provided by the embodiments of the present disclosure, by defining that the service preheating rule information includes at least one item of service instance batch information, service instance startup information, and batch interval information, the preheating process of the corresponding service instance can be refined. The rules are convenient to accurately control the rules of the warm-up process of the service instance.
在本公开的一种实现方式中,其中,资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项。In one implementation of the present disclosure, the resource status includes processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second.
根据本公开实施例提供的技术方案,通过限定资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项,可以确保能够根据资源状态较为清晰的获知相应节点上硬件的资源状态。According to the technical solutions provided by the embodiments of the present disclosure, the resource states include processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second, to ensure that the resource status of the hardware on the corresponding node can be clearly known according to the resource status.
在本公开的一种实现方式中,在步骤S102中,根据服务预热规则信息以及服务实例资源信息获取预热控制信息,可以通过如下步骤实现:In an implementation manner of the present disclosure, in step S102, obtaining the preheating control information according to the service preheating rule information and the service instance resource information may be implemented by the following steps:
获取预先训练得到的目标预热控制模型,将服务预热规则信息以及服务实例资源信息作为输入,输入目标预热控制模型,以获取输出的预热控制信息。Obtain the pre-trained target warm-up control model, take the service warm-up rule information and service instance resource information as input, and input the target warm-up control model to obtain the output warm-up control information.
在本公开的一种实施方式中,目标预热控制模型,可以为长短期记忆网络(longshortterm memory,LSTM)模型、随机森林(Random forest,RF)模型、极端梯度提升(eXtreme Gradient Boosting,xgboost)模型、变换器(Transformer)模型等。目标预热控制模型可以为预先获取的,也可以为从其他装置或系统处获取。In an embodiment of the present disclosure, the target warm-up control model may be a long short term memory (LSTM) model, a random forest (RF) model, and an eXtreme Gradient Boosting (xgboost) model. model, Transformer model, etc. The target preheating control model may be pre-acquired, or may be acquired from other devices or systems.
根据本公开实施例提供的技术方案,通过获取预先训练得到的目标预热控制模型,将服务预热规则信息以及服务实例资源信息作为输入,输入目标预热控制模型,以获取输出的预热控制信息,可以确保所获取的预热控制信息的准确率较高。According to the technical solutions provided by the embodiments of the present disclosure, the target preheating control model obtained by pre-training is obtained, the service preheating rule information and the service instance resource information are used as inputs, and the target preheating control model is input to obtain the output preheating control model. information, which can ensure a high accuracy of the acquired preheating control information.
在本公开的一种实现方式中,在步骤S101中,获取服务预热规则信息,并接收服务实例资源信息之前,方法还包括如下步骤:In an implementation manner of the present disclosure, in step S101, before acquiring service preheating rule information and receiving service instance resource information, the method further includes the following steps:
获取预热历史数据,预热历史数据包括至少一个已预热的服务实例对应的服务预热规则信息、服务实例资源信息、预热控制信息以及预热效果信息,预热效果信息用于指示在预热过程中的不同时刻,承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,以及预热过程的时长;Obtain preheating historical data, which includes service preheating rule information, service instance resource information, preheating control information, and preheating effect information corresponding to at least one preheated service instance, and the preheating effect information is used to indicate At different times during the warm-up process, the resource status of the resource corresponding to the corresponding service instance on the node carrying the corresponding service instance, and the duration of the warm-up process;
在预热历史数据中确定预热效果信息满足目标预热效果要求的目标预热历史数据;In the preheating historical data, determine the target preheating historical data whose preheating effect information meets the requirements of the target preheating effect;
获取预热控制模型,并将目标预热历史数据中的服务预热规则信息以及服务实例资源信息作为输入,将目标预热历史数据中的预热控制信息作为输出,对预热控制模型进行训练,以获取目标预热控制模型。Obtain the preheating control model, use the service preheating rule information and service instance resource information in the target preheating historical data as input, and use the preheating control information in the target preheating historical data as output to train the preheating control model , to obtain the target warm-up control model.
在本公开的一种实施方式中,已预热的服务实例,可以被理解为已完成预热,其能够处理的流量的上限为服务实例正常工作时能够处理的流量的上限。In an embodiment of the present disclosure, a preheated service instance can be understood as having completed preheating, and the upper limit of the traffic that can be handled is the upper limit of the traffic that the service instance can handle when it is working normally.
在本公开的一种实施方式中,在预热历史数据中确定预热效果信息满足目标预热效果要求的目标预热历史数据,可以被理解为预热过程的时长小于或等于预设时长,且在预热过程中,承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态为负载较低的状态,和/或该资源状态为稳定性较高的状态。示例性的,资源的资源状态为负载较低的状态,可以被理解为处理器占用率小于或等于目标处理器占用率、处理器占用量小于或等于目标处理器占用量、带宽占用率小于或等于目标带宽占用率、带宽占用量小于或等于目标带宽占用量、内存占用率小于或等于目标内存占用率、内存占用量小于或等于目标内存占用量、磁盘空间占用量小于或等于目标磁盘空间占用量、磁盘空间占用率小于或等于目标磁盘空间占用率、每秒查询率大于或等于目标每秒查询率中至少一项。其中,处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率较低时,对应资源的资源状态为负载较低的状态,而每秒查询率较高时,对应资源的资源状态为稳定性较高的状态。In an embodiment of the present disclosure, the target preheating historical data whose preheating effect information meets the requirements of the target preheating effect in the preheating historical data can be understood as the preheating process duration is less than or equal to the preset duration, And during the warm-up process, the resource state of the resource corresponding to the corresponding service instance on the node bearing the corresponding service instance is a state of low load, and/or the state of the resource is a state of high stability. Exemplarily, the resource state of the resource is a low load state, which can be understood as the processor occupancy rate is less than or equal to the target processor occupancy rate, the processor occupancy rate is less than or equal to the target processor occupancy rate, and the bandwidth occupancy rate is less than or equal to the target processor occupancy rate. Equal to target bandwidth usage, bandwidth usage less than or equal to target bandwidth usage, memory usage less than or equal to target memory usage, memory usage less than or equal to target memory usage, disk space usage less than or equal to target disk space usage At least one of the amount, the disk space usage rate is less than or equal to the target disk space usage rate, and the query rate per second is greater than or equal to the target query rate per second. Among them, when processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy are low, the resource status of the corresponding resource is low load state, and when the query rate per second is high, the resource state of the corresponding resource is a state with high stability.
在本公开的一种实施方式中,预热控制模型,可以为长短期记忆网络模型、随机森林模型、极端梯度提升模型、变换器模型等。预热控制模型可以为预先获取的,也可以为从其他装置或系统处获取。In an embodiment of the present disclosure, the warm-up control model may be a long short-term memory network model, a random forest model, an extreme gradient boosting model, a converter model, or the like. The preheating control model may be pre-acquired, or may be acquired from other devices or systems.
根据本公开实施例提供的技术方案,通过获取预热历史数据,并在预热历史数据中确定预热效果信息满足目标预热效果要求的目标预热历史数据,获取预热控制模型,并将目标预热历史数据中的服务预热规则信息以及服务实例资源信息作为输入,将目标预热历史数据中的预热控制信息作为输出,对预热控制模型进行训练,以获取目标预热控制模型,可以确保目标预热控制模型为学习到满足目标预热效果要求的预热过程对应的服务预热规则信息、服务实例资源信息与预热控制信息之间的规律,其中由于在满足目标预热效果要求的预热过程中,承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态为负载较低的状态,和/或该资源状态为稳定性较高的状态,且该预热过程的时长较短,因此在根据目标预热控制模型所输出的预热控制信息对服务实例进行预热时,该预热过程即能够满足输入该目标预热控制模型的服务预热规则信息,也不会对承载该服务实例的节点上与该服务实例对应资源造成较高的负担,和/或使该对应资源的稳定性较好,且预热时长较短。According to the technical solutions provided by the embodiments of the present disclosure, the preheating control model is obtained by acquiring the preheating historical data, and determining in the preheating historical data the target preheating historical data whose preheating effect information satisfies the requirements of the target preheating effect. The service preheating rule information and service instance resource information in the target preheating historical data are used as input, and the preheating control information in the target preheating historical data is used as output to train the preheating control model to obtain the target preheating control model , it can ensure that the target preheating control model is the law between the service preheating rule information, service instance resource information and preheating control information corresponding to the preheating process that meets the requirements of the target preheating effect. During the warm-up process required by the effect, the resource state of the resource corresponding to the corresponding service instance on the node hosting the corresponding service instance is a state of low load, and/or the state of the resource is a state of high stability, and the The duration of the thermal process is short, so when the service instance is preheated according to the preheating control information output by the target preheating control model, the preheating process can satisfy the service preheating rule information input to the target preheating control model. , it will not cause a higher burden on the node hosting the service instance and the resources corresponding to the service instance, and/or make the corresponding resources have better stability and shorter warm-up time.
图3示出根据本公开一实施方式的服务预热方法的流程图,该方法应用于服务预热执行端,如图3所示,服务预热方法包括步骤S201-S202。FIG. 3 shows a flowchart of a service preheating method according to an embodiment of the present disclosure. The method is applied to a service preheating execution end. As shown in FIG. 3 , the service preheating method includes steps S201-S202.
在步骤S201中,采集服务实例资源信息,并发送服务实例资源信息。In step S201, the service instance resource information is collected, and the service instance resource information is sent.
其中,服务实例资源信息用于指示用于承载服务实例的节点上与服务实例对应资源的资源状态。The service instance resource information is used to indicate the resource status of the resource corresponding to the service instance on the node used to carry the service instance.
在本公开的一种实施方式中,服务实例可以理解为由节点承载的,用于提供对应服务的功能模块。其中,服务可以理解为与应用程序的具体功能对应。示例性的,当应用程序是支付类应用时,扫码、转账以及提现等功能可以理解为该应用下的服务。在实际部署中,一个服务往往对应多个服务实例,其中多个服务实例可以完全对等的,即一个服务实例完全可以替代另一个服务实例。节点可以被理解为,承载有相应数据以及应用程序、具备数据处理功能的设备。节点可以包括但不限于个人电脑(personal computer,PC)、平板电脑、笔记本电脑、移动通讯终端、可穿戴设备、语音交互设备及服务器等。其中,服务器可以为独立的物理服务器,也可以为由多个物理服务器构成的服务器集群或者分布式系统,也可以为用于提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台中至少一项服务的云计算系统中的服务器。In an embodiment of the present disclosure, a service instance may be understood as a functional module carried by a node and used to provide a corresponding service. Among them, the service can be understood as corresponding to the specific function of the application. Exemplarily, when the application is a payment application, functions such as code scanning, transfer, and cash withdrawal can be understood as services under the application. In actual deployment, a service often corresponds to multiple service instances, and multiple service instances can be completely equivalent, that is, one service instance can completely replace another service instance. A node can be understood as a device that carries corresponding data and application programs and has data processing functions. Nodes may include but are not limited to personal computers (personal computers, PCs), tablet computers, notebook computers, mobile communication terminals, wearable devices, voice interaction devices, servers, and the like. The server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a server used to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, and network services. , cloud communication, middleware service, domain name service, security service, content delivery network (Content Delivery Network, CDN), and a server in a cloud computing system for at least one service in a big data and artificial intelligence platform.
在本公开的一种实施方式中,节点上与对应的服务实例对应的资源,可以理解为,节点上用于支持对应的服务实例运行的全部或部分资源,其中,所述资源可以被理解为硬件资源,也可以被理解为软件资源。示例性的,当某个节点承载有一个服务实例,即该节点与该节点承载的服务实例一一对应时,该节点上的全部资源可以被理解为与该节点承载的服务实例对应的资源;当节点承载有两个服务实例,且该节点包括两个能够单独支持服务实例运行的资源单元时,该节点上的一个资源单元中的资源可以被理解为与两个服务实例中的一个服务实例对应的资源,该节点上的另一个资源单元中的资源可以被理解为与两个服务实例中的另一个服务实例对应的资源。In an embodiment of the present disclosure, the resources corresponding to the corresponding service instances on the nodes can be understood as all or part of the resources used to support the operation of the corresponding service instances on the nodes, wherein the resources can be understood as Hardware resources can also be understood as software resources. Exemplarily, when a node carries a service instance, that is, when the node corresponds to the service instance carried by the node one-to-one, all resources on the node can be understood as resources corresponding to the service instance carried by the node; When a node hosts two service instances, and the node includes two resource units that can independently support the running of the service instances, the resources in one resource unit on the node can be understood as the same as one service instance in the two service instances. Corresponding resources, resources in another resource unit on the node can be understood as resources corresponding to another service instance in the two service instances.
在本公开的一种实施方式中,资源状态,可以理解为用于指示对应的资源被占用的程度,也可以理解为对应的资源能够用于支持对应服务实例运行的能力等。In an embodiment of the present disclosure, the resource status can be understood as indicating the degree of occupation of the corresponding resource, and can also be understood as the capability of the corresponding resource to support the running of the corresponding service instance.
在步骤S202中,接收预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。In step S202, the preheating control information is received, and the upper limit of the traffic of the preheated service instance is controlled according to the preheating control information and the current moment.
根据本公开实施例提供的技术方案,通过采集服务实例资源信息,并发送服务实例资源信息,可以使服务预热控制端能够根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,从而接收服务预热控制端发送的预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。According to the technical solutions provided by the embodiments of the present disclosure, by collecting service instance resource information and sending the service instance resource information, the service preheating control terminal can obtain at least one to-be-warmed item according to the service preheating rule information and the service instance resource information. The preheating control information corresponding to the service instance is received, thereby receiving the preheating control information sent by the service preheating control terminal, and controlling the upper limit of the traffic of the preheated service instance according to the preheating control information and the current moment. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
在本公开的一种实现方式中,其中,资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项。In one implementation of the present disclosure, the resource status includes processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second.
根据本公开实施例提供的技术方案,通过限定资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项,可以确保能够根据资源状态较为清晰的获知相应节点上硬件的资源状态。According to the technical solutions provided by the embodiments of the present disclosure, the resource states include processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second, to ensure that the resource status of the hardware on the corresponding node can be clearly known according to the resource status.
图4示出根据本公开一实施方式的服务预热系统的示意性框图,如图4所示,服务预热系统包括服务预热控制端以及运行应用环境,其中运行应用环境中部署有多个节点,每个节点上部署有服务预热执行端,并承载有与节点一一对应的服务实例。FIG. 4 shows a schematic block diagram of a service preheating system according to an embodiment of the present disclosure. As shown in FIG. 4 , the service preheating system includes a service preheating control terminal and a running application environment, wherein the running application environment is deployed with multiple Nodes, each node is deployed with a service warm-up execution end, and carries a one-to-one service instance corresponding to the node.
其中,服务预热执行端可以从每个节点处采集待预热的至少一个服务实例对应的服务实例资源信息,并将服务实例资源信息上传至服务预热控制端的应用状态采集器模块,由应用状态采集器模块将服务实例资源信息提供给预热模型分析器模块,服务预热控制端的规则解析器模块可以接收用户端发送的与待预热的至少一个服务实例对应的服务预热规则信息,并将服务预热规则信息储存在数据库中,预热模型分析器模块可以从数据库中读取该服务预热规则信息。预热模型分析器模块可以根据其获取的服务预热规则信息以及服务实例资源信息,获取待预热的至少一个服务实例对应的预热控制信息,并将所获取的预热控制信息提供给服务预热执行端的配置中心模块,服务预热执行端的配置中心可以向每个节点上部署的服务预热执行端发送预热控制信息,使服务预热执行端可以根据该预热控制信息控制同一节点承载的服务实例进行预热。The service preheating execution end may collect service instance resource information corresponding to at least one service instance to be preheated from each node, and upload the service instance resource information to the application state collector module of the service preheating control end, and the application The state collector module provides the service instance resource information to the preheating model analyzer module, and the rule parser module on the service preheating control end can receive the service preheating rule information corresponding to at least one service instance to be preheated sent by the user end, The service preheating rule information is stored in the database, and the preheating model analyzer module can read the service preheating rule information from the database. The warm-up model analyzer module can obtain warm-up control information corresponding to at least one service instance to be warmed up according to the obtained service warm-up rule information and service instance resource information, and provide the obtained warm-up control information to the service The configuration center module of the preheating execution end, the configuration center of the service preheating execution end can send preheating control information to the service preheating execution end deployed on each node, so that the service preheating execution end can control the same node according to the preheating control information The hosted service instance is warmed up.
以下参照图5描述根据本公开一实施方式的服务预热装置。图5示出根据本公开一实施方式的服务预热装置200的结构框图。The following describes a service preheating apparatus according to an embodiment of the present disclosure with reference to FIG. 5 . FIG. 5 shows a structural block diagram of a
如图5所示,服务预热装置200包括:As shown in FIG. 5 , the
规则信息获取模块201,被配置为获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,服务预热规则信息用于指示对应的服务实例的预热过程的规则,服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态;The rule
控制信息获取模块202,被配置为根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,预热控制信息用于指示在预热过程中的不同时刻,对应的服务实例与流量上限之间的对应关系;The control
控制信息发送模块203,被配置为发送预热控制信息。The control
根据本公开实施例提供的技术方案,通过获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,并发送预热控制信息。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。According to the technical solutions provided by the embodiments of the present disclosure, by acquiring service preheating rule information corresponding to at least one service instance to be preheated, and receiving service instance resource information corresponding to at least one service instance to be preheated, according to the service preheating rules Information and Service Instance Resource Information Acquire warm-up control information corresponding to at least one service instance to be warmed up, and send the warm-up control information. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
本领域技术人员可以理解,参照图5描述的技术方案的可以与参照图2对应的任一实施例结合,从而具备图2对应的任一实施例所实现的技术效果。具体内容可以参照上述实施例的描述,其具体内容在此不再赘述。Those skilled in the art can understand that the technical solution described with reference to FIG. 5 can be combined with any of the embodiments corresponding to FIG. 2 , so as to have the technical effects achieved by any of the embodiments corresponding to FIG. 2 . For specific content, reference may be made to the description of the above-mentioned embodiments, and the specific content thereof will not be repeated here.
以下参照图5描述根据本公开一实施方式的服务预热装置。图5示出根据本公开一实施方式的服务预热装置的结构框图。The following describes a service preheating apparatus according to an embodiment of the present disclosure with reference to FIG. 5 . FIG. 5 shows a structural block diagram of a service preheating apparatus according to an embodiment of the present disclosure.
如图5所示,服务预热装置300包括:As shown in FIG. 5, the
资源信息发送模块301,被配置为采集服务实例资源信息,并发送服务实例资源信息,服务实例资源信息用于指示用于承载服务实例的节点上与服务实例对应资源的资源状态;The resource
预热控制模块302,被配置为接收预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。The preheating
根据本公开实施例提供的技术方案,通过采集服务实例资源信息,并发送服务实例资源信息,可以使服务预热控制端能够根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,从而接收服务预热控制端发送的预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。其中,由于服务预热规则信息用于指示对应的服务实例的预热过程的规则,而服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,因此根据服务预热规则信息以及服务实例资源信息所获取的预热控制信息,其所指示对应的服务实例在预热过程中的不同时刻的流量上限,能够满足预热过程的规则,从而尽量减少预热所占用的时间,同时也不会对用于承载对应的服务实例的节点的资源造成较大冲击,从而可以在有效降低流量所产生的冲击的前提下,尽量减少预热过程所占用的时间。According to the technical solutions provided by the embodiments of the present disclosure, by collecting service instance resource information and sending the service instance resource information, the service preheating control terminal can obtain at least one to-be-warmed item according to the service preheating rule information and the service instance resource information. The preheating control information corresponding to the service instance is received, thereby receiving the preheating control information sent by the service preheating control terminal, and controlling the upper limit of the traffic of the preheated service instance according to the preheating control information and the current moment. Among them, since the service warm-up rule information is used to indicate the rules of the warm-up process of the corresponding service instance, and the service instance resource information is used to indicate that before the warm-up process, the node that is used to carry the corresponding service instance and the corresponding service The resource status of the resource corresponding to the instance. Therefore, according to the preheating control information obtained from the service preheating rule information and the resource information of the service instance, the upper limit of the traffic of the corresponding service instance at different times during the preheating process is indicated, which can meet the preheating requirements. process rules, so as to minimize the time occupied by preheating, and at the same time, it will not cause a great impact on the resources of the nodes used to carry the corresponding service instances, so as to effectively reduce the impact caused by traffic, try to Reduce the time taken by the warm-up process.
本领域技术人员可以理解,参照图6描述的技术方案的可以与参照图3对应的任一实施例结合,从而具备图3对应的任一实施例所实现的技术效果。具体内容可以参照上述实施例的描述,其具体内容在此不再赘述。Those skilled in the art can understand that the technical solution described with reference to FIG. 6 can be combined with any of the embodiments corresponding to FIG. 3 , so as to have the technical effects achieved by any of the embodiments corresponding to FIG. 3 . For specific content, reference may be made to the description of the above-mentioned embodiments, and the specific content thereof will not be repeated here.
图7示出根据本公开一实施方式的电子设备的结构框图。FIG. 7 shows a structural block diagram of an electronic device according to an embodiment of the present disclosure.
本公开实施方式还提供了一种电子设备,如图7所示,包括至少一个处理器401;以及与至少一个处理器401通信连接的存储器402;其中,存储器402存储有可被至少一个处理器401执行的指令,指令被至少一个处理器401执行以实现以下步骤:Embodiments of the present disclosure also provide an electronic device, as shown in FIG. 7 , comprising at least one
第一方面,本公开实施例中提供了一种服务预热方法,所述方法应用于服务预热控制端,所述方法包括:In a first aspect, an embodiment of the present disclosure provides a service preheating method, the method is applied to a service preheating control terminal, and the method includes:
获取待预热的至少一个服务实例对应的服务预热规则信息,并接收待预热的至少一个服务实例对应的服务实例资源信息,服务预热规则信息用于指示对应的服务实例的预热过程的规则,服务实例资源信息用于指示在预热过程之前,用于承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态;Obtain service preheating rule information corresponding to at least one service instance to be preheated, and receive service instance resource information corresponding to at least one service instance to be preheated. The service preheating rule information is used to indicate the preheating process of the corresponding service instance The service instance resource information is used to indicate the resource status of the resource corresponding to the corresponding service instance on the node used to carry the corresponding service instance before the warm-up process;
根据服务预热规则信息以及服务实例资源信息获取待预热的至少一个服务实例对应的预热控制信息,预热控制信息用于指示在预热过程中的不同时刻,对应的服务实例与流量上限之间的对应关系;Obtain the warm-up control information corresponding to at least one service instance to be warmed up according to the service warm-up rule information and the service instance resource information. The warm-up control information is used to indicate the corresponding service instance and the traffic limit at different times during the warm-up process. Correspondence between;
发送预热控制信息。Send warm-up control information.
在本公开的一种实现方式中,其中,服务预热规则信息包括服务实例批次信息、服务实例启动信息以及批次间隔信息中至少一项,服务实例批次信息用于指示在预热过程中对应的服务实例与预热批次之间的对应关系,服务实例启动信息用于指示对应的服务实例与启动时长之间的对应关系,批次间隔信息用于指示预热过程中至少两个预热批次之间间隔的时长。In an implementation manner of the present disclosure, the service warm-up rule information includes at least one item of service instance batch information, service instance startup information, and batch interval information, and the service instance batch information is used to indicate that during the warm-up process The corresponding relationship between the corresponding service instance and the warm-up batch in The length of time between warmup batches.
在本公开的一种实现方式中,其中,资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项。In one implementation of the present disclosure, the resource status includes processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second.
在本公开的一种实现方式中,其中,根据服务预热规则信息以及服务实例资源信息获取预热控制信息,包括:In an implementation manner of the present disclosure, obtaining preheating control information according to service preheating rule information and service instance resource information includes:
获取预先训练得到的目标预热控制模型,将服务预热规则信息以及服务实例资源信息作为输入,输入目标预热控制模型,以获取输出的预热控制信息。Obtain the pre-trained target warm-up control model, take the service warm-up rule information and service instance resource information as input, and input the target warm-up control model to obtain the output warm-up control information.
在本公开的一种实现方式中,其中,获取服务预热规则信息,并接收服务实例资源信息之前,方法还包括:In an implementation manner of the present disclosure, before acquiring service preheating rule information and receiving service instance resource information, the method further includes:
获取预热历史数据,预热历史数据包括至少一个已预热的服务实例对应的服务预热规则信息、服务实例资源信息、预热控制信息以及预热效果信息,预热效果信息用于指示在预热过程中的不同时刻,承载对应的服务实例的节点上与对应的服务实例对应资源的资源状态,以及预热过程的时长;Obtain preheating historical data, which includes service preheating rule information, service instance resource information, preheating control information, and preheating effect information corresponding to at least one preheated service instance, and the preheating effect information is used to indicate At different times during the warm-up process, the resource status of the resource corresponding to the corresponding service instance on the node carrying the corresponding service instance, and the duration of the warm-up process;
在预热历史数据中确定预热效果信息满足目标预热效果要求的目标预热历史数据;In the preheating historical data, determine the target preheating historical data whose preheating effect information meets the requirements of the target preheating effect;
获取预热控制模型,并将目标预热历史数据中的服务预热规则信息以及服务实例资源信息作为输入,将目标预热历史数据中的预热控制信息作为输出,对预热控制模型进行训练,以获取目标预热控制模型。Obtain the preheating control model, use the service preheating rule information and service instance resource information in the target preheating historical data as input, and use the preheating control information in the target preheating historical data as output to train the preheating control model , to obtain the target warm-up control model.
第二方面,本公开实施例中提供了一种服务预热方法,其中,所述方法应用于服务预热执行端,所述方法包括:In a second aspect, an embodiment of the present disclosure provides a service preheating method, wherein the method is applied to a service preheating executor, and the method includes:
采集服务实例资源信息,并发送服务实例资源信息,服务实例资源信息用于指示用于承载服务实例的节点上与服务实例对应资源的资源状态;Collect service instance resource information, and send the service instance resource information, where the service instance resource information is used to indicate the resource status of the resource corresponding to the service instance on the node used to carry the service instance;
接收预热控制信息,并根据预热控制信息以及当前时刻控制被预热的服务实例的流量上限。Receive the pre-warming control information, and control the upper limit of the traffic of the pre-warmed service instance according to the pre-warming control information and the current moment.
在本公开的一种实现方式中,其中,资源状态包括处理器占用率、处理器占用量、带宽占用率、带宽占用量、内存占用率、内存占用量、磁盘空间占用量、磁盘空间占用率、每秒查询率中至少一项。In one implementation of the present disclosure, the resource status includes processor occupancy, processor occupancy, bandwidth occupancy, bandwidth occupancy, memory occupancy, memory occupancy, disk space occupancy, and disk space occupancy , at least one of the query rate per second.
图8是适于用来实现根据本公开一实施方式的方法的计算机系统的结构示意图。FIG. 8 is a schematic structural diagram of a computer system suitable for implementing a method according to an embodiment of the present disclosure.
如图8所示,计算机系统500包括处理单元501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储部分508加载到随机访问存储器(RAM)503中的程序而执行上述附图所示的实施方式中的各种处理。在RAM 503中,还存储有计算机系统500操作所需的各种程序和数据。CPU 501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 8, the
以下部件连接至I/O接口505:包括键盘、鼠标等的输入部分506;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分507;包括硬盘等的存储部分508;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分509。通信部分509经由诸如因特网的网络执行通信处理。驱动器510也根据需要连接至I/O接口505。可拆卸介质511,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器510上,以便于从其上读出的计算机程序根据需要被安装入存储部分508。其中,所述处理单元501可实现为CPU、GPU、TPU、FPGA、NPU等处理单元。The following components are connected to the I/O interface 505: an
特别地,根据本公开的实施方式,上文参考附图描述的方法可以被实现为计算机软件程序。示例性的,本公开的实施方式包括一种计算机程序产品,其包括有形地包含在及其可读介质上的计算机程序,所述计算机程序包含用于执行附图中的方法的程序代码。在这样的实施方式中,该计算机程序可以通过通信部分509从网络上被下载和安装,和/或从可拆卸介质511被安装。示例性的,本公开的实施方式包括一种可读存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现用于执行附图中的方法的程序代码。In particular, according to embodiments of the present disclosure, the methods described above with reference to the accompanying drawings may be implemented as a computer software program. Illustratively, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a readable medium thereof, the computer program containing program code for performing the methods of the Figures. In such an embodiment, the computer program may be downloaded and installed from the network via the
附图中的流程图和框图,图示了按照本公开各种实施方式的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,路程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。示例性的,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the diagram or block diagram may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function. executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. By way of example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
描述于本公开实施方式中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。The units or modules involved in the embodiments of the present disclosure can be implemented in software or hardware. The described units or modules may also be provided in the processor, and the names of these units or modules do not constitute a limitation on the units or modules themselves in certain circumstances.
作为另一方面,本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施方式中所述节点中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,所述程序被一个或者一个以上的处理器用来执行描述于本公开的方法。As another aspect, the present disclosure also provides a computer-readable storage medium, and the computer-readable storage medium may be the computer-readable storage medium included in the nodes described in the foregoing embodiments; A computer-readable storage medium that fits into a device. The computer-readable storage medium stores one or more programs used by one or more processors to perform the methods described in the present disclosure.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。示例性的上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover the above-mentioned technical features without departing from the inventive concept. Other technical solutions formed by any combination of its equivalent features. The above-mentioned exemplary features and the technical features disclosed in the present disclosure (but not limited to) with similar functions are replaced with each other to form a technical solution.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210494586.6ACN114785760B (en) | 2022-05-07 | 2022-05-07 | Service preheating methods, equipment, media and products |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210494586.6ACN114785760B (en) | 2022-05-07 | 2022-05-07 | Service preheating methods, equipment, media and products |
| Publication Number | Publication Date |
|---|---|
| CN114785760Atrue CN114785760A (en) | 2022-07-22 |
| CN114785760B CN114785760B (en) | 2025-01-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210494586.6AActiveCN114785760B (en) | 2022-05-07 | 2022-05-07 | Service preheating methods, equipment, media and products |
| Country | Link |
|---|---|
| CN (1) | CN114785760B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116204248A (en)* | 2023-05-05 | 2023-06-02 | 北京睿企信息科技有限公司 | Configuration system of cluster server |
| CN118377525A (en)* | 2024-04-12 | 2024-07-23 | 中电金信软件有限公司 | Application system preheating method and device and electronic equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2016119412A1 (en)* | 2015-01-30 | 2016-08-04 | 华为技术有限公司 | Resource scaling method on cloud platform and cloud platform |
| WO2016176231A1 (en)* | 2015-04-29 | 2016-11-03 | Microsoft Technology Licensing, Llc | Optimal allocation of dynamic cloud computing platform resources |
| CN107682205A (en)* | 2017-11-01 | 2018-02-09 | 北京奇艺世纪科技有限公司 | On-line message dissemination method, device and electronic equipment |
| CN109933544A (en)* | 2019-03-13 | 2019-06-25 | 广州华多网络科技有限公司 | Data preheating method, device, server and storage medium |
| US20200104749A1 (en)* | 2018-09-28 | 2020-04-02 | Amazon Technologies, Inc. | Pre-warming scheme to load machine learning models |
| CN111431996A (en)* | 2020-03-20 | 2020-07-17 | 北京百度网讯科技有限公司 | Method, apparatus, device and medium for resource configuration |
| WO2021254331A1 (en)* | 2020-06-16 | 2021-12-23 | 中兴通讯股份有限公司 | Resource management method and system, proxy server, and storage medium |
| CN114244898A (en)* | 2021-11-16 | 2022-03-25 | 阿里巴巴(中国)有限公司 | Workload warm-up method and device based on service grid |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2016119412A1 (en)* | 2015-01-30 | 2016-08-04 | 华为技术有限公司 | Resource scaling method on cloud platform and cloud platform |
| WO2016176231A1 (en)* | 2015-04-29 | 2016-11-03 | Microsoft Technology Licensing, Llc | Optimal allocation of dynamic cloud computing platform resources |
| CN107682205A (en)* | 2017-11-01 | 2018-02-09 | 北京奇艺世纪科技有限公司 | On-line message dissemination method, device and electronic equipment |
| US20200104749A1 (en)* | 2018-09-28 | 2020-04-02 | Amazon Technologies, Inc. | Pre-warming scheme to load machine learning models |
| CN109933544A (en)* | 2019-03-13 | 2019-06-25 | 广州华多网络科技有限公司 | Data preheating method, device, server and storage medium |
| CN111431996A (en)* | 2020-03-20 | 2020-07-17 | 北京百度网讯科技有限公司 | Method, apparatus, device and medium for resource configuration |
| WO2021254331A1 (en)* | 2020-06-16 | 2021-12-23 | 中兴通讯股份有限公司 | Resource management method and system, proxy server, and storage medium |
| CN114244898A (en)* | 2021-11-16 | 2022-03-25 | 阿里巴巴(中国)有限公司 | Workload warm-up method and device based on service grid |
| Title |
|---|
| 阿里云原生: "15分钟实现企业级应用无损上下线", Retrieved from the Internet <URL:https://developer.aliyun.com/article/872430?utm_content=g_1000331001>* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116204248A (en)* | 2023-05-05 | 2023-06-02 | 北京睿企信息科技有限公司 | Configuration system of cluster server |
| CN116204248B (en)* | 2023-05-05 | 2023-07-07 | 北京睿企信息科技有限公司 | Configuration system of cluster server |
| CN118377525A (en)* | 2024-04-12 | 2024-07-23 | 中电金信软件有限公司 | Application system preheating method and device and electronic equipment |
| Publication number | Publication date |
|---|---|
| CN114785760B (en) | 2025-01-03 |
| Publication | Publication Date | Title |
|---|---|---|
| CN108984784B (en) | Application implementation method, device, equipment and storage medium based on block chain network | |
| CN114785760A (en) | Service preheating method, equipment, medium and product | |
| CN111447185B (en) | Push information processing method and related equipment | |
| CN111091429A (en) | Electronic bill identification distribution method and device and electronic bill generation system | |
| TWI729432B (en) | Information identification code generation method, device, electronic equipment and computer storage medium | |
| WO2015141934A1 (en) | Divided payment method, and device and system for same | |
| CN102549591A (en) | Shared face training data | |
| CN110569057A (en) | gray scale distribution method and device, electronic equipment and computer readable medium | |
| CN109783151B (en) | Method and device for rule change | |
| CN110489240A (en) | Image-recognizing method, device, cloud platform and storage medium | |
| CN114124968A (en) | Load balancing method, device, device and medium based on market data | |
| CN116431282A (en) | A cloud virtual host server management method, device, equipment and storage medium | |
| CN110661857B (en) | Data synchronization method and device | |
| CN114385382B (en) | Light application access method, device, computer equipment and storage medium | |
| CN113127561B (en) | Method and device for generating service single number, electronic equipment and storage medium | |
| CN111901401B (en) | Method and device for balancing SMF load of session management function | |
| CN108076110B (en) | Electronic data exchange system and apparatus comprising an electronic data exchange system | |
| WO2024183364A1 (en) | Data processing method, electronic device, program product and storage medium | |
| US11838207B2 (en) | Systems for session-based routing | |
| CN117651078A (en) | Data transmission method and device, electronic equipment and storage medium | |
| CN117914819A (en) | Chat robot menu display method, device and system | |
| CN114463122A (en) | Data processing method and device, electronic equipment and storage medium | |
| CN114726909A (en) | Cloud service migration information processing method, apparatus, device, medium and product | |
| JP2003228668A (en) | Resource management method | |
| CN112612401A (en) | Prompt message processing method, device, system, equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |