CN110780914B - Service publishing method and device - Google Patents
Service publishing method and device Download PDFInfo
- Publication number
- CN110780914B CN110780914B CN201810856676.9A CN201810856676A CN110780914B CN 110780914 B CN110780914 B CN 110780914B CN 201810856676 A CN201810856676 A CN 201810856676A CN 110780914 B CN110780914 B CN 110780914B
- Authority
- CN
- China
- Prior art keywords
- file
- service
- target service
- program
- configuration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000005538 encapsulation Methods 0.000 claims abstract description 68
- 238000004364 calculation method Methods 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012546 transfer Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 abstract description 19
- 230000010354 integration Effects 0.000 abstract description 9
- 238000013473 artificial intelligence Methods 0.000 description 21
- 238000004422 calculation algorithm Methods 0.000 description 20
- 238000012545 processing Methods 0.000 description 19
- 230000006870 function Effects 0.000 description 9
- 238000006243 chemical reaction Methods 0.000 description 8
- 238000011161 development Methods 0.000 description 7
- 230000018109 developmental process Effects 0.000 description 7
- 238000013135 deep learning Methods 0.000 description 6
- 238000012544 monitoring process Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012549 training Methods 0.000 description 5
- 230000008602 contraction Effects 0.000 description 4
- 230000001419 dependent effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000013136 deep learning model Methods 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000012800 visualization Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
本发明实施例提供一种服务发布方法及装置。所述方法包括:获取目标服务的程序文件以及配置文件;根据所述程序文件以及配置文件,生成所述目标服务的镜像文件;根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。
Embodiments of the present invention provide a method and device for publishing a service. The method includes: obtaining a program file and a configuration file of the target service; generating a mirror file of the target service according to the program file and the configuration file; creating and starting an instance container of the target service according to the mirror file, The target service is provided externally through the instance container. In the embodiment of the present invention, the process of arrangement and release of services is simple and efficient, and can be applied to various types of services, providing unified service encapsulation, providing standardized service call interfaces externally, and realizing standardized encapsulation and integration of diversified models. Agile publishing; and based on containerized flexible services, the resources and capacity of instance containers can be dynamically adjusted to achieve flexible scheduling of target service resource usage and high maintainability.
Description
技术领域technical field
本发明实施例涉及移动通信技术领域,尤其涉及一种服务发布方法及装置。The embodiments of the present invention relate to the technical field of mobile communication, and in particular, to a method and device for publishing a service.
背景技术Background technique
人工智能(Artificial Intelligence,AI)是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。作为计算机科学的一个分支,AI目的在于了解智能的实质,并生产出一种能以人类智能相似的方式做出反应的智能机器,该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等。人工智能从诞生以来,理论和技术日益成熟,应用领域也不断扩大,未来人工智能带来的科技产品,将会是人类智慧的“容器”。Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. As a branch of computer science, AI aims to understand the essence of intelligence and produce an intelligent machine that can respond in a manner similar to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing and expert systems, etc. Since the birth of artificial intelligence, the theory and technology have become increasingly mature, and the application fields have also continued to expand. In the future, the technological products brought by artificial intelligence will be the "container" of human wisdom.
50年代,AI概念首次出现,主要以专家系统为主;70年代,随着神经网络算法发明,机器学习蓬勃发展,但受计算能力的限制,只能训练浅层的神经网络。而随着云计算和大数据时代的到来,计算能力和训练数据集不再成为瓶颈,深度学习随着训练数据集的增加可以实现比传统机器学习算法更好的准确性。In the 1950s, the concept of AI first appeared, mainly based on expert systems; in the 1970s, with the invention of neural network algorithms, machine learning flourished, but limited by computing power, only shallow neural networks could be trained. With the advent of the era of cloud computing and big data, computing power and training data sets are no longer the bottleneck, and deep learning can achieve better accuracy than traditional machine learning algorithms with the increase of training data sets.
以深度学习为代表的人工智能技术与国民经济的深度融合,其应用前景非常广阔。为了加速深度学习模型的应用,需要将深度学习模型转换为标准的微服务并进行服务编排、发布;然而,现有技术中,服务编排、发布主要以定制化开发的方式实现,封装成微服务再应用到具体业务场景,这种方案存在如下问题:The deep integration of artificial intelligence technology represented by deep learning and the national economy has a very broad application prospect. In order to accelerate the application of the deep learning model, it is necessary to convert the deep learning model into a standard microservice and perform service arrangement and release; however, in the prior art, service arrangement and release are mainly implemented in the form of customized development and packaged into microservices When applied to specific business scenarios, this solution has the following problems:
1、模型发布效率低下1. Model release efficiency is low
每次模型发布都需要进行代码开发,且深度学习框架存在于TensorFlow、Caffe等多种框架,开发人员学习成本高。Code development is required for each model release, and deep learning frameworks exist in various frameworks such as TensorFlow and Caffe, and developers have high learning costs.
2、服务标准不统一2. Service standards are not uniform
现有技术开发出的服务都是个性化服务,缺乏统一的标准,增加应用调用的难度;The services developed by the existing technology are all personalized services, lack of unified standards, and increase the difficulty of application calls;
3、服务缺乏弹性3. Inflexible service
独立部署的个性化服务,面对应用的不规律调用缺乏弹性应对机制。Independently deployed personalized services lack an elastic response mechanism for irregular invocations of applications.
4、服务可维护性差4. Poor service maintainability
比如服务的调用情况,缺乏详细的统计信息体系和完整的监控体系。For example, the invocation of services lacks a detailed statistical information system and a complete monitoring system.
发明内容Contents of the invention
本发明实施例提供一种服务发布方法及装置,用以解决现有技术中服务编排、发布存在的模型发布效率低下,服务标准不统一以及可维护性差等问题。Embodiments of the present invention provide a method and device for publishing services, which are used to solve the problems of low model publishing efficiency, non-uniform service standards and poor maintainability in service arrangement and publishing in the prior art.
一方面,本发明实施例提供一种服务发布方法,所述方法包括:On the one hand, an embodiment of the present invention provides a method for publishing a service, the method including:
获取目标服务的程序文件以及配置文件;Obtain the program file and configuration file of the target service;
根据所述程序文件以及配置文件,生成所述目标服务的镜像文件;Generate a mirror image file of the target service according to the program file and the configuration file;
根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。According to the image file, an instance container of the target service is created and started, and the target service is provided externally through the instance container.
另一方面,本发明实施例提供一种服务发布装置,所述装置包括:On the other hand, an embodiment of the present invention provides a service publishing device, the device comprising:
获取模块,用于获取目标服务的程序文件以及配置文件;The acquisition module is used to acquire the program file and configuration file of the target service;
文件生成模块,用于根据所述程序文件以及配置文件,生成所述目标服务的镜像文件;A file generating module, configured to generate a mirror file of the target service according to the program file and the configuration file;
服务发布模块,用于根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。The service issuing module is configured to create and start an instance container of the target service according to the image file, and provide the target service externally through the instance container.
另一方面,本发明实施例还提供了一种电子设备,包括存储器、处理器、总线以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述服务发布方法中的步骤。On the other hand, an embodiment of the present invention also provides an electronic device, including a memory, a processor, a bus, and a computer program stored in the memory and operable on the processor. When the processor executes the program, the above-mentioned Steps in the service publishing method.
再一方面,本发明实施例还提供了一种非暂态计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现上述服务发布方法中的步骤。In yet another aspect, an embodiment of the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps in the above service publishing method are implemented.
本发明实施例提供的服务发布方法及装置,通过获取目标服务的程序文件以及配置文件;根据所述程序文件以及配置文件,生成所述目标服务的镜像文件,根据所述镜像文件,创建并启动所述目标服务的实例容器,通过实例容器创建目标服务运行的环境镜像,对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。The service release method and device provided by the embodiments of the present invention obtain the program file and configuration file of the target service; generate the mirror file of the target service according to the program file and configuration file, and create and start the mirror file according to the mirror file The instance container of the target service creates an environment image in which the target service runs through the instance container, and provides the target service externally. In the embodiment of the present invention, the process of arrangement and release of services is simple and efficient, and can be applied to various types of services, providing unified service encapsulation, providing standardized service call interfaces externally, and realizing standardized encapsulation and integration of diversified models. Agile publishing; and based on containerized flexible services, the resources and capacity of instance containers can be dynamically adjusted to achieve flexible scheduling of target service resource usage and high maintainability.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例提供的服务发布方法的流程示意图;FIG. 1 is a schematic flowchart of a service publishing method provided by an embodiment of the present invention;
图2为本发明实施例的第一示例的服务发布架构的框图;FIG. 2 is a block diagram of the service release architecture of the first example of the embodiment of the present invention;
图3为本发明实施例的第二示例的服务发布装置的框图;FIG. 3 is a block diagram of a service publishing device of a second example of an embodiment of the present invention;
图4为本发明实施例的第二示例的方法流程图;Fig. 4 is the method flowchart of the second example of the embodiment of the present invention;
图5为本发明实施例提供的服务发布装置的框图;FIG. 5 is a block diagram of a service publishing device provided by an embodiment of the present invention;
图6为本发明实施例提供的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
图1示出了本发明实施例提供的一种服务发布方法的流程示意图。Fig. 1 shows a schematic flowchart of a method for publishing a service provided by an embodiment of the present invention.
如图1所示,本发明实施例提供的服务发布方法,所述方法具体包括以下步骤:As shown in Figure 1, the service release method provided by the embodiment of the present invention, the method specifically includes the following steps:
步骤101,获取目标服务的程序文件以及配置文件。
其中,目标服务为当前运行环境中待编排和/或发布的服务,可以是经过深度学习训练成熟后AI服务,也可以是其他原子服务;本发明实施例中,原子服务指当前运行环境中最小的服务单元。目标服务根据其属性不同,对应的程序文件不同,比如,对于模型类服务,其程序文件为服务模型文件,包括计算图、数据流等模型;对于应用类服务,其程序文件为应用的程序代码包。Among them, the target service is the service to be arranged and/or published in the current operating environment, which can be an AI service matured after deep learning training, or other atomic services; in the embodiment of the present invention, the atomic service refers to the smallest service in the current operating environment service unit. The target service has different corresponding program files according to its attributes. For example, for model services, the program files are service model files, including models such as calculation graphs and data flows; for application services, the program files are application program codes Bag.
配置文件中包含目标服务的参数,比如目标服务的使用框架、符合预设接口规范的输入/输出参数列表等。The configuration file includes the parameters of the target service, such as the usage framework of the target service, the list of input/output parameters conforming to the preset interface specification, and so on.
作为第一示例,参见图2,图2提供了一种服务发布架构(后文简称为架构),该架构提供服务编排与发布功能,在编排服务的过程中,获取目标服务的程序文件以及配置文件。As a first example, refer to FIG. 2. FIG. 2 provides a service publishing architecture (hereinafter referred to as architecture), which provides service orchestration and publishing functions, and obtains program files and configurations of target services during the process of orchestrating services. document.
步骤102,根据所述程序文件以及配置文件,生成所述目标服务的镜像文件。
其中,镜像文件为由程序文件以及配置文件生成的文件,用于提供该目标服务。将程序文件以及配置文件经过预设处理,封装成目标服务的镜像文件,以便于创建目标服务运行的环境镜像。Wherein, the image file is a file generated by a program file and a configuration file, and is used to provide the target service. The program files and configuration files are pre-processed and packaged into an image file of the target service, so as to create an environment image in which the target service runs.
步骤103,根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。Step 103: Create and start an instance container of the target service according to the image file, and provide the target service externally through the instance container.
其中,实例容器为用于运行实例的虚拟容器,作为一种资源共享方式,实例容器可以提供极大的灵活性。根据所述镜像文件,创建实例容器并启动,在创建实例容器的过程中,将程序文件处理成可供外部、内部调用的服务,并将处理后的服务并入之前的运行环境镜像中,最后封装成包含该目标服务的当前运行环境的基础镜像,进而在当前运行环境下,可通过实例容器对外提供该目标服务,这样,后续当用户需要运行该目标服务时,只需启动该实例容器即可,无需再进行代码开发等底层开发工作,提高服务编排、发布时效。Among them, the instance container is a virtual container used to run the instance. As a resource sharing method, the instance container can provide great flexibility. According to the image file, the instance container is created and started. During the process of creating the instance container, the program file is processed into a service that can be called externally and internally, and the processed service is merged into the previous operating environment image. Finally, It is encapsulated into a basic image containing the current operating environment of the target service, and then in the current operating environment, the target service can be provided externally through the instance container, so that when the user needs to run the target service later, he only needs to start the instance container. Yes, there is no need to carry out underlying development work such as code development, and improve service arrangement and release timeliness.
且基于容器化的实例部署,可以实现柔性服务,提供弹性扩缩容功能,并且可监控目标服务的响应情况和每个实例容器的资源开销情况,最终实现动态调整容器的数量。可选地,实例容器可以是Docker容器或Mesos容器。And based on containerized instance deployment, it can realize flexible services, provide elastic expansion and contraction functions, and monitor the response of target services and the resource overhead of each instance container, and finally realize the dynamic adjustment of the number of containers. Optionally, the instance container can be a Docker container or a Mesos container.
继续参见图2,图2中设置有三个实例容器,分别为模型类封装、应用类封装以及服务类封装的容器。Continuing to refer to FIG. 2 , there are three instance containers in FIG. 2 , which are containers for model class encapsulation, application class encapsulation, and service class encapsulation.
本发明的上述实施例中,通过获取目标服务的程序文件以及配置文件;根据所述程序文件以及配置文件,生成所述目标服务的镜像文件,根据所述镜像文件,创建并启动所述目标服务的实例容器,通过实例容器创建目标服务运行的环境镜像,对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。本发明实施例解决了现有技术中服务编排、发布存在的模型发布效率低下,服务标准不统一以及可维护性差等问题。In the above embodiments of the present invention, by obtaining the program file and configuration file of the target service; according to the program file and configuration file, the image file of the target service is generated, and the target service is created and started according to the image file The instance container of the target service is created through the instance container to create an environment image for running the target service, and the target service is provided externally. In the embodiment of the present invention, the process of arrangement and release of services is simple and efficient, and can be applied to various types of services, providing unified service encapsulation, providing standardized service call interfaces externally, and realizing standardized encapsulation and integration of diversified models. Agile publishing; and based on containerized flexible services, the resources and capacity of instance containers can be dynamically adjusted to achieve flexible scheduling of target service resource usage and high maintainability. The embodiment of the present invention solves the problems of low model release efficiency, non-uniform service standards, poor maintainability and the like existing in service arrangement and release in the prior art.
可选地,本发明实施例中,所述获取目标服务的程序文件以及配置文件的步骤,包括:Optionally, in the embodiment of the present invention, the step of acquiring the program file and configuration file of the target service includes:
当目标服务的属性为模型类封装或应用类封装时,接收所述目标服务的程序文件以及配置文件。When the attribute of the target service is model class encapsulation or application class encapsulation, the program file and the configuration file of the target service are received.
其中,当目标服务的属性(类型)为模型类封装或应用类封装,接收所述目标服务的程序文件以及配置文件,其中,所接收的程序文件以及配置文件可以是用户上传的,也可以是第三方设备上传的。Wherein, when the attribute (type) of the target service is model class encapsulation or application class encapsulation, the program file and configuration file of the target service are received, wherein the received program file and configuration file may be uploaded by the user, or may be uploaded by a third-party device.
具体地,模型类封装的目标服务为基于算法模型的封装;应用类封装为用于组合多个原子服务模型间的逻辑算法、模型算法前的预处理逻辑算法等场景。Specifically, the target service of the model class encapsulation is the encapsulation based on the algorithm model; the application class encapsulation is used to combine logic algorithms between multiple atomic service models, preprocessing logic algorithms before model algorithms, and other scenarios.
参见图2,图2中每个实例容器对应不同属性的目标服务,包括模型类封装、应用类封装以及服务类封装。可选地,图2中所示架构可以为用户提供一用户界面(UserInterface,UI),供用户在上传程序文件和/或配置文件时选择目标服务的属性。Referring to Fig. 2, each instance container in Fig. 2 corresponds to target services of different attributes, including model class encapsulation, application class encapsulation and service class encapsulation. Optionally, the architecture shown in FIG. 2 may provide a user interface (UserInterface, UI) for the user to select the attribute of the target service when uploading the program file and/or configuration file.
可选地,本发明实施例中,所述接收所述目标服务的程序文件以及配置文件的步骤之后,所述方法还包括:Optionally, in the embodiment of the present invention, after the step of receiving the program file and configuration file of the target service, the method further includes:
根据所述配置文件,将所述程序文件转换成符合远程过程调用RPC接口协议的第一格式文件以及符合超文本传输协议HTTP接口协议的第二格式文件。According to the configuration file, the program file is converted into a first format file conforming to the remote procedure call RPC interface protocol and a second format file conforming to the hypertext transfer protocol HTTP interface protocol.
其中,为了对外提供标准化的服务调用接口,在接收到目标服务的程序文件以及配置文件之后,根据配置文件中的输入/输出参数,将程序文件处理成符合远程过程调用(Remote Procedure Calls,RPC)接口协议的第一格式文件,供远程调用;以及符合超文本传输协议超文本传输协议(Hyper Text Transfer Protocol,HTTP)接口协议的第二格式文件,提供标准HTTP接口服务,提供内部应用调用。Among them, in order to provide a standardized service call interface externally, after receiving the program file and configuration file of the target service, the program file is processed to conform to the Remote Procedure Calls (RPC) according to the input/output parameters in the configuration file. The first format file of the interface protocol is for remote calling; and the second format file conforming to the Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP) interface protocol provides standard HTTP interface services and internal application calls.
可以理解的是,当目标服务的属性为应用类封装时,程序文件中的算法本身若已经实现HTTP接口输出,则此时不需要再转换为第二格式文件,只需将其接口按HTTP接口规范进行输入/输出格式的标准化处理即可。It is understandable that when the attribute of the target service is encapsulated by the application class, if the algorithm itself in the program file has realized the output of the HTTP interface, it is not necessary to convert it to the second format file at this time, and only needs to convert its interface to the HTTP interface. It is enough to standardize the input/output format.
提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布。Provide a unified service package, provide a standardized service call interface to the outside world, and realize the standardized package and agile release of diversified models.
参见图2,程序文件以及配置文件通过标准表述性状态传递(RepresentationalState Transfer,REST)接口上传之后,架构在内部将程序文件转换为RPC接口或HTTP接口格式的文件。Referring to Fig. 2, after the program files and configuration files are uploaded through the standard Representational State Transfer (REST) interface, the framework internally converts the program files into files in RPC interface or HTTP interface format.
可选地,本发明实施例中,当所述目标服务的属性为所述模型类封装时,所述程序文件为所述目标服务的模型文件,所述模型文件包括:计算图、数据流、变量参数和/或签名;所述模型文件的模型使用框架、接口规范和/或所述目标服务的配置参数;Optionally, in the embodiment of the present invention, when the attribute of the target service is encapsulated by the model class, the program file is a model file of the target service, and the model file includes: a calculation graph, a data flow, Variable parameters and/or signatures; the model usage framework of the model file, the interface specification and/or the configuration parameters of the target service;
当所述目标服务的属性为所述应用类封装时,所述程序文件为所述目标服务的程序代码文件;所述配置文件包括:所述程序代码文件的代码语言格式和/或依赖包。When the attribute of the target service is encapsulated by the application class, the program file is a program code file of the target service; the configuration file includes: a code language format and/or a dependency package of the program code file.
一方面,对于模型类封装,所述程序文件为所述目标服务的模型文件,所述模型文件包括:算法模型的计算图、数据流、变量参数和/或签名,还可包括一些辅助文件,所述模型文件的模型使用框架、接口规范和/或所述目标服务的配置参数,其中,接口规范中包括符合接口规范的输入/输出参数列表数据流;可选地,配置文件中还可包括所述目标服务是否需要特殊处理标志以及模型发布成微服务相关运行参数配置等。On the one hand, for model class encapsulation, the program file is a model file serving the target, and the model file includes: calculation graph, data flow, variable parameters and/or signature of the algorithm model, and may also include some auxiliary files, The model usage framework of the model file, the interface specification and/or the configuration parameters of the target service, wherein the interface specification includes the input/output parameter list data flow conforming to the interface specification; optionally, the configuration file may also include Whether the target service requires special processing flags and the configuration of operating parameters related to publishing the model as a microservice, etc.
另一方面,对于应用类封装,程序文件为所述目标服务的程序代码文件,而配置文件中包括所述程序代码文件的代码语言格式和/或依赖包等参数,用于创建适配目标服务的逻辑算法运行的环境镜像。On the other hand, for application class encapsulation, the program file is the program code file of the target service, and the configuration file includes the code language format of the program code file and/or parameters such as dependent packages, which are used to create the adaptation target service The image of the environment where the logic algorithm runs.
可选地,本发明实施例中,所述获取目标服务的程序文件以及配置文件的步骤,包括:Optionally, in the embodiment of the present invention, the step of acquiring the program file and configuration file of the target service includes:
当接收到进行服务编排的编排请求时,获取待编排的原子服务以及所述原子服务的配置信息;When an orchestration request for service orchestration is received, obtain the atomic service to be orchestrated and the configuration information of the atomic service;
根据所述原子服务以及所述配置信息,生成计算图配置文件;Generate a calculation graph configuration file according to the atomic service and the configuration information;
获取预先设定的所述原子服务的程序文件,将所述原子服务的程序文件组合得到所述目标服务的程序文件,根据所述配置信息组合得到所述目标服务的配置文件。Obtaining the preset program files of the atomic services, combining the program files of the atomic services to obtain the program files of the target service, and combining the configuration files according to the configuration information to obtain the configuration files of the target services.
作为另一种实施方式,当接收到进行服务编排的编排请求时,编排请求可以是用户对原子服务图标的部署。As another implementation manner, when an orchestration request for service orchestration is received, the orchestration request may be a user's deployment of an atomic service icon.
获取编排请求中待编排的原子服务以及所述原子服务的配置信息,转换为原子服务的计算图配置文件;计算图配置文件包括总服务(目标服务)所需原子服务列表、各原子服务的配置信息,配置信息包括原子服务的输入/输出参数列表,以及各原子服务之间输入/输出参数的对应关系。Obtain the atomic service to be arranged in the orchestration request and the configuration information of the atomic service, and convert it into a calculation graph configuration file of the atomic service; the calculation graph configuration file includes the list of atomic services required by the total service (target service), and the configuration of each atomic service Information, the configuration information includes the input/output parameter list of the atomic service, and the corresponding relationship between the input/output parameters of each atomic service.
生成计算图配置文件之后,获取预先设定的各个原子服务的程序文件,组合得到所述目标服务的程序文件;并根据所述配置信息组合得到所述目标服务的配置文件,将各个原子服务组合得到了目标服务。服务的编排过程简单,效率较高,可适用于多种类型的服务。After the calculation graph configuration file is generated, obtain the preset program files of each atomic service, and combine the program files of the target service; and combine the configuration files of the target service according to the configuration information, and combine the atomic services Got target service. The service orchestration process is simple and efficient, and can be applied to various types of services.
可选地,本发明实施例中,所述创建并启动所述目标服务的实例容器的步骤,包括:Optionally, in the embodiment of the present invention, the step of creating and starting the instance container of the target service includes:
根据所述配置文件中包括的所述实例容器的配置数目,创建并启动所述目标服务的实例容器;Create and start an instance container of the target service according to the configuration number of the instance container included in the configuration file;
或or
创建并启动预设数目个所述目标服务的实例容器。Create and start a preset number of instance containers of the target service.
其中,基于容器化的实例部署,可以实现柔性服务,提供弹性扩缩容功能,实例容器的配置数目可根据配置文件中的限定决定的,也可预先设定为预设数目个实例容器;并且可监控目标服务的响应情况和每个实例容器的资源开销情况,实现动态调整容器的数量。Among them, container-based instance deployment can realize flexible services and provide elastic expansion and contraction functions. The configuration number of instance containers can be determined according to the limit in the configuration file, and can also be preset to a preset number of instance containers; and It can monitor the response of the target service and the resource overhead of each instance container to dynamically adjust the number of containers.
可选地,本发明实施例中,所述创建并启动所述目标服务的实例容器的步骤之后,所述方法还包括:Optionally, in the embodiment of the present invention, after the step of creating and starting the instance container of the target service, the method further includes:
根据所述配置文件,为所述实例容器分配图形处理器GPU显存资源,并监控所述实例容器的GPU状态信息。According to the configuration file, allocate graphics processor GPU video memory resources to the instance container, and monitor the GPU state information of the instance container.
其中,可根据配置文件,为所述实例容器分配图形处理器(Graphics ProcessingUnit,GPU)显存资源,GPU资源的分配支持以显存为单位,进行细粒度切分,并可监控实例容器的GPU状态信息。Among them, according to the configuration file, the graphics processor (Graphics Processing Unit, GPU) video memory resource can be allocated to the instance container. The allocation of GPU resources supports fine-grained segmentation based on video memory, and the GPU status information of the instance container can be monitored. .
具体地,GPU状态信息的监控可采用Master-slave架构,比如在各个装有GPU的实例容器上部署slave服务,进行该实例容器上GPU显存资源的监控,各个slave服务把实时监控信息发给Master进行汇总。Master掌控整个装置的GPU资源并响应应用端的GPU申请请求,进行GPU的分配和调度,当应用运行结束后,通过Slave上报的监控信息,Master及时更新并回收GPU资源,完成整个架构的GPU资源的管控和调度。Specifically, the monitoring of GPU status information can adopt the Master-slave architecture. For example, deploy slave services on each instance container equipped with GPUs to monitor GPU memory resources on the instance container, and each slave service sends real-time monitoring information to the Master. Make a summary. The Master controls the GPU resources of the entire device and responds to the GPU application request from the application side to allocate and schedule the GPU. After the application is running, the Master updates and recycles the GPU resources in time through the monitoring information reported by the Slave to complete the allocation of the GPU resources of the entire architecture. Control and scheduling.
可选地,还可根据服务的特点为实例容器分配合适的CPU资源,以达到理想的性能。Optionally, appropriate CPU resources can also be allocated to the instance container according to the characteristics of the service to achieve ideal performance.
本发明上述实施例中,通过获取目标服务的程序文件以及配置文件;根据所述程序文件以及配置文件,生成所述目标服务的镜像文件,根据所述镜像文件,创建并启动所述目标服务的实例容器,通过实例容器创建目标服务运行的环境镜像,对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。In the above embodiments of the present invention, by obtaining the program file and configuration file of the target service; according to the program file and configuration file, the image file of the target service is generated, and the image file of the target service is created and started according to the image file The instance container creates an environment image for running the target service through the instance container, and provides the target service externally. In the embodiment of the present invention, the process of arrangement and release of services is simple and efficient, and can be applied to various types of services, providing unified service encapsulation, providing standardized service call interfaces externally, and realizing standardized encapsulation and integration of diversified models. Agile publishing; and based on containerized flexible services, the resources and capacity of instance containers can be dynamically adjusted to achieve flexible scheduling of target service resource usage and high maintainability.
作为第二示例,以下结合图3、图4,介绍本发明提供的服务发布方法。As a second example, the service release method provided by the present invention will be introduced below with reference to FIG. 3 and FIG. 4 .
其中,图3中提供了一种服务发布装置300,包括:封装引擎301、编排引擎302、负载均衡模块303;其中,封装引擎301包括封装处理模块3011以及微服务转换模块3012;编排引擎302包括可视化处理模块3021。Wherein, a service publishing device 300 is provided in FIG. 3, including: an encapsulation engine 301, an arrangement engine 302, and a
参见图4,启动服务发布流程后,服务发布装置300的工作过程主要包括以下步骤:Referring to FIG. 4, after the service publishing process is started, the working process of the service publishing device 300 mainly includes the following steps:
步骤401,判断目标服务的属性是否为服务编排:若否,执行步骤402;
若是,执行步骤403,获取待编排的原子服务以及原子服务的配置信息,生成计算图配置文件,并执行步骤406;If so, execute
其中,可视化处理模块3021接收原子服务图标的部署,转换为原子服务的计算图配置文件,包括对总服务定义的配置信息、所需原子服务列表、各原子服务输入/输出参数列表,以及各原子服务间输入/输出参数的对应关系,并将计算图配置文件传入封装处理模块3011。封装处理模块3011将根据输入计算图配置文件中各原子服务运行依赖参数创建适配高级算法运行的环境镜像,并将计算图配置文件传入微服务转换模块3012。Among them, the visualization processing module 3021 receives the deployment of the atomic service icon and converts it into a calculation graph configuration file of the atomic service, including configuration information defined for the total service, a list of required atomic services, a list of input/output parameters of each atomic service, and a list of each atomic service Correspondence between input/output parameters between services, and transfer the calculation graph configuration file to the
步骤402,判断判断目标服务的属性是否为服务类封装:若否,执行步骤405;
若是,执行步骤404,接收配置文件,并执行步骤406;If yes, execute
步骤405,确定目标服务的属性为模型类封装或应用类封装,接收程序文件以及配置文件,并执行步骤406;
其中,封装处理模块3011接收程序文件以及配置文件。Wherein, the
步骤406,将程序文件转换成符合RPC接口协议的第一格式文件以及符合HTTP接口协议的第二格式文件,生成所述目标服务的镜像文件,并执行步骤407;
其中,微服务转换模块3012将程序文件转换成第一格式文件以及第二格式文件并传回至封装处理模块3011,用于封装处理模块3011生成所述目标服务的镜像文件,创建运行环境的基础镜像。Among them, the microservice conversion module 3012 converts the program file into the first format file and the second format file and sends it back to the
步骤407,创建并启动所述目标服务的实例容器。
步骤408,将实例容器注册至负载均衡模块303,对外提供所述目标服务。
进一步地,下面以AI服务为例,以不同属性的目标服务,介绍图3中服务发布装置300的工作过程。Further, the following uses AI service as an example and target services with different attributes to introduce the working process of the service publishing apparatus 300 in FIG. 3 .
(1)模型类封装(1) Model class encapsulation
模型类封装依次执行图4中的步骤401,步骤402,步骤405,步骤406、步骤407,步骤408;The model class encapsulation executes
具体地,模型类封装主要针对AI通用服务能力中核心模型算法的封装。模型开发人员上传模型文件和配置文件至封装处理模块3011;其中,模型文件包括计算图、数据流、以及相关变量的输入输出、签名及辅助文件等,配置文件包括模型使用框架、符合装置接口规范的输入/输出参数列表、数据流是否需要特殊处理标志、及模型发布成微服务相关运行参数配置等;封装处理模块3011根据模型使用框架等参数,创建适配模型算法运行的环境镜像。Specifically, model class encapsulation is mainly aimed at the encapsulation of core model algorithms in AI general service capabilities. Model developers upload model files and configuration files to the
下一步,配置文件及模型文件将会传入微服务转换模块3012,该模块根据配置中的输入/输出参数将模型文件处理成可供远程调用的RPC接口和标准HTTP接口服务,并传回封装处理模块3011。封装处理模块3011将处理后的服务并入之前的运行环境镜像中,最后封装成包含该服务及运行环境的基础镜像。In the next step, configuration files and model files will be passed to the microservice conversion module 3012, which will process the model files into RPC interface and standard HTTP interface services available for remote calls according to the input/output parameters in the configuration, and return the encapsulated
此后,该基础镜像及配置文件将输入负载均衡模块303,根据模型配置中输入的服务实例运行参数N(不设即为装置默认值),负载均衡模块303将基于该镜像创建N个运行服务实例的容器,并自动注册到负载均衡器上。Thereafter, the basic image and configuration file will be input into the
最后,负载均衡模块303将输出可提供该AI微服务的统一接口,以供不同场景下AI开发者便捷调用,快速开发。同时,负载均衡模块303会根据调用请求负载动态扩缩容运行服务实例的容器数,达到资源的高效动态分配。Finally, the
(2)应用类封装(2) Application class encapsulation
应用类封装依次执行图4中的步骤401,步骤402,步骤405,步骤406、步骤407,步骤408;The application class encapsulation executes
应用类封装主要针对AI服务能力中除核心模型算法外的关键逻辑算法部分的封装,通常用于组合多个原子模型间的逻辑算法、模型算法前的预处理逻辑算法等场景。Application class encapsulation is mainly aimed at the encapsulation of key logic algorithms in AI service capabilities other than core model algorithms, and is usually used in scenarios such as combining logic algorithms between multiple atomic models and preprocessing logic algorithms before model algorithms.
模型开发人员上传相应的程序代码文件和配置文件至封装处理模块3011,该模块根据代码语言格式、依赖包等参数,创建适配逻辑算法运行的环境镜像。The model developer uploads the corresponding program code files and configuration files to the
然后,程序代码文件和配置文件将会传入微服务转换模块3012,后续流程(步骤406、步骤407,步骤408)与上述模型类封装相同,本发明实施例在此不再赘述。Then, the program code file and configuration file will be transferred to the microservice conversion module 3012, and the subsequent process (step 406,
(3)服务类封装(3) Service class encapsulation
服务类封装依次执行图4中的步骤401,步骤402,步骤404,步骤406、步骤407,步骤408;The service class encapsulation executes
服务类主要针对外部引入成熟的AI服务,通过装置接口规范统一集成的场景。只需要通过装置的服务类封装引擎301上传描述外部服务相关参数的配置文件(如访问地址、输入/输出参数列表、参数是否需要转换标志、及发布成微服务相关运行参数配置等),封装处理模块3011就会将该AI服务封装成包含该服务运行环境的基础镜像。The service class is mainly aimed at introducing mature AI services from the outside and standardizing unified integration through device interfaces. It is only necessary to upload the configuration file describing external service-related parameters (such as access address, input/output parameter list, whether parameters need to be converted flags, and publishing microservice-related operating parameter configurations, etc.) through the service encapsulation engine 301 of the device, and the
然后,该基础镜像及配置文件将输入负载均衡模块303,后续流程(步骤406、步骤407,步骤408)与上述模型类封装相同,本发明实施例在此不再赘述。Then, the basic image and the configuration file will be input into the
(4)服务编排(4) Service orchestration
模型类封装依次执行上述图4中的步骤401,步骤403,步骤406、步骤407,步骤408;Model class encapsulation executes
通过封装处理模块3011处理,上述各个属性的目标服务的模块算法将被封装成一系列AI原子服务。对于需要将若干个原子服务进行组合的高级服务,本装置的编排引擎302将提供可视化的服务编排功能。Through the
编排引擎302接收对AI原子服务的配置信息,转换为原子服务的计算图配置文件,计算图配置文件包括总服务(目标服务)所需原子服务列表、各原子服务的配置信息,配置信息包括原子服务的输入/输出参数列表,以及各原子服务之间输入/输出参数的对应关系。The orchestration engine 302 receives the configuration information of the AI atomic service, and converts it into a computing graph configuration file of the atomic service. The computing graph configuration file includes a list of atomic services required by the total service (target service), configuration information of each atomic service, and the configuration information includes the atomic service. The input/output parameter list of the service, and the corresponding relationship between the input/output parameters of each atomic service.
封装处理模块3011将根据计算图配置文件中各原子服务的运行依赖参数创建适配高级算法运行的环境镜像,并将计算图配置文件传入微服务转换模块3012。The
微服务转换模块3012根据计算图配置文件中各原子服务间的对应关系,将相关原子服务有机关联起来,并传为封装处理模块3011,由其封装成包含统一输入/输出的通用AI服务接口及其运行环境的高级服务镜像。The microservice conversion module 3012 organically associates the relevant atomic services according to the correspondence between the atomic services in the calculation graph configuration file, and transfers them to the
然后,该高级服务镜像及计算图配置文件将输入负载均衡模块303,后续流程(步骤406、步骤407,步骤408)与上述模型类封装相同,本发明实施例在此不再赘述。Then, the high-level service image and the calculation graph configuration file will be input into the
此外,图3所示装置还提供以下功能:In addition, the device shown in Figure 3 also provides the following functions:
(1)多版本切换:AI服务属于前瞻性研究,需要不断地试错迭代才能够达到理想的效果。为了实现多个服务版本之间的无缝切换,本装置提供了灰度发布功能,可以在不完全终止服务的情况下,实现服务的平滑在线升级。(1) Multi-version switching: AI service is a forward-looking research, which requires continuous trial and error iterations to achieve the desired effect. In order to realize seamless switching between multiple service versions, this device provides a grayscale release function, which can realize smooth online upgrade of services without completely terminating the service.
(2)服务级监控:本装置提供平台级、服务级和容器级的细粒度监控功能。服务的故障可追溯到具体的主机、容器。(2) Service-level monitoring: This device provides platform-level, service-level and container-level fine-grained monitoring functions. Service failures can be traced back to specific hosts and containers.
(3)多用户管理:本装置支持多用户管理功能。用户可申请CPU、GPU等硬件资源,并创建、管理自己用户的应用和服务。(3) Multi-user management: This device supports multi-user management function. Users can apply for hardware resources such as CPU and GPU, and create and manage their own applications and services.
上述示例中,将在线发布平台、底层实现及资源配置独立化,实现多种深度学习框架模型不同场景的在线敏捷发布,发布效率快,使建模人员可以专注于模型的训练,而无需关注模型的服务化问题,加速AI模型应用到生产的效率;支持模型类、应用类和服务类封装,同时业务无感知的多模型版本无缝切换,对于AI服务的不同版本实现,通过在线服务平台提供的灰度发布能力,实现对业务而言无感知的服务升级;服务可实时监控和故障可追溯,运维人员可第一时间感知到服务的异常状态,并通过在线服务平台提供的完整服务调用日志,快速定位到具体的服务实例,可维护性高;通过CPU和GPU的混合调度、动态扩缩容等能力,可伸缩性强,可对生产提供高可用、高并发、低延时的在线服务。In the above example, the online release platform, underlying implementation, and resource configuration are independent, and the online agile release of various deep learning framework models in different scenarios is realized. The release efficiency is fast, so that modelers can focus on model training without paying attention to the model It can accelerate the efficiency of applying AI models to production; support the encapsulation of model classes, application classes, and service classes, and seamlessly switch between multi-model versions without business awareness. For the realization of different versions of AI services, they can be provided through the online service platform The gray-scale publishing capability realizes service upgrades that are not perceived by the business; the service can be monitored in real time and faults can be traced back, and the operation and maintenance personnel can perceive the abnormal state of the service at the first time, and call the complete service provided by the online service platform Logs can quickly locate specific service instances and have high maintainability; through the hybrid scheduling of CPU and GPU, dynamic expansion and contraction, etc., the scalability is strong, and it can provide high-availability, high-concurrency, and low-latency online for production. Serve.
以上介绍了本发明实施例提供的服务发布方法,下面将结合附图介绍本发明实施例提供的服务发布装置。The service publishing method provided by the embodiment of the present invention is described above, and the service publishing device provided by the embodiment of the present invention will be described below with reference to the accompanying drawings.
参见图5,本发明实施例提供了一种服务发布装置,所述装置包括:Referring to Fig. 5, an embodiment of the present invention provides a device for publishing a service, which includes:
获取模块501,用于获取目标服务的程序文件以及配置文件。The
其中,目标服务为当前运行环境中待编排和/或发布的服务,可以是经过深度学习训练成熟后AI服务,也可以是其他原子服务;本发明实施例中,原子服务指当前运行环境中最小的服务单元。目标服务根据其属性不同,对应的程序文件不同,比如,对于模型类服务,其程序文件为服务模型文件,包括计算图、数据流等模型;对于应用类服务,其程序文件为应用的程序代码包。Among them, the target service is the service to be arranged and/or published in the current operating environment, which can be an AI service matured after deep learning training, or other atomic services; in the embodiment of the present invention, the atomic service refers to the smallest service in the current operating environment service unit. The target service has different corresponding program files according to its attributes. For example, for model services, the program files are service model files, including models such as calculation graphs and data flows; for application services, the program files are application program codes Bag.
配置文件中包含目标服务的参数,比如目标服务的使用框架、符合预设接口规范的输入/输出参数列表等。The configuration file includes the parameters of the target service, such as the usage framework of the target service, the list of input/output parameters conforming to the preset interface specification, and so on.
文件生成模块502,用于根据所述程序文件以及配置文件,生成所述目标服务的镜像文件。The
其中,镜像文件为由程序文件以及配置文件生成的文件,用于提供该目标服务。将程序文件以及配置文件经过预设处理,封装成目标服务的镜像文件,以便于创建目标服务运行的环境镜像。Wherein, the image file is a file generated by a program file and a configuration file, and is used to provide the target service. The program files and configuration files are pre-processed and packaged into an image file of the target service, so as to create an environment image in which the target service runs.
服务发布模块503,用于根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。The
其中,实例容器为用于运行实例的虚拟容器,作为一种资源共享方式,实例容器可以提供极大的灵活性。根据所述镜像文件,创建实例容器并启动,在创建实例容器的过程中,将程序文件处理成可供外部、内部调用的服务,并将处理后的服务并入之前的运行环境镜像中,最后封装成包含该目标服务的当前运行环境的基础镜像,进而在当前运行环境下,可通过实例容器对外提供该目标服务,这样,后续当用户需要运行该目标服务时,只需启动该实例容器即可,无需再进行代码开发等底层开发工作,提高服务编排、发布时效。Among them, the instance container is a virtual container used to run the instance. As a resource sharing method, the instance container can provide great flexibility. According to the image file, the instance container is created and started. During the process of creating the instance container, the program file is processed into a service that can be called externally and internally, and the processed service is merged into the previous operating environment image. Finally, It is encapsulated into a basic image containing the current operating environment of the target service, and then in the current operating environment, the target service can be provided externally through the instance container, so that when the user needs to run the target service later, he only needs to start the instance container. Yes, there is no need to carry out underlying development work such as code development, and improve service arrangement and release timeliness.
且基于容器化的实例部署,可以实现柔性服务,提供弹性扩缩容功能,并且可监控目标服务的响应情况和每个实例容器的资源开销情况,最终实现动态调整容器的数量。可选地,实例容器可以是Docker容器或Mesos容器。And based on containerized instance deployment, it can realize flexible services, provide elastic expansion and contraction functions, and monitor the response of target services and the resource overhead of each instance container, and finally realize the dynamic adjustment of the number of containers. Optionally, the instance container can be a Docker container or a Mesos container.
可选地,本发明实施例中,所述获取模块501包括:Optionally, in the embodiment of the present invention, the acquiring
接收子模块,用于当目标服务的属性为模型类封装或应用类封装时,接收所述目标服务的程序文件以及配置文件。The receiving sub-module is used to receive the program file and configuration file of the target service when the attribute of the target service is packaged by model class or packaged by application class.
可选地,本发明实施例中,所述装置还包括:Optionally, in the embodiment of the present invention, the device further includes:
格式转换模块,用于根据所述配置文件,将所述程序文件转换成符合远程过程调用RPC接口协议的第一格式文件以及符合超文本传输协议HTTP接口协议的第二格式文件。The format conversion module is used to convert the program file into a first format file conforming to the remote procedure call RPC interface protocol and a second format file conforming to the hypertext transfer protocol HTTP interface protocol according to the configuration file.
可选地,本发明实施例中,当所述目标服务的属性为所述模型类封装时,所述程序文件为所述目标服务的模型文件,所述模型文件包括:计算图、数据流、变量参数和/或签名;所述模型文件的模型使用框架、接口规范和/或所述目标服务的配置参数;Optionally, in the embodiment of the present invention, when the attribute of the target service is encapsulated by the model class, the program file is a model file of the target service, and the model file includes: a calculation graph, a data flow, Variable parameters and/or signatures; the model usage framework of the model file, the interface specification and/or the configuration parameters of the target service;
当所述目标服务的属性为所述应用类封装时,所述程序文件为所述目标服务的程序代码文件;所述配置文件包括:所述程序代码文件的代码语言格式和/或依赖包。When the attribute of the target service is encapsulated by the application class, the program file is a program code file of the target service; the configuration file includes: a code language format and/or a dependency package of the program code file.
可选地,本发明实施例中,所述获取模块501包括:Optionally, in the embodiment of the present invention, the acquiring
获取子模块,用于当接收到进行服务编排的编排请求时,获取待编排的原子服务以及所述原子服务的配置信息;The obtaining submodule is used to obtain the atomic service to be arranged and the configuration information of the atomic service when receiving an arrangement request for service arrangement;
根据所述原子服务以及所述配置信息,生成计算图配置文件;Generate a calculation graph configuration file according to the atomic service and the configuration information;
获取预先设定的所述原子服务的程序文件,将所述原子服务的程序文件组合得到所述目标服务的程序文件,根据所述配置信息组合得到所述目标服务的配置文件。Obtaining the preset program files of the atomic services, combining the program files of the atomic services to obtain the program files of the target service, and combining the configuration files according to the configuration information to obtain the configuration files of the target services.
可选地,本发明实施例中,所述服务发布模块503包括:Optionally, in the embodiment of the present invention, the
第一创建子模块,用于根据所述配置文件中包括的所述实例容器的配置数目,创建并启动所述目标服务的实例容器;The first creating submodule is used to create and start the instance container of the target service according to the configuration number of the instance container included in the configuration file;
或or
第二创建子模块,用于创建并启动预设数目个所述目标服务的实例容器。The second creating submodule is used to create and start a preset number of instance containers of the target service.
可选地,本发明实施例中,所述装置还包括:Optionally, in the embodiment of the present invention, the device further includes:
资源分配模块,用于根据所述配置文件,为所述实例容器分配图形处理器GPU显存资源,并监控所述实例容器的GPU状态信息。The resource allocation module is configured to allocate graphics processor GPU memory resources to the instance container according to the configuration file, and monitor GPU state information of the instance container.
本发明上述实施例中,通过获取模块501获取目标服务的程序文件以及配置文件;文件生成模块502根据所述程序文件以及配置文件,生成所述目标服务的镜像文件,服务发布模块503根据所述镜像文件,创建并启动所述目标服务的实例容器,通过实例容器创建目标服务运行的环境镜像,对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。In the above-mentioned embodiments of the present invention, the program file and configuration file of the target service are obtained through the
图6示出了本发明又一实施例提供的一种电子设备的结构示意图。Fig. 6 shows a schematic structural diagram of an electronic device provided by another embodiment of the present invention.
参见图6,本发明实施例提供的电子设备,所述电子设备包括存储器(memory)61、处理器(processor)62、总线63以及存储在存储器61上并可在处理器上运行的计算机程序。其中,所述存储器61、处理器62通过所述总线63完成相互间的通信。Referring to FIG. 6 , an electronic device provided by an embodiment of the present invention includes a memory (memory) 61, a processor (processor) 62, a
所述处理器62用于调用所述存储器61中的程序指令,以执行所述程序时实现如本发明上述实施例中提供的方法。The
在另一种实施方式中,所述处理器执行所述程序时实现如下方法:In another implementation manner, the processor implements the following method when executing the program:
获取目标服务的程序文件以及配置文件;Obtain the program file and configuration file of the target service;
根据所述程序文件以及配置文件,生成所述目标服务的镜像文件;Generate a mirror image file of the target service according to the program file and the configuration file;
根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。According to the image file, an instance container of the target service is created and started, and the target service is provided externally through the instance container.
本发明实施例提供的电子设备,可用于执行上述方法实施例的方法对应的程序,本实施不再赘述。The electronic device provided by the embodiment of the present invention can be used to execute the program corresponding to the method in the foregoing method embodiment, and details will not be described in this embodiment.
本发明实施例提供的电子设备,通过获取目标服务的程序文件以及配置文件;根据所述程序文件以及配置文件,生成所述目标服务的镜像文件,根据所述镜像文件,创建并启动所述目标服务的实例容器,通过实例容器创建目标服务运行的环境镜像,对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。The electronic device provided by the embodiment of the present invention obtains the program file and configuration file of the target service; generates the image file of the target service according to the program file and the configuration file, and creates and starts the target service according to the image file The instance container of the service creates an environment image for running the target service through the instance container, and provides the target service externally. In the embodiment of the present invention, the process of arrangement and release of services is simple and efficient, and can be applied to various types of services, providing unified service encapsulation, providing standardized service call interfaces externally, and realizing standardized encapsulation and integration of diversified models. Agile publishing; and based on containerized flexible services, the resources and capacity of instance containers can be dynamically adjusted to achieve flexible scheduling of target service resource usage and high maintainability.
本发明又一实施例提供的一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质上存储有计算机程序,所述程序被处理器执行时实现如本发明上述实施例中提供的方法中的步骤。Another embodiment of the present invention provides a non-transitory computer-readable storage medium, in which a computer program is stored on the non-transitory computer-readable storage medium, and when the program is executed by a processor, the above-mentioned embodiments of the present invention are implemented The steps in the method provided in .
在另一种实施方式中,所述程序被处理器执行时实现如下方法:In another implementation manner, when the program is executed by the processor, the following methods are implemented:
获取目标服务的程序文件以及配置文件;Obtain the program file and configuration file of the target service;
根据所述程序文件以及配置文件,生成所述目标服务的镜像文件;Generate a mirror image file of the target service according to the program file and the configuration file;
根据所述镜像文件,创建并启动所述目标服务的实例容器,通过所述实例容器对外提供所述目标服务。According to the image file, an instance container of the target service is created and started, and the target service is provided externally through the instance container.
本发明实施例提供的非暂态计算机可读存储介质,所述程序被处理器执行时实现上述方法实施例的方法,本实施不再赘述。In the non-transitory computer-readable storage medium provided by the embodiments of the present invention, when the program is executed by a processor, the method in the foregoing method embodiment is implemented, and details will not be repeated in this embodiment.
本发明实施例提供的非暂态计算机可读存储介质,通过获取目标服务的程序文件以及配置文件;根据所述程序文件以及配置文件,生成所述目标服务的镜像文件,根据所述镜像文件,创建并启动所述目标服务的实例容器,通过实例容器创建目标服务运行的环境镜像,对外提供所述目标服务。本发明实施例中,服务的编排、发布过程简单,效率较高,可适用于多种类型的服务,提供统一的服务化封装,对外提供标准化的服务调用接口,实现多样化模型的标准化封装和敏捷发布;且基于容器化的柔性服务,可动态调整实例容器的资源及容量,实现目标服务资源使用的弹性调度,可维护性高。The non-transitory computer-readable storage medium provided by the embodiment of the present invention obtains the program file and configuration file of the target service; generates the image file of the target service according to the program file and configuration file, and according to the image file, An instance container of the target service is created and started, an environment image for running the target service is created through the instance container, and the target service is provided externally. In the embodiment of the present invention, the process of arrangement and release of services is simple and efficient, and can be applied to various types of services, providing unified service encapsulation, providing standardized service call interfaces externally, and realizing standardized encapsulation and integration of diversified models. Agile publishing; and based on containerized flexible services, the resources and capacity of instance containers can be dynamically adjusted to achieve flexible scheduling of target service resource usage and high maintainability.
本发明又一实施例公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:Yet another embodiment of the present invention discloses a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer When, the computer can execute the method provided by the above method embodiments, for example including:
接收到终端发送的失败回切请求时,确定所述失败回切请求对应的目标小区;所述失败回切请求为终端执行增强的单一无线语音呼叫连续性ESRVCC切换执行失败后的回建请求;When the failed switchback request sent by the terminal is received, the target cell corresponding to the failed switchback request is determined; the failed switchback request is a reset request after the terminal performs enhanced single wireless voice call continuity ESRVCC switching execution failure;
确定对应于所述目标小区的失败回切请求的请求次数;determining the number of failed handover requests corresponding to the target cell;
当所述请求次数达到所述目标小区的预设阈值时,停止转发针对所述目标小区的ESRVCC切换请求。When the number of requests reaches the preset threshold of the target cell, stop forwarding the ESRVCC handover request for the target cell.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810856676.9A CN110780914B (en) | 2018-07-31 | 2018-07-31 | Service publishing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810856676.9A CN110780914B (en) | 2018-07-31 | 2018-07-31 | Service publishing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110780914A CN110780914A (en) | 2020-02-11 |
CN110780914B true CN110780914B (en) | 2022-12-27 |
Family
ID=69382827
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810856676.9A Active CN110780914B (en) | 2018-07-31 | 2018-07-31 | Service publishing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110780914B (en) |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113391872B (en) * | 2020-03-11 | 2024-11-01 | 北京金山云网络技术有限公司 | Task processing method and device, electronic equipment and storage medium |
CN111367534B (en) * | 2020-03-19 | 2023-05-09 | 远光软件股份有限公司 | Service arrangement method and system based on application environment |
CN111857653A (en) * | 2020-05-26 | 2020-10-30 | 伏羲科技(菏泽)有限公司 | Microservice management method and device |
CN113312100B (en) * | 2020-05-28 | 2025-02-18 | 阿里巴巴集团控股有限公司 | A service operation method and device |
CN112015372B (en) * | 2020-07-24 | 2022-12-23 | 北京百分点科技集团股份有限公司 | Arranging method, processing method, device and electronic equipment for heterogeneous services |
CN111913715A (en) * | 2020-07-30 | 2020-11-10 | 上海数策软件股份有限公司 | Micro-service based machine learning automation process management and optimization system and method |
CN111917586A (en) * | 2020-08-07 | 2020-11-10 | 北京凌云雀科技有限公司 | Container bandwidth adjusting method, server and storage medium |
CN112288096A (en) * | 2020-10-22 | 2021-01-29 | 济南浪潮高新科技投资发展有限公司 | Rapid building and releasing method for machine learning model mirror image based on rapid machine learning model |
CN113296740A (en) * | 2020-11-30 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Service object processing method, device, equipment and machine readable medium |
CN112527357B (en) * | 2020-12-14 | 2024-08-23 | 中国平安人寿保险股份有限公司 | Service hot loading updating method, device, computer equipment and storage medium |
CN114691231A (en) * | 2020-12-29 | 2022-07-01 | 深圳云天励飞技术股份有限公司 | A data pipeline arrangement method, device, readable storage medium and terminal device |
CN112817581A (en) * | 2021-02-20 | 2021-05-18 | 中国电子科技集团公司第二十八研究所 | Lightweight intelligent service construction and operation support method |
CN113407347B (en) * | 2021-06-30 | 2023-02-24 | 北京百度网讯科技有限公司 | Resource scheduling method, device, equipment and computer storage medium |
CN113703784A (en) * | 2021-08-25 | 2021-11-26 | 上海哔哩哔哩科技有限公司 | Data processing method and device based on container arrangement |
CN113918232B (en) * | 2021-09-07 | 2024-05-03 | 深圳云天励飞技术股份有限公司 | Algorithm service calling method, device, server and storage medium |
CN114003248B (en) * | 2021-10-29 | 2022-11-25 | 深圳萨摩耶数字科技有限公司 | Model management method and device, electronic equipment and storage medium |
CN115618239B (en) * | 2022-12-16 | 2023-04-11 | 四川金信石信息技术有限公司 | Management method, system, terminal and medium for deep learning framework training |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105677356A (en) * | 2016-01-11 | 2016-06-15 | 上海雷腾软件股份有限公司 | Operation and maintenance method and device |
CN105959138A (en) * | 2016-04-29 | 2016-09-21 | 深圳前海大数点科技有限公司 | Micro-service dynamic disposition system and method based on cloud calculation |
CN108052333A (en) * | 2017-12-11 | 2018-05-18 | 北京紫优能源科技有限公司 | A kind of power scheduling centralized control system standardization Automation arranging method and framework |
CN108279892A (en) * | 2018-02-27 | 2018-07-13 | 郑州云海信息技术有限公司 | It is a kind of to split the method, apparatus and equipment that large-scale application service is micro services |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008017001A2 (en) * | 2006-08-02 | 2008-02-07 | Moka5, Inc. | Sharing live appliances |
CN101557297B (en) * | 2009-05-14 | 2011-06-22 | 中兴通讯股份有限公司 | Internet-based open telecommunication service generation system and method thereof |
US8627309B2 (en) * | 2010-02-25 | 2014-01-07 | Microsoft Corporation | Automated deployment and servicing of distributed applications |
CN102999338A (en) * | 2012-11-20 | 2013-03-27 | 北京思特奇信息技术股份有限公司 | Business development method and device |
CN104954232A (en) * | 2014-03-28 | 2015-09-30 | 杭州华为企业通信技术有限公司 | Method and device for service combination in network |
CN105306542B (en) * | 2015-09-25 | 2018-12-14 | 北京奇艺世纪科技有限公司 | A kind of system for integrating web service |
US10402181B2 (en) * | 2016-07-18 | 2019-09-03 | Airwatch Llc | Generating and optimizing deployment configurations for enrolled devices |
US10095539B2 (en) * | 2016-07-25 | 2018-10-09 | International Business Machines Corporation | Automated data structure-driven orchestration of complex server provisioning tasks |
CN106775912A (en) * | 2016-12-15 | 2017-05-31 | 广州视源电子科技股份有限公司 | Software release method and system |
CN107092489B (en) * | 2017-04-13 | 2020-06-30 | 中国联合网络通信集团有限公司 | Processing method and system based on application version release |
CN108008961A (en) * | 2017-11-30 | 2018-05-08 | 郑州云海信息技术有限公司 | The mirror image management method and system of a kind of PaaS platform |
CN108306866A (en) * | 2018-01-16 | 2018-07-20 | 厦门明延科技有限公司 | A kind of Enterprise Service Bus platform and data analysing method |
-
2018
- 2018-07-31 CN CN201810856676.9A patent/CN110780914B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105677356A (en) * | 2016-01-11 | 2016-06-15 | 上海雷腾软件股份有限公司 | Operation and maintenance method and device |
CN105959138A (en) * | 2016-04-29 | 2016-09-21 | 深圳前海大数点科技有限公司 | Micro-service dynamic disposition system and method based on cloud calculation |
CN108052333A (en) * | 2017-12-11 | 2018-05-18 | 北京紫优能源科技有限公司 | A kind of power scheduling centralized control system standardization Automation arranging method and framework |
CN108279892A (en) * | 2018-02-27 | 2018-07-13 | 郑州云海信息技术有限公司 | It is a kind of to split the method, apparatus and equipment that large-scale application service is micro services |
Non-Patent Citations (1)
Title |
---|
【架构师】微服务架构--REST与RPC;老莫8;《https://blog.csdn.net/laomo_bible/article/details/79677677》;20180324;第1-3页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110780914A (en) | 2020-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110780914B (en) | Service publishing method and device | |
CN112799789B (en) | Node cluster management method, device, equipment and storage medium | |
Coutinho et al. | Fogbed: A rapid-prototyping emulation environment for fog computing | |
CN110888722B (en) | Task processing method and device, electronic equipment and computer readable storage medium | |
CN111461332B (en) | Deep learning model online reasoning method and device, electronic equipment and storage medium | |
US10884808B2 (en) | Edge computing platform | |
EP3731161A1 (en) | Model application method and system, and model management method and server | |
CN112581578B (en) | Cloud rendering system based on software definition | |
CN111741134A (en) | A system and method for rapid construction of virtual machines in large-scale scenes of network shooting range | |
CN115297008B (en) | Collaborative training method, device, terminal and storage medium based on intelligent computing network | |
WO2023029961A1 (en) | Task execution method and system, electronic device, and computer storage medium | |
CN103677983A (en) | Scheduling method and device of application | |
Patil et al. | Distributed rendering system for 3D animations with Blender | |
CN113946389A (en) | Federated learning process execution optimization method, device, storage medium and program product | |
US20200286012A1 (en) | Model application method, management method, system and server | |
CN114610404A (en) | Component calling method and device based on application framework and computer equipment | |
CN119440621A (en) | Model conversion method, related device and medium | |
CN109005060B (en) | Deep learning application optimization framework based on hierarchical highly heterogeneous distributed system | |
Wang et al. | Edge computing for artificial intelligence | |
Qi et al. | A Novel Distributed Orchestration Engine for Time-Sensitive Robotic Service Orchestration Based on Cloud-Edge Collaboration | |
CN118295777A (en) | Message processing method, electronic device, storage medium and computer program product | |
CN109117146A (en) | Automatic deployment method, device, storage medium and the computer equipment of cloud platform duoble computer disaster-tolerance system | |
CN117749407A (en) | 6G communication network architecture generation method, system, electronic equipment and medium | |
CN116204321A (en) | Model acquisition and model deployment methods, devices, equipment and media | |
CN107169024A (en) | The operation system and service implementation method of a kind of compatible type |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |