WO2023168875A1 - Method and apparatus for starting model service, and device, medium and product - Google Patents

Method and apparatus for starting model service, and device, medium and product Download PDF

Info

Publication number
WO2023168875A1
WO2023168875A1 PCT/CN2022/105180 CN2022105180W WO2023168875A1 WO 2023168875 A1 WO2023168875 A1 WO 2023168875A1 CN 2022105180 W CN2022105180 W CN 2022105180W WO 2023168875 A1 WO2023168875 A1 WO 2023168875A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
model
service model
information
image file
Prior art date
Application number
PCT/CN2022/105180
Other languages
French (fr)
Chinese (zh)
Inventor
罗阳
钱正宇
胡鸣人
施恩
袁正雄
褚振方
黄悦
王国彬
李金麒
Original Assignee
北京百度网讯科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 北京百度网讯科技有限公司 filed Critical 北京百度网讯科技有限公司
Publication of WO2023168875A1 publication Critical patent/WO2023168875A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of computer technology, particularly to the field of AI platform technology, and specifically to a method, device, equipment, medium and product for starting a model service.
  • AI Artificial Intelligence
  • AI services provide services to users through the AI service platform, enabling the deployment and launch of customer-customized AI models. As the number of customers increases, the number of different models increases and the memory resources occupied become increasingly large.
  • the present disclosure provides a method, device, equipment, storage medium and program product for starting a model service.
  • a method of starting a model service including: in response to a service model being triggered to start, obtaining an image file corresponding to the service model, wherein the image file includes the service model meta information, and context information of the service process run by the service model; load the image file to start the service model for service.
  • a device for starting a model service including: an acquisition module, configured to acquire an image file corresponding to the service model when the service model is triggered to start, wherein the image file includes meta information of the service model and context information of the service process run by the service model; a startup module is used to load the image file to start the service model.
  • an electronic device including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores information that can be used by the at least one processor.
  • Execution instructions the instructions are executed by the at least one processor to enable the at least one processor to execute the method for starting a model service according to any one of the present disclosure.
  • a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the startup model service according to any one of the present disclosure.
  • a computer program product including a computer program that, when executed by a processor, implements the method for starting a model service described in any one of the present disclosure.
  • Figure 1 is a schematic flowchart of a method of starting a model service according to the present disclosure
  • Figure 2 is a schematic flowchart of a method of creating an image file according to the present disclosure
  • Figure 3 is a schematic flowchart of a method for running a service process according to the control service model of the present disclosure
  • Figure 4 is a schematic flowchart of a method for obtaining context information of a service process running a service model and meta-information of the service model according to the present disclosure
  • Figure 5 is a schematic flowchart of a method for obtaining context information of a service process running a service model and meta-information of the service model according to the present disclosure
  • Figure 6 is a schematic flowchart of a method of loading the image file to start the service model according to the present disclosure
  • Figure 7 is a schematic system structure diagram for implementing a method of starting a model service according to the present disclosure
  • Figure 8 is a block diagram of a device for launching a model service according to the present disclosure.
  • Figure 9 is a block diagram of a device for launching a model service according to the present disclosure.
  • FIG. 10 is a block diagram of an electronic device used to implement a method for starting a model service according to an embodiment of the present disclosure.
  • AI simulates responses in a manner similar to human intelligence.
  • Research in this field includes robotics, language recognition, image recognition, natural language processing, and expert systems. Since the birth of AI technology, the theory and technology have become increasingly mature, and it has been widely used in various industries. By combining business in this field with AI technology, costs can be reduced and efficiency increased.
  • the model in order to solve the time-consuming problem of AI model loading, the model can be pruned, quantified, and other operations can be performed to reduce the model size to speed up the loading of the AI model.
  • pruning and quantifying the model will reduce the model service accuracy, and pruning and quantifying the model will also increase costs.
  • use lazy loading when starting the AI model to improve the startup speed of the model For example, do not adopt an inter-layer fusion strategy or do not use instruction set optimization, etc.
  • the AI model loading speed can only be limitedly improved, and it affects the speed of using the model for inference, causing traffic loss.
  • embodiments of the present disclosure provide a method for starting the model service.
  • the image file corresponding to the AI service model is obtained and loaded.
  • the AI model is quickly loaded to realize the startup of the service. , thereby improving user experience.
  • Figure 1 is a schematic flowchart of a method of starting a model service according to the present disclosure. As shown in Figure 1, the method of the present disclosure includes the following steps.
  • step S101 in response to the service model being triggered to start, an image file corresponding to the service model is obtained, where the image file includes meta-information of the service model and context information of the service process run by the service model.
  • the service model is an AI service model as an example for description.
  • the image file corresponding to the AI service model is obtained to realize the normal application of the AI service model.
  • the image file includes meta-information of the AI service model.
  • the meta-information is used to record the functions of the AI service model and the conditions for implementing model inference services and other self-dependencies. It can include: service process identifier, service Universal Resource Locator (Universal Resource Locator, URL) and other service logs, etc.
  • the image file corresponding to the AI service model also includes context information of the service process run by the service model, such as the process of loading the model into memory, the status of the AI service model process, etc.
  • step S102 the image file is loaded to start the service model for service.
  • the model when starting the AI service model, the model is not loaded, but the image file corresponding to the AI service model is obtained, and the AI service model is started to provide services through the obtained image file.
  • the image file corresponding to the AI service model is obtained, and the AI service model is started by loading the image file, thereby reducing the model startup time and improving the model service startup speed, thereby improving user experience. experience.
  • Figure 2 is a schematic flowchart of a method of creating an image file according to the present disclosure. As shown in Figure 2, the method of the present disclosure includes the following steps.
  • step S201 the service model is controlled to run the service process.
  • the image file corresponding to the AI service model may be created in advance, the image file may be created when the AI service model service is first started, or the image file may be created before the AI service model provides services.
  • Controlling the running service process of the AI service model includes installing the environment required to run the AI service model, for example, configuring the underlying hardware driver, installing the dependent libraries required to run the AI service model, etc. After the running environment is installed, the AI service model is started to provide corresponding services. Understandably, the AI service model can provide services based on various protocols, such as Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP) services and remote procedure calls. (Remote Procedure Call, RPC) service, Transmission Control Protocol (Transmission Control Protocol, TCP) service, etc. This embodiment of the present disclosure does not limit this.
  • Hyper Text Transfer Protocol Hyper Text Transfer Protocol
  • HTTP Hyper Text Transfer Protocol
  • RPC Remote Procedure Call
  • TCP Transmission Control Protocol
  • step S202 the context information of the service process run by the service model and the meta-information of the service model are obtained.
  • the context information of the service process run by the service model and the meta-information of the service model can be obtained through checkpoint operations.
  • the system call (ptrace) mechanism a special code is injected into the service process run by the service model and run to collect the context information of the service process.
  • the parent process can monitor and control other processes, change the registers and kernel images in the child process, and implement breakpoint debugging and system call tracing.
  • the system call if the current process is in a "tracked" state, control is given to the tracking process so that the tracking process can view or modify the registers of the tracked process.
  • the context information of the service process run by the AI service model and the metainformation of the service model are dumped corresponding to the Checkpoint checkpoint.
  • step S203 an image file including meta information and context information is created.
  • the context information of the service process run by the AI service model and the meta-information of the AI service model obtained are dumped to create an image file including the meta-information and context information of the AI service model.
  • the backend can support local storage, distributed storage, object storage and other methods to realize the storage of image files.
  • the AI service model runs the service process to provide services, and creates an image file including the context information of the running service process and the meta-information of the service model, so that when the AI service model is triggered again, the AI is started by loading the image file.
  • Service model improve the model service startup speed and reduce the model service startup time.
  • Figure 3 is a schematic flowchart of a method for running a service process according to the control service model of the present disclosure. As shown in Figure 3, the method of the present disclosure includes the following steps.
  • step S301 the running service model is called.
  • step S302 the working instance included in the service model is triggered to load the service model to wake up the service model and run the service process.
  • the AI service model is started, and the AI service model runs a service process to provide corresponding services. You can call the running AI service model through a script and trigger the work instance included in the AI service model to load the service model.
  • the AI service model can include multiple work instances, and multiple work instances use the service model in parallel to perform reasoning to provide services.
  • the running AI service model is called, the working instance in the AI service model is triggered to load the AI service model, to wake up the service model to run the service process, and obtain the context information of the service process run by the service model and the service model's Meta information makes the image file corresponding to the service model include the information of the AI service model, providing guarantee for starting the AI service model by loading the image file.
  • Figure 4 is a schematic flowchart of a method for obtaining context information of a service process running a service model and meta-information of the service model according to the present disclosure. As shown in Figure 4, the method of the present disclosure includes the following steps.
  • step S401 in response to determining that the service model is successfully awakened, context information of the service process run by the service model is monitored.
  • step S402 context information is stored and meta-information of the service model is recorded.
  • the AI service model starts and runs the service process to provide corresponding services.
  • the AI service model includes multiple working instances. The multiple working instances respond to the received request to call the AI service, load the AI service model, and perform inference work based on the loaded AI service model.
  • polling multiple work instances included in the AI service model it is determined that the AI service model has been awakened successfully.
  • a Checkpoint operation is performed on the AI service model to store the context information of the service process run by the model and record the meta-information of the AI service model.
  • the running AI service model is called, and the AI service model running service process is awakened.
  • the context information of the service process run by the AI service model is stored, and the elements of the AI service model are recorded.
  • Figure 5 is a schematic flowchart of a method for obtaining context information of a service process run by the service model and meta-information of the service model according to the present disclosure. As shown in Figure 5, the method of the present disclosure includes the following steps.
  • step S501 if it is determined that the working instances larger than the number threshold have completed loading of the service model, and inference based on the service model has been successfully completed, it is determined that the service model has been awakened successfully.
  • step S502 the context information of the service process run by the service model is monitored.
  • step S503 context information is stored and meta-information of the service model is recorded.
  • an image file is created that includes the meta-information of the AI service model and the context information of the service process run by the AI service model, so that when the AI service model is started, the AI service model can be loaded based on the image file instead.
  • the running AI service model is called through a script, triggering multiple working instances included in the AI service model to load the service model.
  • the context information of the service process run by the service model is stored, and the meta-information of the service model is recorded, thereby creating a mirror file of meta-information and context information.
  • multiple working instances included in the AI service model load the AI service model in response to the received request to call the AI service, and perform inference work based on the loaded AI service model. If it is determined that the working instances larger than the number threshold have completed the loading of the service model, and the inference based on the service model has been successfully completed, it is determined that the service model has been awakened successfully.
  • the running AI service model is called, the AI service model is awakened to run the service process, and the working instances greater than the number threshold are determined to complete the loading of the AI service model, and when inference is successfully completed based on the AI service model, the AI service model is stored.
  • Figure 6 is a schematic flowchart of a method of loading the image file to start the service model according to the present disclosure. As shown in Figure 6, the method of the present disclosure includes the following steps.
  • step S601 the image file is parsed to obtain the context information of the service process and the meta-information of the service model.
  • the AI service model is started and run to provide services.
  • the AI service model is started and run to provide services.
  • the image file including the meta information of the AI service model and the context information of the service process run by the AI service model, instead of modifying the AI service model, Load to restore the service of the AI service model. Copy the image file locally, load it into memory, and parse the image file to obtain the context information of the AI service process and the metainformation of the AI service model.
  • step S602 based on the meta-information of the service model and the context information of the service process, the target running state of the service process run by the service model is determined.
  • step S603 the service process run by the service model is controlled to provide services in the target operating state.
  • the target operating state of the AI service model is determined by parsing the obtained meta-information of the AI service model and the context information of the service process, that is, restoring the operating state of the AI service model to the AI service included in the image file.
  • the AI service model continues to provide services based on the target operating status.
  • the AI service model when the AI service model needs to be started, there is no need to load the model.
  • the AI service model is restored by reading and parsing the pre-created image file, and the service is restored based on the meta-information of the service model and the context information of the service process.
  • the running status of the service process run by the model ensures that the model can effectively provide services, reduce model startup time, and improve model service startup speed.
  • Figure 7 is a schematic structural diagram of a system for implementing a method of starting a model service according to the present disclosure.
  • the method of starting model services in the embodiment of the present disclosure can be implemented based on Checkpoint and Restore in User space (CRIU) in user space.
  • CRIU can implement checkpoint and recovery functions in user space. , that is, checkpoint process files, apply the process files obtained from backup, and restore the process.
  • the system can include a launch module, a warm up module, a dump module, a restore module, a storage module, etc.
  • the launch module is responsible for installing the environmental dependencies required for the operation of AI services, including underlying hardware drivers, dependency libraries required for runtime, etc., and starting the AI services normally, and providing external services based on HTTP services, RPC services, TCP services, etc.
  • the Launch module uses multiple algorithms to launch multiple AI services.
  • the warmup module calls the AI service run by the AI service model through a script, triggering multiple working instances inside the AI service to receive requests to call the running service process to wake up the AI service.
  • the Dump module rotates and trains whether the warmup module has completed the awakening of the AI service model, that is, multiple instances within the AI service model have completed loading the service model, and completed inference work based on the service model.
  • the storage module stores the image files generated by the checkpoint operation of the dump module, and provides a unified application interface to shield the specific storage details of the backend.
  • the backend can be implemented in various ways such as local storage, distributed storage, and object storage.
  • the recovery module copies the image file corresponding to the AI service model from the storage module to the local, loads it into the memory, analyzes it, restores the running status of the service process run by the AI service model, and continues to provide external services.
  • the recovery module can also implement multiple loading of image files corresponding to the AI service model through the above method.
  • the image file corresponding to the AI service model is read instead of loading the model, thereby reducing the model startup time and improving the model service startup speed, thereby improving the user experience.
  • embodiments of the present disclosure also provide a device for starting a model service.
  • the device provided by the embodiments of the present disclosure includes hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to go beyond the scope of the technical solutions of the embodiments of the present disclosure.
  • FIG. 8 is a block diagram of a device for launching a model service according to the present disclosure.
  • the device 700 for starting a model service in the embodiment of the present disclosure includes: an acquisition module 701 and a startup module 702.
  • the acquisition module 701 is used to obtain the image file corresponding to the service model when the service model is triggered to start, where the image file includes meta-information of the service model and context information of the service process run by the service model;
  • the startup module 702 is used to load the image file to start the service model for service.
  • Figure 9 is a block diagram of a device for launching a model service according to the present disclosure.
  • the device 700 for starting a model service in the embodiment of the present disclosure also includes: a creation module 703.
  • the creation module 703 is used to control the service model to run the service process, obtain the context information of the service process run by the service model and the meta-information of the service model, and create an image file including meta-information and context information.
  • the creation module 703 is also used to: call the running service model; trigger the work instance included in the service model to load the service model to wake up the service model to run the service process.
  • the acquisition module 701 is further configured to: in response to determining that the service model is successfully awakened, monitor the context information of the service process run by the service model; store the context information, and record the meta-information of the service model.
  • the acquisition module 701 is also configured to determine that the service model is successfully awakened if it is determined that the working instances greater than the number threshold complete loading of the service model and inference is successfully completed based on the service model.
  • the startup module 702 is also used to: parse the image file to obtain the context information of the service process and the meta-information of the service model; determine the service model based on the meta-information of the service model and the context information of the service process.
  • the target running state of the running service process control the service process run by the service model to provide services in the target running state.
  • the device for starting model services when the AI service model starts and provides services, the image file corresponding to the AI service model is obtained, and the AI service model is started by loading the image file, thereby reducing the model startup time. Improve the startup speed of model services to improve user experience.
  • the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
  • FIG. 10 shows a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present disclosure.
  • Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
  • the device 800 includes a computing unit 801 that can execute according to a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803 Various appropriate actions and treatments. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored.
  • Computing unit 801, ROM 802 and RAM 803 are connected to each other via bus 804.
  • An input/output (I/O) interface 805 is also connected to bus 804.
  • the I/O interface 805 includes: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc. ; and communication unit 809, such as a network card, modem, wireless communication transceiver, etc.
  • the communication unit 809 allows the device 800 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
  • Computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processing processor (DSP), and any appropriate processor, controller, microcontroller, etc.
  • the computing unit 801 performs various methods and processes described above, such as a method of starting a model service.
  • the method of launching the model service may be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 808.
  • part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809.
  • the computer program When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the method of starting the model service described above may be performed.
  • the computing unit 801 may be configured to perform the method of starting the model service in any other suitable manner (eg, by means of firmware).
  • Various implementations of the systems and techniques described above may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip implemented in a system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or a combination thereof.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOC system
  • CPLD load programmable logic device
  • computer hardware firmware, software, and/or a combination thereof.
  • These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor
  • the processor which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
  • An output device may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
  • An output device may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
  • Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented.
  • the program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or a trackball
  • Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
  • Computer systems may include clients and servers.
  • Clients and servers are generally remote from each other and typically interact over a communications network.
  • the relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.
  • the server can be a cloud server, a distributed system server, or a server combined with a blockchain.
  • the present disclosure can obtain the image file corresponding to the AI service model when the AI service model is started and provides services, and realize the startup of the AI service model by loading the image file, thereby reducing the model startup time and improving the model Service startup speed, thereby improving user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A method and apparatus for starting a model service, and a device, a medium and a product, which relate to the technical field of computers, and in particular, to the technical field of AI platforms. The method comprises: in response to a service model being triggered to start, acquiring a mirror file corresponding to the service model, wherein the mirror file comprises meta-information of the service model, and context information of a service process, which is run by the service model (S101); and loading the mirror file, so as to start the service model for a service (S102). By means of the method, a mirror file corresponding to a service model can be acquired, and the service model is started by loading the mirror file, such that the time for starting the model is shortened, and the speed for starting a model service is accelerated, thereby improving the user experience.

Description

启动模型服务的方法、装置、设备、介质及产品Methods, devices, equipment, media and products for initiating model services 技术领域Technical field
本公开涉及计算机技术领域,尤其涉及AI平台技术领域,具体涉及一种启动模型服务的方法、装置、设备、介质及产品。The present disclosure relates to the field of computer technology, particularly to the field of AI platform technology, and specifically to a method, device, equipment, medium and product for starting a model service.
背景技术Background technique
随着科技的进步,人工智能(Artificial Intelligence,AI)技术得以飞速发展,应用于人类生活中的各个领域。例如,智能家居、智能穿戴设备、虚拟助理、自动驾驶、无人机、机器人、智能医疗、智能客服等,均属于AI技术的范畴。With the advancement of science and technology, artificial intelligence (Artificial Intelligence, AI) technology has developed rapidly and is applied to various fields in human life. For example, smart homes, smart wearable devices, virtual assistants, autonomous driving, drones, robots, smart medical care, smart customer service, etc., all fall under the category of AI technology.
AI服务通过AI服务平台为用户提供服务,实现客户定制化AI模型的部署与上线,随着客户量的增加,不同模型数量激增,占用的内存资源越来越庞大。AI services provide services to users through the AI service platform, enabling the deployment and launch of customer-customized AI models. As the number of customers increases, the number of different models increases and the memory resources occupied become increasingly large.
发明内容Contents of the invention
本公开提供了一种用于启动模型服务的方法、装置、设备、存储介质及程序产品。The present disclosure provides a method, device, equipment, storage medium and program product for starting a model service.
根据本公开的一方面,提供了一种启动模型服务的方法,包括:响应于服务模型被触发启动,获取所述服务模型所对应的镜像文件,其中,所述镜像文件中包括所述服务模型的元信息,以及所述服务模型所运行服务进程的上下文信息;加载所述镜像文件,以启动所述服务模型进行服务。According to an aspect of the present disclosure, a method of starting a model service is provided, including: in response to a service model being triggered to start, obtaining an image file corresponding to the service model, wherein the image file includes the service model meta information, and context information of the service process run by the service model; load the image file to start the service model for service.
根据本公开的另一方面,提供了一种启动模型服务的装置,包括:获取模块,用于当服务模型被触发启动时,获取所述服务模型所对应的镜像文件,其中,所述镜像文件中包括所述服务模型的元信息,以及所述服务模型所运行服务进程的上下文信息;启动模块,用于加载所述镜像文件,以启动所述服务模型。According to another aspect of the present disclosure, a device for starting a model service is provided, including: an acquisition module, configured to acquire an image file corresponding to the service model when the service model is triggered to start, wherein the image file includes meta information of the service model and context information of the service process run by the service model; a startup module is used to load the image file to start the service model.
根据本公开的又一方面,提供了一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理 器执行,以使所述至少一个处理器能够执行本公开中任一项所述的启动模型服务的方法。According to yet another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores information that can be used by the at least one processor. Execution instructions, the instructions are executed by the at least one processor to enable the at least one processor to execute the method for starting a model service according to any one of the present disclosure.
根据本公开的又一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行本公开中任一项所述的启动模型服务的方法。According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the startup model service according to any one of the present disclosure. Methods.
根据本公开的又一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现本公开中任一项所述的启动模型服务的方法。According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method for starting a model service described in any one of the present disclosure.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of the drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. in:
图1是根据本公开的启动模型服务的方法的流程示意图;Figure 1 is a schematic flowchart of a method of starting a model service according to the present disclosure;
图2是根据本公开的创建镜像文件的方法的流程示意图;Figure 2 is a schematic flowchart of a method of creating an image file according to the present disclosure;
图3是根据本公开的控制服务模型运行服务进程方法的流程示意图;Figure 3 is a schematic flowchart of a method for running a service process according to the control service model of the present disclosure;
图4是根据本公开的获取服务模型所运行服务进程的上下文信息以及服务模型的元信息方法的流程示意图;Figure 4 is a schematic flowchart of a method for obtaining context information of a service process running a service model and meta-information of the service model according to the present disclosure;
图5是根据本公开的获取服务模型所运行服务进程的上下文信息以及服务模型的元信息方法的流程示意图;Figure 5 is a schematic flowchart of a method for obtaining context information of a service process running a service model and meta-information of the service model according to the present disclosure;
图6是根据本公开的加载所述镜像文件,以启动所述服务模型方法的流程示意图;Figure 6 is a schematic flowchart of a method of loading the image file to start the service model according to the present disclosure;
图7是根据本公开的实现启动模型服务的方法的系统结构示意图;Figure 7 is a schematic system structure diagram for implementing a method of starting a model service according to the present disclosure;
图8是根据本公开的启动模型服务的装置的框图;Figure 8 is a block diagram of a device for launching a model service according to the present disclosure;
图9是根据本公开的启动模型服务的装置的框图;Figure 9 is a block diagram of a device for launching a model service according to the present disclosure;
图10是用来实现本公开实施例的启动模型服务的方法的电子设备的框图。FIG. 10 is a block diagram of an electronic device used to implement a method for starting a model service according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
AI作为计算机科学的一个分支,仿真以人类智能相似的方式做出反应,该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等。AI技术诞生以来,理论和技术日益成熟,其在各行各业被广泛应用,通过将本领域业务与AI技术相结合的方式,进行降本增效。As a branch of computer science, AI simulates responses in a manner similar to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing, and expert systems. Since the birth of AI technology, the theory and technology have become increasingly mature, and it has been widely used in various industries. By combining business in this field with AI technology, costs can be reduced and efficiency increased.
为了满足广阔的市场需求,通过AI服务平台,进行客户定制化AI模型的部署与上线,大量模型占用的资源也越来越庞大。模型服务启动时,由于需要重新加载模型,导致启动时间较长。In order to meet the broad market demand, customer-customized AI models are deployed and launched through the AI service platform, and the resources occupied by a large number of models are becoming increasingly large. When the model service starts, it takes a long time to start because the model needs to be reloaded.
当前技术中,为了解决AI模型加载的耗时问题,可以通过对模型进行剪枝、量化等操作,减小模型体量,以加快AI模型加载速度。但是,对模型进行剪枝、量化会降低模型服务精度,且对模型剪枝、量化也会带来成本的增加。或者,在AI模型启动时采用懒加载的方式以提高模型的启动速度,例如,不采取层间融合策略或者不使用指令集优化等。但此种方式下,AI模型加载速度只能得到有限的提高,且影响使用模型进行推理的速度,造成流量丢失。In current technology, in order to solve the time-consuming problem of AI model loading, the model can be pruned, quantified, and other operations can be performed to reduce the model size to speed up the loading of the AI model. However, pruning and quantifying the model will reduce the model service accuracy, and pruning and quantifying the model will also increase costs. Or, use lazy loading when starting the AI model to improve the startup speed of the model. For example, do not adopt an inter-layer fusion strategy or do not use instruction set optimization, etc. However, in this way, the AI model loading speed can only be limitedly improved, and it affects the speed of using the model for inference, causing traffic loss.
鉴于此,本公开实施例提供了一种启动模型服务的方法,在AI服务启动时,获取并加载AI服务模型对应的镜像文件,通过加载镜像文件,实现AI模型的快速加载以实现服务的启动,从而提升用户体验。In view of this, embodiments of the present disclosure provide a method for starting the model service. When the AI service is started, the image file corresponding to the AI service model is obtained and loaded. By loading the image file, the AI model is quickly loaded to realize the startup of the service. , thereby improving user experience.
图1是根据本公开的启动模型服务的方法的流程示意图。如图1所示,本公开的方法包括以下步骤。Figure 1 is a schematic flowchart of a method of starting a model service according to the present disclosure. As shown in Figure 1, the method of the present disclosure includes the following steps.
在步骤S101中,响应于服务模型被触发启动,获取服务模型所对应的镜像文件,其中,镜像文件中包括服务模型的元信息,以及服务模型所运行服务进程的上下文信息。In step S101, in response to the service model being triggered to start, an image file corresponding to the service model is obtained, where the image file includes meta-information of the service model and context information of the service process run by the service model.
在本公开实施例中,以服务模型为AI服务模型为例进行描述,在启动AI服务模型时,获取AI服务模型对应的镜像文件,以实现AI服务模型的正常应用。镜像文件中包括AI服务模型的元信息,元信息用于记录 AI服务模型的功能、实现模型推理服务等自身依赖的条件,可以是包括:服务进程标识、服务统一资源定位符(Universal Resource Locator,URL)以及其他服务日志等。AI服务模型对应的镜像文件还包括服务模型所运行服务进程的上下文信息,例如,加载模型到内存的过程、AI服务模型进程的状态等。In the embodiment of the present disclosure, the service model is an AI service model as an example for description. When the AI service model is started, the image file corresponding to the AI service model is obtained to realize the normal application of the AI service model. The image file includes meta-information of the AI service model. The meta-information is used to record the functions of the AI service model and the conditions for implementing model inference services and other self-dependencies. It can include: service process identifier, service Universal Resource Locator (Universal Resource Locator, URL) and other service logs, etc. The image file corresponding to the AI service model also includes context information of the service process run by the service model, such as the process of loading the model into memory, the status of the AI service model process, etc.
在步骤S102中,加载镜像文件,以启动服务模型进行服务。In step S102, the image file is loaded to start the service model for service.
在本公开实施例中,在启动AI服务模型时,不进行模型的加载,而是获取AI服务模型对应的镜像文件,并通过该获取到的镜像文件,启动AI服务模型提供服务。In the embodiment of the present disclosure, when starting the AI service model, the model is not loaded, but the image file corresponding to the AI service model is obtained, and the AI service model is started to provide services through the obtained image file.
根据本公开实施例,在AI服务模型启动并提供服务时,获取AI服务模型对应的镜像文件,通过加载镜像文件实现AI服务模型的启动,减少模型启动时间,提高模型服务启动速度,从而提升用户体验。According to the embodiments of the present disclosure, when the AI service model is started and services are provided, the image file corresponding to the AI service model is obtained, and the AI service model is started by loading the image file, thereby reducing the model startup time and improving the model service startup speed, thereby improving user experience. experience.
图2是根据本公开的创建镜像文件的方法的流程示意图。如图2所示,本公开的方法包括以下步骤。Figure 2 is a schematic flowchart of a method of creating an image file according to the present disclosure. As shown in Figure 2, the method of the present disclosure includes the following steps.
在步骤S201中,控制服务模型运行服务进程。In step S201, the service model is controlled to run the service process.
在本公开实施例中,可以是预先创建AI服务模型所对应的镜像文件,可以是在AI服务模型服务首次启动时进行镜像文件的创建,也可以将创建镜像文件作为AI服务模型提供服务的前置过程,以在使用AI服务时进行镜像文件的获取。控制AI服务模型运行服务进程,包括安装AI服务模型运行所需的环境,例如,配置底层硬件驱动、安装运行AI服务模型时所需的依赖库等。运行环境安装后,启动AI服务模型以提供相应的服务,可以理解地,AI服务模型可以提供基于各种协议的服务,例如,超文本传输协议(Hyper Text Transfer Protocol,HTTP)服务、远程过程调用(Remote Procedure Call,RPC)服务、传输控制协议(Transmission Control Protocol,TCP)服务等,本公开实施例对此不作限定。In the embodiment of the present disclosure, the image file corresponding to the AI service model may be created in advance, the image file may be created when the AI service model service is first started, or the image file may be created before the AI service model provides services. Setup process to obtain the image file when using the AI service. Controlling the running service process of the AI service model includes installing the environment required to run the AI service model, for example, configuring the underlying hardware driver, installing the dependent libraries required to run the AI service model, etc. After the running environment is installed, the AI service model is started to provide corresponding services. Understandably, the AI service model can provide services based on various protocols, such as Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP) services and remote procedure calls. (Remote Procedure Call, RPC) service, Transmission Control Protocol (Transmission Control Protocol, TCP) service, etc. This embodiment of the present disclosure does not limit this.
在步骤S202,获取服务模型所运行服务进程的上下文信息以及服务模型的元信息。In step S202, the context information of the service process run by the service model and the meta-information of the service model are obtained.
在本公开实施例中,AI服务模型提供服务时,可以通过检查点 (Checkpoint)操作获取服务模型所运行服务进程的上下文信息以及服务模型的元信息。通过系统调用(ptrace)机制,将一段特殊代码注入到服务模型所运行服务进程并运行,以收集服务进程的上下文信息。可以理解地,ptrace机制中,父进程得以监视和控制其它进程,可改变子进程中的寄存器和内核映像,实现断点调试和系统调用的跟踪。在执行系统调用之前,如果当前进程处于被“跟踪”的状态,将控制权交给跟踪进程,使跟踪进程得以察看或者修改被跟踪进程的寄存器。进行Checkpoint操作时,对应该Checkpoint检查点将AI服务模型所运行服务进程的上下文信息以及服务模型的元信息,进行转储。In the embodiment of the present disclosure, when the AI service model provides services, the context information of the service process run by the service model and the meta-information of the service model can be obtained through checkpoint operations. Through the system call (ptrace) mechanism, a special code is injected into the service process run by the service model and run to collect the context information of the service process. Understandably, in the ptrace mechanism, the parent process can monitor and control other processes, change the registers and kernel images in the child process, and implement breakpoint debugging and system call tracing. Before executing the system call, if the current process is in a "tracked" state, control is given to the tracking process so that the tracking process can view or modify the registers of the tracked process. When performing a Checkpoint operation, the context information of the service process run by the AI service model and the metainformation of the service model are dumped corresponding to the Checkpoint checkpoint.
在步骤S203中,创建包括元信息以及上下文信息的镜像文件。In step S203, an image file including meta information and context information is created.
将AI服务模型运行服务时,获取到的AI服务模型所运行服务进程的上下文信息以及AI服务模型的元信息,进行转储操作,创建包括AI服务模型的元信息以及上下文信息的镜像文件。对包括元信息以及上下文信息的镜像文件的进行存储时,可以通过提供统一的应用程序接口,屏蔽后端具体的存储细节。可以通过后端支持本地存储、分布式存储、对象存储等多种方式,实现镜像文件的存储。When the AI service model runs the service, the context information of the service process run by the AI service model and the meta-information of the AI service model obtained are dumped to create an image file including the meta-information and context information of the AI service model. When storing image files including meta information and context information, you can shield the specific storage details of the backend by providing a unified application interface. The backend can support local storage, distributed storage, object storage and other methods to realize the storage of image files.
根据本公开的实施例,AI服务模型运行服务进程提供服务,将包括运行服务进程的上下文信息以及服务模型的元信息创建镜像文件,以在AI服务模型再次被触发启动,通过加载镜像文件启动AI服务模型,提高模型服务启动速度,减少模型服务启动时间。According to the embodiment of the present disclosure, the AI service model runs the service process to provide services, and creates an image file including the context information of the running service process and the meta-information of the service model, so that when the AI service model is triggered again, the AI is started by loading the image file. Service model, improve the model service startup speed and reduce the model service startup time.
图3是根据本公开的控制服务模型运行服务进程方法的流程示意图。如图3所示,本公开的方法包括以下步骤。Figure 3 is a schematic flowchart of a method for running a service process according to the control service model of the present disclosure. As shown in Figure 3, the method of the present disclosure includes the following steps.
在步骤S301中,调用运行的服务模型。In step S301, the running service model is called.
在步骤S302中,触发服务模型中包括的工作实例加载服务模型,以唤醒服务模型运行服务进程。In step S302, the working instance included in the service model is triggered to load the service model to wake up the service model and run the service process.
在本公开实施例中,启动AI服务模型,AI服务模型运行服务进程以提供相应的服务。可以通过脚本,调用运行的AI服务模型,并触发AI服务模型中包括的工作实例加载服务模型。AI服务模型中可以包括多个工作实例,多个工作实例并行利用服务模型进行推理,以提供服务。In the embodiment of the present disclosure, the AI service model is started, and the AI service model runs a service process to provide corresponding services. You can call the running AI service model through a script and trigger the work instance included in the AI service model to load the service model. The AI service model can include multiple work instances, and multiple work instances use the service model in parallel to perform reasoning to provide services.
根据本公开的实施例,调用运行的AI服务模型,触发AI服务模型中的工作实例加载AI服务模型,以唤醒服务模型运行服务进程,并获取服务模型所运行服务进程的上下文信息以及服务模型的元信息,使服务模型所对应的镜像文件包括AI服务模型的信息,为通过加载镜像文件启动AI服务模型提供保障。According to embodiments of the present disclosure, the running AI service model is called, the working instance in the AI service model is triggered to load the AI service model, to wake up the service model to run the service process, and obtain the context information of the service process run by the service model and the service model's Meta information makes the image file corresponding to the service model include the information of the AI service model, providing guarantee for starting the AI service model by loading the image file.
图4是根据本公开的获取服务模型所运行服务进程的上下文信息以及服务模型的元信息方法的流程示意图。如图4所示,本公开的方法包括以下步骤。Figure 4 is a schematic flowchart of a method for obtaining context information of a service process running a service model and meta-information of the service model according to the present disclosure. As shown in Figure 4, the method of the present disclosure includes the following steps.
在步骤S401中,响应于确定服务模型被唤醒成功,监测服务模型所运行服务进程的上下文信息。In step S401, in response to determining that the service model is successfully awakened, context information of the service process run by the service model is monitored.
在步骤S402中,存储上下文信息,并记录服务模型的元信息。In step S402, context information is stored and meta-information of the service model is recorded.
在本公开实施例中,AI服务模型启动并运行服务进程,以提供相应的服务。通过脚本调用运行的AI服务模型,以实现对AI服务模型进行唤醒。AI服务模型中包括多个工作实例,多个工作实例响应接收到的调用AI服务的请求,进行AI服务模型加载,并基于加载的AI服务模型进行推理工作。通过轮询AI服务模型中包括的多个工作实例,以确定AI服务模型被唤醒成功。当确定AI服务模型被成功唤醒时,通过对AI服务模型进行Checkpoint操作,将模型所运行服务进程的上下文信息进行存储,并记录AI服务模型的元信息。In the embodiment of the present disclosure, the AI service model starts and runs the service process to provide corresponding services. Call the running AI service model through a script to wake up the AI service model. The AI service model includes multiple working instances. The multiple working instances respond to the received request to call the AI service, load the AI service model, and perform inference work based on the loaded AI service model. By polling multiple work instances included in the AI service model, it is determined that the AI service model has been awakened successfully. When it is determined that the AI service model has been successfully awakened, a Checkpoint operation is performed on the AI service model to store the context information of the service process run by the model and record the meta-information of the AI service model.
根据本公开实施例,调用运行的AI服务模型,并唤醒AI服务模型运行服务进程,确定AI服务模型被唤醒成功时,存储AI服务模型所运行服务进程的上下文信息,并记录AI服务模型的元信息,以创建AI服务模型所对应的镜像文件,为通过加载镜像文件启动AI服务模型提供保障。According to the embodiment of the present disclosure, the running AI service model is called, and the AI service model running service process is awakened. When it is determined that the AI service model is successfully awakened, the context information of the service process run by the AI service model is stored, and the elements of the AI service model are recorded. Information to create the image file corresponding to the AI service model, providing guarantee for starting the AI service model by loading the image file.
图5是根据本公开的获取所述服务模型所运行服务进程的上下文信息以及所述服务模型的元信息方法的流程示意图。如图5所示,本公开的方法包括以下步骤。Figure 5 is a schematic flowchart of a method for obtaining context information of a service process run by the service model and meta-information of the service model according to the present disclosure. As shown in Figure 5, the method of the present disclosure includes the following steps.
在步骤S501中,若确定大于数量阈值的工作实例完成服务模型的加载,且基于服务模型成功完成推理,则确定服务模型被唤醒成功。In step S501, if it is determined that the working instances larger than the number threshold have completed loading of the service model, and inference based on the service model has been successfully completed, it is determined that the service model has been awakened successfully.
在步骤S502中,监测服务模型所运行服务进程的上下文信息。In step S502, the context information of the service process run by the service model is monitored.
在步骤S503中,存储上下文信息,并记录服务模型的元信息。In step S503, context information is stored and meta-information of the service model is recorded.
在本公开实施例中,创建包括AI服务模型的元信息,以及AI服务模型所运行服务进程的上下文信息的镜像文件,以在启动AI服务模型时,能够基于镜像文件代替加载AI服务模型,实现通过AI服务模型提供服务。在创建镜像文件时,通过脚本调用运行的AI服务模型,触发AI服务模型中包括的多个工作实例加载服务模型。通过轮询,确定对AI服务模型唤醒成功时,存储服务模型所运行服务进程的上下文信息,并记录服务模型的元信息,从而创建元信息以及上下文信息的镜像文件。其中,AI服务模型中包括的多个工作实例,响应于接收到的调用AI服务的请求,进行AI服务模型加载,并基于加载的AI服务模型进行推理工作。确定大于数量阈值的工作实例完成服务模型的加载,且基于服务模型成功完成推理,即确定服务模型被唤醒成功。In this embodiment of the present disclosure, an image file is created that includes the meta-information of the AI service model and the context information of the service process run by the AI service model, so that when the AI service model is started, the AI service model can be loaded based on the image file instead. Provide services through AI service models. When creating an image file, the running AI service model is called through a script, triggering multiple working instances included in the AI service model to load the service model. Through polling, when it is determined that the AI service model is successfully awakened, the context information of the service process run by the service model is stored, and the meta-information of the service model is recorded, thereby creating a mirror file of meta-information and context information. Among them, multiple working instances included in the AI service model load the AI service model in response to the received request to call the AI service, and perform inference work based on the loaded AI service model. If it is determined that the working instances larger than the number threshold have completed the loading of the service model, and the inference based on the service model has been successfully completed, it is determined that the service model has been awakened successfully.
根据本公开实施例,调用运行的AI服务模型,并唤醒AI服务模型运行服务进程,确定大于数量阈值的工作实例完成AI服务模型的加载,且基于AI服务模型成功完成推理时,存储AI服务模型所运行服务进程的上下文信息,并记录AI服务模型的元信息,以充分记录AI服务模型全部工作实例的服务进程信息,创建AI服务模型所对应的镜像文件,为通过加载镜像文件启动AI服务模型提供保障。According to the embodiment of the present disclosure, the running AI service model is called, the AI service model is awakened to run the service process, and the working instances greater than the number threshold are determined to complete the loading of the AI service model, and when inference is successfully completed based on the AI service model, the AI service model is stored. Context information of the running service process, and record the meta-information of the AI service model to fully record the service process information of all working instances of the AI service model, create the image file corresponding to the AI service model, and start the AI service model by loading the image file provide assurance.
图6是根据本公开的加载所述镜像文件,以启动所述服务模型方法的流程示意图。如图6所示,本公开的方法包括以下步骤。Figure 6 is a schematic flowchart of a method of loading the image file to start the service model according to the present disclosure. As shown in Figure 6, the method of the present disclosure includes the following steps.
在步骤S601中,解析镜像文件,得到服务进程的上下文信息以及服务模型的元信息。In step S601, the image file is parsed to obtain the context information of the service process and the meta-information of the service model.
在本公开实施例中,AI服务模型启动,运行以提供服务,通过获取并加载包括AI服务模型的元信息,以及AI服务模型所运行服务进程的上下文信息的镜像文件,代替对AI服务模型的加载,以恢复AI服务模型的服务。将镜像文件复制到本地,加载至内存,并解析镜像文件,得到AI服务进程的上下文信息以及AI服务模型的元信息。In the embodiment of the present disclosure, the AI service model is started and run to provide services. By obtaining and loading the image file including the meta information of the AI service model and the context information of the service process run by the AI service model, instead of modifying the AI service model, Load to restore the service of the AI service model. Copy the image file locally, load it into memory, and parse the image file to obtain the context information of the AI service process and the metainformation of the AI service model.
在步骤S602中,基于服务模型的元信息以及服务进程的上下文信息,确定服务模型所运行服务进程的目标运行状态。In step S602, based on the meta-information of the service model and the context information of the service process, the target running state of the service process run by the service model is determined.
在步骤S603中,控制服务模型所运行的服务进程,在目标运行状态下提供服务。In step S603, the service process run by the service model is controlled to provide services in the target operating state.
在本公开实施例中,通过解析得到的AI服务模型的元信息,以及服务进程的上下文信息,确定AI服务模型的目标运行状态,即将AI服务模型的运行状态恢复至镜像文件中包括的AI服务模型运行服务进程的运行状态。AI服务模型基于目标运行状态,继续提供服务。In this embodiment of the present disclosure, the target operating state of the AI service model is determined by parsing the obtained meta-information of the AI service model and the context information of the service process, that is, restoring the operating state of the AI service model to the AI service included in the image file. The running status of the model running service process. The AI service model continues to provide services based on the target operating status.
根据本公开实施例,在需要启动AI服务模型时,无需加载模型,通过读取、解析预先创建的镜像文件,恢复AI服务模型,并基于服务模型的元信息以及服务进程的上下文信息,恢复服务模型所运行服务进程的运行状态,确保模型能够有效地提供服务,减少模型启动时间,提高模型服务启动速度。According to the embodiments of the present disclosure, when the AI service model needs to be started, there is no need to load the model. The AI service model is restored by reading and parsing the pre-created image file, and the service is restored based on the meta-information of the service model and the context information of the service process. The running status of the service process run by the model ensures that the model can effectively provide services, reduce model startup time, and improve model service startup speed.
图7是根据本公开的实现启动模型服务的方法的系统结构示意图。如图7所示,本公开实施例的启动模型服务的方法,可以基于用户空间中的检查点和恢复(Checkpoint and Restore in User space,CRIU)实现,CRIU可以在用户空间实现检查点以及恢复功能,即检查点进程文件,应用备份得到的进程文件,恢复进程。该系统可以包括启动(launch)模块、准备(warm up)模块、转储(dump)模块、恢复(restore)模块、存储模块等。其中,launch模块负责安装AI服务运行所需的环境依赖,包括底层硬件驱动、运行时所需的依赖库等,并正常启动AI服务,基于HTTP服务、RPC服务、TCP服务等对外提供服务。Launch模块通过多个算法,对应启动多个AI服务。当launch模块正常运行时,warmup模块通过脚本调用AI服务模型运行的AI服务,触发AI服务内部的多个工作实例接收到调用运行服务进程的请求,以唤醒AI服务。Dump模块轮训warmup模块是否完成AI服务模型的唤醒,即AI服务模型内部的多个实例均完成服务模型的加载,并基于服务模型完成推理工作。确定AI服务模型被充分唤醒后,进行AI服务的Checkpoint操作,即将AI服务模型运行的AI服务进程树中的服务进程上下文信息存储在存储模块中,并记录AI服务模型的元信息,元信息可以包括服务进程编码、服务URL、服务日志等,创建镜像文件。存储模块将dump模块Checkpoint操作生成的镜像文件 进行存储,通过提供统一的应用程序接口,屏蔽后端具体的存储细节,后端可以以本地存储、分布式存储、对象存储等多种方式实现。恢复模块从存储模块将AI服务模型对应的镜像文件复制到本地,加载至内存,并进行解析,恢复AI服务模型所运行服务进程的运行状态,继续对外提供服务。恢复模块,也可以通过上述方式实现AI服务模型对应的镜像文件的多次加载。Figure 7 is a schematic structural diagram of a system for implementing a method of starting a model service according to the present disclosure. As shown in Figure 7, the method of starting model services in the embodiment of the present disclosure can be implemented based on Checkpoint and Restore in User space (CRIU) in user space. CRIU can implement checkpoint and recovery functions in user space. , that is, checkpoint process files, apply the process files obtained from backup, and restore the process. The system can include a launch module, a warm up module, a dump module, a restore module, a storage module, etc. Among them, the launch module is responsible for installing the environmental dependencies required for the operation of AI services, including underlying hardware drivers, dependency libraries required for runtime, etc., and starting the AI services normally, and providing external services based on HTTP services, RPC services, TCP services, etc. The Launch module uses multiple algorithms to launch multiple AI services. When the launch module is running normally, the warmup module calls the AI service run by the AI service model through a script, triggering multiple working instances inside the AI service to receive requests to call the running service process to wake up the AI service. The Dump module rotates and trains whether the warmup module has completed the awakening of the AI service model, that is, multiple instances within the AI service model have completed loading the service model, and completed inference work based on the service model. After confirming that the AI service model is fully awakened, perform the Checkpoint operation of the AI service, that is, store the service process context information in the AI service process tree running the AI service model in the storage module, and record the meta-information of the AI service model. The meta-information can Including service process coding, service URL, service log, etc., create an image file. The storage module stores the image files generated by the checkpoint operation of the dump module, and provides a unified application interface to shield the specific storage details of the backend. The backend can be implemented in various ways such as local storage, distributed storage, and object storage. The recovery module copies the image file corresponding to the AI service model from the storage module to the local, loads it into the memory, analyzes it, restores the running status of the service process run by the AI service model, and continues to provide external services. The recovery module can also implement multiple loading of image files corresponding to the AI service model through the above method.
根据本公开实施例的启动模型服务方法,在AI服务模型启动时,通过读取AI服务模型对应的镜像文件来代替模型的加载,减少模型启动时间,提高模型服务启动速度,从而提升用户体验。According to the method of starting a model service according to the embodiment of the present disclosure, when the AI service model is started, the image file corresponding to the AI service model is read instead of loading the model, thereby reducing the model startup time and improving the model service startup speed, thereby improving the user experience.
基于相同的构思,本公开实施例还提供一种启动模型服务的装置。Based on the same concept, embodiments of the present disclosure also provide a device for starting a model service.
可以理解的是,本公开实施例提供的装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。结合本公开实施例中所公开的各示例的单元及算法步骤,本公开实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同的方法来实现所描述的功能,但是这种实现不应认为超出本公开实施例的技术方案的范围。It can be understood that, in order to implement the above functions, the device provided by the embodiments of the present disclosure includes hardware structures and/or software modules corresponding to each function. Combined with the units and algorithm steps of each example disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to go beyond the scope of the technical solutions of the embodiments of the present disclosure.
图8是根据本公开的启动模型服务的装置的框图。FIG. 8 is a block diagram of a device for launching a model service according to the present disclosure.
如图8所示,本公开实施例的启动模型服务的装置700,包括:获取模块701和启动模块702。As shown in Figure 8, the device 700 for starting a model service in the embodiment of the present disclosure includes: an acquisition module 701 and a startup module 702.
获取模块701,用于当服务模型被触发启动时,获取服务模型所对应的镜像文件,其中,镜像文件中包括服务模型的元信息,以及服务模型所运行服务进程的上下文信息;The acquisition module 701 is used to obtain the image file corresponding to the service model when the service model is triggered to start, where the image file includes meta-information of the service model and context information of the service process run by the service model;
启动模块702,用于加载镜像文件,以启动服务模型进行服务。The startup module 702 is used to load the image file to start the service model for service.
图9是根据本公开的启动模型服务的装置的框图。Figure 9 is a block diagram of a device for launching a model service according to the present disclosure.
如图9所示,本公开实施例的启动模型服务的装置700,还包括:创建模块703。As shown in Figure 9, the device 700 for starting a model service in the embodiment of the present disclosure also includes: a creation module 703.
创建模块703,用于控制服务模型运行服务进程,获取服务模型所运行服务进程的上下文信息以及服务模型的元信息,创建包括元信息以及上 下文信息的镜像文件。The creation module 703 is used to control the service model to run the service process, obtain the context information of the service process run by the service model and the meta-information of the service model, and create an image file including meta-information and context information.
在本公开示例性的实施方式中,创建模块703还用于:调用运行的服务模型;触发服务模型中包括的工作实例加载服务模型,以唤醒服务模型运行服务进程。In the exemplary embodiment of the present disclosure, the creation module 703 is also used to: call the running service model; trigger the work instance included in the service model to load the service model to wake up the service model to run the service process.
在本公开示例性的实施方式中,获取模块701还用于:响应于确定服务模型被唤醒成功,监测服务模型所运行服务进程的上下文信息;存储上下文信息,并记录服务模型的元信息。In an exemplary embodiment of the present disclosure, the acquisition module 701 is further configured to: in response to determining that the service model is successfully awakened, monitor the context information of the service process run by the service model; store the context information, and record the meta-information of the service model.
在本公开示例性的实施方式中,获取模块701还用于:若确定大于数量阈值的工作实例完成服务模型的加载,且基于服务模型成功完成推理,则确定服务模型被唤醒成功。In an exemplary embodiment of the present disclosure, the acquisition module 701 is also configured to determine that the service model is successfully awakened if it is determined that the working instances greater than the number threshold complete loading of the service model and inference is successfully completed based on the service model.
在本公开示例性的实施方式中,启动模块702还用于:解析镜像文件,得到服务进程的上下文信息以及服务模型的元信息;基于服务模型的元信息以及服务进程的上下文信息,确定服务模型所运行服务进程的目标运行状态;控制服务模型所运行的服务进程,在目标运行状态下提供服务。In the exemplary embodiment of the present disclosure, the startup module 702 is also used to: parse the image file to obtain the context information of the service process and the meta-information of the service model; determine the service model based on the meta-information of the service model and the context information of the service process. The target running state of the running service process; control the service process run by the service model to provide services in the target running state.
综上,根据本公开实施例的启动模型服务的装置,在AI服务模型启动并提供服务时,获取AI服务模型对应的镜像文件,通过加载镜像文件实现AI服务模型的启动,减少模型启动时间,提高模型服务启动速度,从而提升用户体验。In summary, according to the device for starting model services according to the embodiment of the present disclosure, when the AI service model starts and provides services, the image file corresponding to the AI service model is obtained, and the AI service model is started by loading the image file, thereby reducing the model startup time. Improve the startup speed of model services to improve user experience.
本公开的技术方案中,所涉及的用户个人信息的获取,存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of this disclosure, the acquisition, storage and application of user personal information involved are in compliance with relevant laws and regulations and do not violate public order and good customs.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
图10示出了可以用来实施本公开的实施例的示例电子设备800的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。Figure 10 shows a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图10所示,设备800包括计算单元801,其可以根据存储在只读存储器(ROM)802中的计算机程序或者从存储单元808加载到随机访问存储器(RAM)803中的计算机程序,来执行各种适当的动作和处理。在RAM 803中,还可存储设备800操作所需的各种程序和数据。计算单元801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 10 , the device 800 includes a computing unit 801 that can execute according to a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803 Various appropriate actions and treatments. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. Computing unit 801, ROM 802 and RAM 803 are connected to each other via bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
设备800中的多个部件连接至I/O接口805,包括:输入单元806,例如键盘、鼠标等;输出单元807,例如各种类型的显示器、扬声器等;存储单元808,例如磁盘、光盘等;以及通信单元809,例如网卡、调制解调器、无线通信收发机等。通信单元809允许设备800通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc. ; and communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
计算单元801可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元801的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元801执行上文所描述的各个方法和处理,例如启动模型服务的方法。例如,在一些实施例中,启动模型服务的方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元808。在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元809而被载入和/或安装到设备800上。当计算机程序加载到RAM 803并由计算单元801执行时,可以执行上文描述的启动模型服务的方法的一个或多个步骤。备选地,在其他实施例中,计算单元801可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行启动模型服务的方法。 Computing unit 801 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processing processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs various methods and processes described above, such as a method of starting a model service. For example, in some embodiments, the method of launching the model service may be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 800 via ROM 802 and/or communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the method of starting the model service described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method of starting the model service in any other suitable manner (eg, by means of firmware).
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者 多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip implemented in a system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or a combination thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of this disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式系统的服务器,或者是结合了区块链的服务器。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other. The server can be a cloud server, a distributed system server, or a server combined with a blockchain.
根据本公开实施例提供的技术方案,本公开能够在AI服务模型启动并提供服务时,获取AI服务模型对应的镜像文件,通过加载镜像文件实现AI服务模型的启动,减少模型启动时间,提高模型服务启动速度,从而提升用户体验。According to the technical solutions provided by the embodiments of the present disclosure, the present disclosure can obtain the image file corresponding to the AI service model when the AI service model is started and provides services, and realize the startup of the AI service model by loading the image file, thereby reducing the model startup time and improving the model Service startup speed, thereby improving user experience.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the present disclosure can be executed in parallel, sequentially, or in a different order. As long as the desired results of the technical solution disclosed in the present disclosure can be achieved, there is no limitation here.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the scope of the present disclosure. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this disclosure shall be included in the protection scope of this disclosure.

Claims (15)

  1. 一种启动模型服务的方法,包括:A method to start model services, including:
    响应于服务模型被触发启动,获取所述服务模型所对应的镜像文件,其中,所述镜像文件中包括所述服务模型的元信息,以及所述服务模型所运行服务进程的上下文信息;In response to the service model being triggered to start, obtain the image file corresponding to the service model, wherein the image file includes meta-information of the service model and context information of the service process run by the service model;
    加载所述镜像文件,以启动所述服务模型进行服务。Load the image file to start the service model for service.
  2. 根据权利要求1所述的方法,其中,所述镜像文件采用如下方式创建:The method according to claim 1, wherein the image file is created in the following manner:
    控制所述服务模型运行服务进程;Control the service model to run the service process;
    获取所述服务模型所运行服务进程的上下文信息以及所述服务模型的元信息;Obtain the context information of the service process run by the service model and the meta-information of the service model;
    创建包括所述元信息以及所述上下文信息的镜像文件。Create an image file including the meta information and the context information.
  3. 根据权利要求2所述的方法,所述控制所述服务模型运行服务进程,包括:The method according to claim 2, controlling the service model to run a service process includes:
    调用运行的所述服务模型;Call the running service model;
    触发所述服务模型中包括的工作实例加载所述服务模型,以唤醒所述服务模型运行服务进程。Triggering the work instance included in the service model to load the service model to wake up the service model to run a service process.
  4. 根据权利要求2或3所述的方法,其中,所述获取所述服务模型所运行服务进程的上下文信息以及所述服务模型的元信息,包括:The method according to claim 2 or 3, wherein said obtaining the context information of the service process run by the service model and the meta-information of the service model includes:
    响应于确定所述服务模型被唤醒成功,监测所述服务模型所运行服务进程的上下文信息;In response to determining that the service model is successfully awakened, monitor the context information of the service process run by the service model;
    存储所述上下文信息,并记录所述服务模型的元信息。The context information is stored, and meta-information of the service model is recorded.
  5. 根据权利要求4所述的方法,其中,所述确定所述服务模型被唤醒成功,包括:The method according to claim 4, wherein determining that the service model is successfully awakened includes:
    若确定大于数量阈值的工作实例完成所述服务模型的加载,且基于所述服务模型成功完成推理,则确定服务模型被唤醒成功。If it is determined that the working instances greater than the number threshold have completed loading of the service model, and inference is successfully completed based on the service model, it is determined that the service model has been awakened successfully.
  6. 根据权利要求5所述的方法,其中,所述加载所述镜像文件,以启动所述服务模型,包括:The method according to claim 5, wherein loading the image file to start the service model includes:
    解析所述镜像文件,得到服务进程的上下文信息以及所述服务模型的元信息;Parse the image file to obtain the context information of the service process and the meta-information of the service model;
    基于所述服务模型的元信息以及所述服务进程的上下文信息,确定所述服务模型所运行服务进程的目标运行状态;Based on the meta-information of the service model and the context information of the service process, determine the target running state of the service process run by the service model;
    控制所述服务模型所运行的服务进程,在所述目标运行状态下提供服务。Control the service process run by the service model and provide services in the target operating state.
  7. 一种启动模型服务的装置,包括:A device for starting model services, including:
    获取模块,用于当服务模型被触发启动时,获取所述服务模型所对应的镜像文件,其中,所述镜像文件中包括所述服务模型的元信息,以及所述服务模型所运行服务进程的上下文信息;An acquisition module, configured to acquire an image file corresponding to the service model when the service model is triggered to start, wherein the image file includes the meta-information of the service model and the service process of the service model. contextual information;
    启动模块,用于加载所述镜像文件,以启动所述服务模型进行服务。A startup module is used to load the image file to start the service model for service.
  8. 根据权利要求7所述的装置,其中,所述装置还包括:The device of claim 7, further comprising:
    创建模块,用于控制所述服务模型运行服务进程,获取所述服务模型所运行服务进程的上下文信息以及所述服务模型的元信息,创建包括所述元信息以及所述上下文信息的镜像文件。A creation module, configured to control the service process running by the service model, obtain the context information of the service process run by the service model and the meta-information of the service model, and create an image file including the meta-information and the context information.
  9. 根据权利要求8所述的装置,所述创建模块还用于:The device according to claim 8, the creation module is further used for:
    调用运行的所述服务模型;Call the running service model;
    触发所述服务模型中包括的工作实例加载所述服务模型,以唤醒所述服务模型运行服务进程。Triggering the work instance included in the service model to load the service model to wake up the service model to run a service process.
  10. 根据权利要求8或9所述的装置,其中,所述获取模块还用于:The device according to claim 8 or 9, wherein the acquisition module is also used for:
    响应于确定所述服务模型被唤醒成功,监测所述服务模型所运行服务进程的上下文信息;In response to determining that the service model is successfully awakened, monitor the context information of the service process run by the service model;
    存储所述上下文信息,并记录所述服务模型的元信息。The context information is stored, and meta-information of the service model is recorded.
  11. 根据权利要求10所述的装置,其中,所述获取模块还用于:The device according to claim 10, wherein the acquisition module is also used for:
    若确定大于数量阈值的工作实例完成所述服务模型的加载,且基于所述服务模型成功完成推理,则确定服务模型被唤醒成功。If it is determined that the working instances greater than the number threshold have completed loading of the service model, and inference is successfully completed based on the service model, it is determined that the service model has been awakened successfully.
  12. 根据权利要求11所述的装置,其中,所述启动模块还用于:The device according to claim 11, wherein the startup module is also used for:
    解析所述镜像文件,得到服务进程的上下文信息以及所述服务 模型的元信息;Parse the image file to obtain the context information of the service process and the meta-information of the service model;
    基于所述服务模型的元信息以及所述服务进程的上下文信息,确定所述服务模型所运行服务进程的目标运行状态;Based on the meta-information of the service model and the context information of the service process, determine the target running state of the service process run by the service model;
    控制所述服务模型所运行的服务进程,在所述目标运行状态下提供服务。Control the service process run by the service model and provide services in the target operating state.
  13. 一种电子设备,包括:An electronic device including:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6中任一项所述的启动模型服务的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform any one of claims 1-6. Method to start model service.
  14. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行根据权利要求1-6中任一项所述的启动模型服务的方法。A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method of starting a model service according to any one of claims 1-6.
  15. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-6中任一项所述的启动模型服务的方法。A computer program product, comprising a computer program that, when executed by a processor, implements the method for starting a model service according to any one of claims 1-6.
PCT/CN2022/105180 2022-03-10 2022-07-12 Method and apparatus for starting model service, and device, medium and product WO2023168875A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210238004.8A CN114706622B (en) 2022-03-10 2022-03-10 Method, device, equipment, medium and product for starting model service
CN202210238004.8 2022-03-10

Publications (1)

Publication Number Publication Date
WO2023168875A1 true WO2023168875A1 (en) 2023-09-14

Family

ID=82169401

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/105180 WO2023168875A1 (en) 2022-03-10 2022-07-12 Method and apparatus for starting model service, and device, medium and product

Country Status (2)

Country Link
CN (1) CN114706622B (en)
WO (1) WO2023168875A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114706622B (en) * 2022-03-10 2023-08-18 北京百度网讯科技有限公司 Method, device, equipment, medium and product for starting model service

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104102506A (en) * 2014-04-25 2014-10-15 华南理工大学 ARM (Advanced RISC Machine) platform based Android startup acceleration method
CN104216776A (en) * 2014-08-25 2014-12-17 成都三零凯天通信实业有限公司 Quick starting method for Android operating system based on BLCR (Berkeley lab checkpoint restart) technology
CN109189480A (en) * 2018-07-02 2019-01-11 新华三技术有限公司成都分公司 File system starts method and device
CN110716758A (en) * 2018-06-26 2020-01-21 阿里巴巴集团控股有限公司 Program running method, device, equipment and storage medium
CN111930429A (en) * 2020-07-07 2020-11-13 上海商米科技集团股份有限公司 Method for quickly starting Android operating system and electronic equipment
CN112416467A (en) * 2020-12-10 2021-02-26 上海维宏电子科技股份有限公司 Control system, method, device, processor and computer readable storage medium for realizing rapid starting and initialization of numerical control system
CN113885967A (en) * 2021-10-22 2022-01-04 北京字跳网络技术有限公司 Method, device, equipment and medium for starting small program
CN114064190A (en) * 2020-07-30 2022-02-18 华为技术有限公司 Container starting method and device
CN114706622A (en) * 2022-03-10 2022-07-05 北京百度网讯科技有限公司 Method, apparatus, device, medium and product for starting model service

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423604B2 (en) * 2008-08-29 2013-04-16 R. Brent Johnson Secure virtual tape management system with balanced storage and multi-mirror options
GB2525409B (en) * 2014-04-24 2016-11-02 Ibm Enabling an external operating system to access encrypted data units of a data storage system
CN105446750B (en) * 2014-05-30 2019-12-03 阿里巴巴集团控股有限公司 The method and apparatus that WebApp starting runs, generates image file
CN105763602B (en) * 2016-01-29 2017-12-01 腾讯科技(深圳)有限公司 A kind of method of data request processing, server and system
US10860393B2 (en) * 2017-04-22 2020-12-08 Nicira, Inc. Tracking driver load and unload on windows OS
CN107979493B (en) * 2017-11-21 2019-10-29 平安科技(深圳)有限公司 Platform is construction method, server and the storage medium for servicing PAAS container platform
CN112035228B (en) * 2020-08-28 2024-04-12 光大科技有限公司 Resource scheduling method and device
CN113900721A (en) * 2021-10-15 2022-01-07 北京字节跳动网络技术有限公司 Operating system starting method and device and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104102506A (en) * 2014-04-25 2014-10-15 华南理工大学 ARM (Advanced RISC Machine) platform based Android startup acceleration method
CN104216776A (en) * 2014-08-25 2014-12-17 成都三零凯天通信实业有限公司 Quick starting method for Android operating system based on BLCR (Berkeley lab checkpoint restart) technology
CN110716758A (en) * 2018-06-26 2020-01-21 阿里巴巴集团控股有限公司 Program running method, device, equipment and storage medium
CN109189480A (en) * 2018-07-02 2019-01-11 新华三技术有限公司成都分公司 File system starts method and device
CN111930429A (en) * 2020-07-07 2020-11-13 上海商米科技集团股份有限公司 Method for quickly starting Android operating system and electronic equipment
CN114064190A (en) * 2020-07-30 2022-02-18 华为技术有限公司 Container starting method and device
CN112416467A (en) * 2020-12-10 2021-02-26 上海维宏电子科技股份有限公司 Control system, method, device, processor and computer readable storage medium for realizing rapid starting and initialization of numerical control system
CN113885967A (en) * 2021-10-22 2022-01-04 北京字跳网络技术有限公司 Method, device, equipment and medium for starting small program
CN114706622A (en) * 2022-03-10 2022-07-05 北京百度网讯科技有限公司 Method, apparatus, device, medium and product for starting model service

Also Published As

Publication number Publication date
CN114706622A (en) 2022-07-05
CN114706622B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
KR102493449B1 (en) Edge computing test methods, devices, electronic devices and computer-readable media
CN107491329B (en) Docker mirror image construction method, device, storage medium and electronic device
US9928050B2 (en) Automatic recognition of web application
CN110058922B (en) Method and device for extracting metadata of machine learning task
CN105765534A (en) Virtual computing systems and methods
US10417011B2 (en) Thread-agile execution of dynamic programming language programs
EP4209894A1 (en) Cloud code development system, method, and apparatus, device, and storage medium
WO2023168875A1 (en) Method and apparatus for starting model service, and device, medium and product
CN112506854A (en) Method, device, equipment and medium for storing page template file and generating page
CN111078269A (en) Version management method, version recovery method, editor, system and storage medium
US11163651B1 (en) Automated data restore
CN113051055A (en) Task processing method and device
US9384120B2 (en) Testing of transaction tracking software
US20230023290A1 (en) Method for managing function based on engine, electronic device and medium
US10621163B2 (en) Tracking and reusing function results
US10558528B2 (en) Reconstruction of system definitional and state information
EP3995973A2 (en) File moving method, apparatus, and medium
US11797770B2 (en) Self-improving document classification and splitting for document processing in robotic process automation
CN112486460A (en) Method, system, device and medium for automatically importing interface document
US11836472B2 (en) System and method for browser based polling
WO2024000917A1 (en) Non-intrusive, pluggable front-end build transfer acceleration method and apparatus
US20210286680A1 (en) Method, electronic device and computer program product for storage management
US20240168868A1 (en) Method and system for optimizing testing and deployment of an application
US20230012881A1 (en) Method and apparatus for reading data, electronic device and storage medium
CN112491940B (en) Request forwarding method and device of proxy server, storage medium and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22930504

Country of ref document: EP

Kind code of ref document: A1