WO2018103031A1 - Method for implementing function service of virtual machine, apparatus, electronic device and computer program product - Google Patents

Method for implementing function service of virtual machine, apparatus, electronic device and computer program product Download PDF

Info

Publication number
WO2018103031A1
WO2018103031A1 PCT/CN2016/108985 CN2016108985W WO2018103031A1 WO 2018103031 A1 WO2018103031 A1 WO 2018103031A1 CN 2016108985 W CN2016108985 W CN 2016108985W WO 2018103031 A1 WO2018103031 A1 WO 2018103031A1
Authority
WO
WIPO (PCT)
Prior art keywords
operating system
virtual machine
client
function service
function
Prior art date
Application number
PCT/CN2016/108985
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 深圳前海达闼云端智能科技有限公司
Priority to CN201680002749.7A priority Critical patent/CN107438834B/en
Priority to PCT/CN2016/108985 priority patent/WO2018103031A1/en
Publication of WO2018103031A1 publication Critical patent/WO2018103031A1/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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • 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/45533Hypervisors; Virtual machine monitors
    • G06F9/45554Instruction set architectures of guest OS and hypervisor or native processor differ, e.g. Bochs or VirtualPC on PowerPC MacOS

Definitions

  • the present invention relates to the field of virtual machine technologies, and in particular, to a method, an apparatus, an electronic device, and a computer program product for implementing a virtual machine function service.
  • a virtual machine is a complete computer system that runs through a software and has full hardware system functionality running in a fully isolated environment.
  • the virtual machine itself runs the operating system (client operating system) and its related applications, and the embedded system that provides the operating environment for the virtual machine also runs the software and hardware related to the operating system (main operating system).
  • the virtual machine runs as an application of the primary operating system and emulates the hardware device for its use while the client operating system is running.
  • the operating system (including all client operating systems and the main operating system) shares the CPU, memory, and input and output devices provided by the hardware device.
  • the operation of the client operating system depends on the virtual device and functional services provided by the virtual machine.
  • the existing virtual machine function service is implemented by: starting a client corresponding to the function service in the client operating system, and starting a server end corresponding to the function service in the main operating system, and the two are provided by the virtual machine.
  • the channel communicates.
  • each operating system corresponds to the unique one in the main operating system.
  • On one server side there are n server terminals in the main operating system.
  • Embodiments of the present invention provide a method, an apparatus, an electronic device, and a computer program product for implementing a virtual machine function service, which are mainly used to reduce the impact of a virtual machine function service on the performance of an embedded system.
  • an embodiment of the present invention provides a method for implementing a virtual machine function service, where the method includes:
  • the client operating system when the request for the preset operating system function is monitored, the corresponding virtual service request is sent to the primary virtual machine by the client virtual machine; and the processing returned by the primary virtual machine is received by the client virtual machine. After the result, the processing result is returned to the requester of the preset operating system function; wherein the client virtual machine is a virtual machine where the client operating system is located, and the primary virtual machine is a virtual machine where the main operating system is located;
  • the server software that provides the corresponding operating system function is invoked to process the function service request, and then the processed result is returned to the client. virtual machine.
  • an embodiment of the present invention provides an apparatus for implementing a virtual machine function service, where the apparatus includes:
  • the first processing module is configured to send, by the client virtual machine, a corresponding function service request to the primary virtual machine when the request for the preset operating system function is detected in the client operating system, and receive the corresponding function service request by the client virtual machine; After the processing result returned by the primary virtual machine is returned to the requester of the default operating system function, where the client virtual machine is the virtual machine where the client operating system is located, and the primary virtual machine is the main operating system.
  • Virtual machine is configured to send, by the client virtual machine, a corresponding function service request to the primary virtual machine when the request for the preset operating system function is detected in the client operating system, and receive the corresponding function service request by the client virtual machine; After the processing result returned by the primary virtual machine is returned to the requester of the default operating system function, where the client virtual machine is the virtual machine where the client operating system is located, and the primary virtual machine is the main operating system.
  • a second processing module configured to: after monitoring that the primary virtual machine receives the function service request, calling the server software for providing the corresponding operating system function to process the function service request, and then processing The result is returned to the client virtual machine.
  • an embodiment of the present invention provides an electronic device, where the electronic device includes:
  • Memory one or more processors; and transceiver components, memory, one or more And one or more network transmission units; the memory, the processor, and the network transmission unit are connected by a communication bus; wherein the network transmission unit is configured to transceive network data; the processor is configured to execute instructions in the memory; the storage medium There are stored instructions for performing the various steps in the method of the first aspect.
  • an embodiment of the present invention provides a computer program product for use in conjunction with an electronic device including a display, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer
  • the program mechanism includes instructions for performing the various steps in the method of the first aspect.
  • each client virtual machine may send a corresponding function service request to the main operating system, so that the main operating system invokes the server software for providing the corresponding operating system function to process the function service application, mainly To reduce the impact of virtual machine function services on the performance of embedded systems.
  • FIG. 1 is a schematic structural diagram of a system for implementing a virtual machine function service according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for implementing a virtual machine function service according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of another system for implementing virtual machine function services according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another system for implementing virtual machine function services according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a functional service flow for implementing a service list of a virtual machine according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a function service process for implementing a system function of a virtual machine function service according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a functional service flow for implementing a system stop service in a virtual machine function service according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an apparatus for implementing a virtual machine function service according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • the client and the server end are in one-to-one correspondence.
  • the number of servers increases exponentially, which affects the stability, reliability, and management efficiency of system resources.
  • the present invention provides a method for implementing a virtual machine function service, and a method for implementing the virtual machine function service, each client virtual machine can send a corresponding function service request to the main operating system, so that the main operating system call is used for
  • the server-side software that provides the corresponding operating system function processes the function service request, and is mainly used to reduce the impact of the virtual machine function service on the performance of the embedded system.
  • the present invention provides a method for implementing a virtual machine function service, which is applied to an implementation system of a virtual machine function service shown in FIG. 1.
  • the system includes a main operating system 101, and the main operating system 101 runs n.
  • a virtual machine 103 wherein one primary virtual machine and n-1 client virtual machines, each client virtual machine running a client operating system 102, n is greater than or equal to An integer of 1.
  • the client virtual machine is the virtual machine where the client operating system is located, and the primary virtual machine is the virtual machine where the operating system is located.
  • the main operating system 101 provides m types of functional services such as a processor management function service, a memory management function service, a device management function service, a file system management function service, and an interface function service, and m is an integer greater than or equal to 1.
  • the virtual machine function service implements the system startup process, as shown in FIG. 2 .
  • the m server ends are sequentially started.
  • Each server side corresponds to one type of functional service.
  • the n client operating systems 102 are sequentially started.
  • the process corresponding to the server software is started for the client operating system 102.
  • each client corresponds to one type of functional service.
  • the client has the same functional service type as the corresponding server.
  • m server ends are started on the main operating system 101, and each server end corresponds to one type of functional service.
  • Each client operating system 102 starts m clients, and each client also corresponds to one type of functional service.
  • the server end corresponding to the same type of function service establishes a connection with the client through the process corresponding to the server software.
  • each host operating system 101 starts a unique server end corresponding to the functional service A, and each client operating system 102 also starts corresponding to the functional service A.
  • the only server side, but because there are n client operating systems, for functional service A, its corresponding server side and its corresponding client are one-to-many relationship.
  • the main operating system 101 runs four virtual machines 103, which are a primary virtual machine, a client virtual machine A, a client virtual machine B, and a client virtual machine C.
  • Each client VM 102 runs a client operating system 102, that is, the virtual machine A runs the client operating system A, the virtual machine B runs the client operating system B, and the virtual machine C runs the client operating system C.
  • the main operating system 101 can provide the function service A and the function service B. Therefore, the main operating system 101 starts two server ends, which are respectively the server A of the corresponding function service A and the server B of the function service B. Two clients are started on each client operating system 102.
  • the client A is activated on the client operating system A
  • the client A is corresponding to the function service B
  • the client AB is activated on the client operating system B.
  • the client BA of the service A, the client BB of the corresponding function service B, and the client CA of the corresponding function service A and the client CB of the corresponding function service B are activated on the client operating system C.
  • connection 201 to step 203 six connections are established, which are respectively three connections corresponding to function service A (LAA between server A and client AA, LAB between server A and client BA, server) LAC between the end A and the client CA, corresponding to the three connections of the function service B (the LBA between the server B and the client AB, the LLB between the server B and the client BB, the server B and the client LBC between end CBs).
  • function service A LAA between server A and client AA, LAB between server A and client BA, server
  • LAC LAC between the end A and the client CA
  • the function service B the LBA between the server B and the client AB, the LLB between the server B and the client BB, the server B and the client LBC between end CBs.
  • the corresponding virtual service 103 is sent to the primary virtual machine 103 by the client virtual machine 103.
  • the main operating system 101 establishes and maintains the context of each connection.
  • the context information generated for presetting the operating system function is transmitted to the primary virtual machine 103 through the client virtual machine 103.
  • connection includes, but is not limited to, the environment at the time of connection execution, such as various variables and data.
  • connection context is dynamically updated as the connection changes in real time, ie maintenance.
  • the configurations of different client virtual machines 103 are different, and the types of functional services provided by the main operating system 101 are required to be different. Even if different client virtual machines 103 require the main operating system 101 to provide the same kind of functional services, the parameters and the like involved in the functional services are different. Therefore, after performing steps 201 to 204 to establish a connection between the server in the main operating system 101 and the client in the client operating system 102 running in the client virtual machine 103, it is necessary to establish the connection for all kinds of connections. The connection is processed to disconnect the connection corresponding to the functional service provided by the host operating system 101 for the client virtual machine 103, destroy the context of the connection, release resources, and reduce the number of maintenance of the connection.
  • the server software for providing the corresponding operating system function is invoked to process the function service application, and then the processed result is returned to the Client virtual machine 103.
  • the received context information is processed by using a process corresponding to the function service request.
  • the client operating system 102 After receiving the processing result returned by the main virtual machine 103, the client operating system 102 returns the processing result to the requester of the preset operating system function.
  • the main operating system 101 calls in step 206.
  • the server-side software for providing the corresponding operating system function processes the function service A application, that is, in the two connections (LAC and LBC) established by the main operating system 101 and the client operating system C, the client CA corresponding to the LAC is corresponding.
  • the functional service A is a functional service provided by the main operating system 101 to the client operating system C. According to the received context information, the function service application corresponding to the function service application of the function service A is processed, as shown in FIG. 4 .
  • the main operating system 101 After performing step 203, the main operating system 101 also allocates a state lock for the corresponding process of the function service request, and the state lock is used to make the process run. At the same time, the preset function is monitored. When the service is stopped, the state lock is released.
  • step 205 in the main operating system 101, when the preset function service stop condition is monitored, the process of the corresponding server-side software is stopped. For example, after stopping the process of the corresponding server-side software, the context information is destroyed.
  • the preset function service stop condition is any one of the following:
  • Condition 1 The client virtual machine is detected to be in a running state in the main operating system
  • Condition 2 In the main operating system, it is monitored that the client operating system is in a sleep state;
  • Condition 3 In the main operating system, detecting the function service stop request sent by the client virtual machine: At this time, the method further includes: in the client operating system, when monitoring the request for stopping the preset operating system function, The application is stopped by sending a corresponding function service to the primary virtual machine through the client virtual machine.
  • the server side in the main operating system 101 establishes a connection with the client in the client operating system 102.
  • the server can provide functional services for the connected client, including the following three aspects: 1) obtaining the service list; 2) enabling the service; 3) stopping the service.
  • Any client operating system 102 sends an application for obtaining a service list to the main operating system 101.
  • the host operating system 101 sends a list of functional services provided by any of the client operating systems 102 to any of the client operating systems 102.
  • the client operating system C sends an application for obtaining a service list to the main operating system 101.
  • the main operating system 101 sends a specific list of functional services A provided to the client operating system C to the client operating system C.
  • any client in any of the client operating systems 102 sends to the host operating system 101 Application for functional services.
  • the main operating system 101 determines that the virtual machine 103 where any of the client operating systems 102 is located is in an active state, and provides functional services to any client through the corresponding server.
  • the client CA in the client operating system C sends an application for the function service to the main operating system 101, and the main operating system 101 determines that the virtual machine C where the client operating system C is located is active. , through the server A to provide functional services to the client CA.
  • the client operating system 102 sends an application to stop the service to the main operating system 101.
  • the main operating system 101 destroys context information.
  • the client operating system B corresponding to the client BA of the LAB sends an application to stop the service to the main operating system 101, and the main operating system 101 destroys the context information.
  • each client virtual machine may send a corresponding function service request to the main operating system, so that the main operating system invokes the server software for providing the corresponding operating system function to process the function service application, mainly To reduce the impact of virtual machine function services on the performance of embedded systems.
  • the present embodiment provides an apparatus for implementing a virtual machine function service.
  • the principle of the virtual machine function service implementation device is similar to that of a virtual machine function service. Therefore, the virtual machine function service is similar.
  • the implementation device reference may be made to the implementation of a virtual machine function service implementation method, and the repeated description is not repeated.
  • the device for implementing the virtual machine function service includes:
  • the first processing module 801 is configured to send, by using a client virtual machine, a corresponding functional service request to the primary virtual machine when the request for the preset operating system function is detected in the client operating system. After the client virtual machine receives the processing result returned by the primary virtual machine, the processing result is returned to the requester of the default operating system function; wherein the client virtual machine is the virtual machine where the client operating system is located, The virtual machine is the virtual machine where the operating system is located.
  • the second processing module 802 is configured to: after detecting that the primary virtual machine receives the function service request, in the main operating system, invoke the server software for providing the corresponding operating system function to process the function service request, and then process the The result is returned to the client virtual machine.
  • the device further includes:
  • the startup module is configured to start, in the main operating system, a process corresponding to the server software for the client operating system when the client operating system is detected to be started;
  • a first processing module configured to send, by using a client virtual machine, context information generated by using a preset operating system function to the primary virtual machine;
  • the second processing module is configured to process the received context information by using a process corresponding to the function service request.
  • the device further includes:
  • An allocation module configured to allocate a state lock for a corresponding process of the function service request, where the state lock is used to make the process run;
  • the release module is used to release the state lock when the preset function service stop condition is monitored.
  • the device further includes:
  • the stop module is configured to stop the process of the corresponding server software when the preset function service stop condition is detected in the main operating system.
  • the device further includes:
  • the destruction module is used to destroy the context information after stopping the process of the corresponding server software.
  • the preset function service stop condition includes any one of the following:
  • Condition 1 The client virtual machine is detected to be in a running state in the main operating system
  • Condition 2 In the main operating system, it is monitored that the client operating system is in a sleep state;
  • Condition 3 In the main operating system, detecting that the function service sent by the client virtual machine stops the application; at this time, the device further includes:
  • the sending module is configured to send, by the client virtual machine, a corresponding function service stop request to the primary virtual machine when the request for stopping the preset operating system function is detected in the client operating system.
  • each client virtual machine may send a corresponding function service request to the main operating system, so that the main operating system invokes the server software for providing the corresponding operating system function to process the function service application, mainly To reduce the impact of virtual machine function services on the performance of embedded systems.
  • an embodiment of the present invention further provides an electronic device.
  • the electronic device includes:
  • the memory 901, the processor 902, and the network transmission unit 904 are in communication a bus connection unit; wherein the network transmission unit 904 is configured to transceive network data; the processor 902 is configured to execute instructions in the memory 901; and the storage medium stores instructions for performing various steps in an implementation method of a virtual machine function service .
  • an embodiment of the present invention provides a computer program product for use in conjunction with an electronic device including a display, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein,
  • the computer program mechanism includes instructions for performing various steps in an implementation of a virtual machine function service.
  • embodiments of the present invention can be provided as a method, system, Or a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

The present invention is applied to the field of virtual machine technology, and provided thereby are a method for implementing a function service of a virtual machine, an apparatus, an electronic device and a computer program product, the method comprising: sending a corresponding function service application to a main virtual machine by means of a client virtual machine in a client operating system when monitoring a request for a preset operating system function; after the client virtual machine receives a processing result returned by the main virtual machine, returning the processing result to a requester of a preset operating system function, the client virtual machine being the virtual machine where a client operating system is located, and the main virtual machine being the virtual machine where a main operating system is located; and in the main operating system, after monitoring that the main virtual machine has received the function service application, calling server software for providing a corresponding operating system function so as to process the function service application, and then returning a post-processing result to the client virtual machine. According to the present invention, each client virtual machine may send a corresponding function service application to a main operating system, so that the main operating system calls server software for providing a corresponding operating system function so to process the function service application, which is mainly used for reducing the impact of the virtual machine function service on the performance of an embedded system.

Description

虚拟机功能服务的实现方法、装置、电子设备和计算机程序产品Method, device, electronic device and computer program product for implementing virtual machine function service 技术领域Technical field
本发明涉及虚拟机技术领域,特别涉及一种虚拟机功能服务的实现方法、装置、电子设备和计算机程序产品。The present invention relates to the field of virtual machine technologies, and in particular, to a method, an apparatus, an electronic device, and a computer program product for implementing a virtual machine function service.
背景技术Background technique
虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。虚拟机本身运行操作系统(客户端操作系统)及其相关应用程序,为虚拟机提供运行环境的嵌入式系统也运行操作系统(主操作系统)相关的软件与硬件。虚拟机作为主操作系统的一个应用程序运行,并在客户端操作系统运行时,模拟硬件设备供其使用。A virtual machine is a complete computer system that runs through a software and has full hardware system functionality running in a fully isolated environment. The virtual machine itself runs the operating system (client operating system) and its related applications, and the embedded system that provides the operating environment for the virtual machine also runs the software and hardware related to the operating system (main operating system). The virtual machine runs as an application of the primary operating system and emulates the hardware device for its use while the client operating system is running.
由于嵌入式系统中可以部署多个虚拟机,因此,客户端操作系统可以有多个,主操作系统只能有1个。各操作系统(包括所有的客户端操作系统和主操作系统)之间共享硬件设备提供的CPU,内存和输入输出设备。Since multiple virtual machines can be deployed in an embedded system, there can be multiple client operating systems and only one primary operating system. The operating system (including all client operating systems and the main operating system) shares the CPU, memory, and input and output devices provided by the hardware device.
基于上述描述,客户端操作系统的运行依赖于虚拟机提供的虚拟设备与功能服务。现有的虚拟机功能服务的实现方法为:在客户端操作系统中启动一个与功能服务对应的客户端,在主操作系统当中启动一个与功能服务对应的服务器端,两者通过虚拟机提供的通道进行通信。Based on the above description, the operation of the client operating system depends on the virtual device and functional services provided by the virtual machine. The existing virtual machine function service is implemented by: starting a client corresponding to the function service in the client operating system, and starting a server end corresponding to the function service in the main operating system, and the two are provided by the virtual machine. The channel communicates.
当嵌入式系统中部署n个虚拟机,每个虚拟机上运行1个客户端操作系统,即嵌入式系统中运行着n个客户端操作系统时,每个操作系统均对应主操作系统中唯一一个服务器端,即主操作系统中存在n个服务器端。当功能服务的类型增加时,服务器端的数量也随之成倍增加,这将影响嵌入式系统的稳定性,可靠性,以及系统资源的管理效率。When n virtual machines are deployed in an embedded system, and one client operating system runs on each virtual machine, that is, when n client operating systems are running in the embedded system, each operating system corresponds to the unique one in the main operating system. On one server side, there are n server terminals in the main operating system. As the types of functional services increase, the number of servers increases exponentially, which affects the stability, reliability, and management efficiency of system resources.
发明内容Summary of the invention
本发明实施例提供了一种虚拟机功能服务的实现方法、装置、电子设备和计算机程序产品,主要用以降低虚拟机功能服务对嵌入式系统的性能的影响。Embodiments of the present invention provide a method, an apparatus, an electronic device, and a computer program product for implementing a virtual machine function service, which are mainly used to reduce the impact of a virtual machine function service on the performance of an embedded system.
第一方面,本发明实施例提供了一种虚拟机功能服务的实现方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for implementing a virtual machine function service, where the method includes:
在客户端操作系统中,在监测到针对预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务申请;并在客户端虚拟机接收到主虚拟机返回的处理结果后,将处理结果返回给预设操作系统功能的请求者;其中,所述客户端虚拟机为客户端操作系统所在的虚拟机,主虚拟机为主操作系统所在的虚拟机;In the client operating system, when the request for the preset operating system function is monitored, the corresponding virtual service request is sent to the primary virtual machine by the client virtual machine; and the processing returned by the primary virtual machine is received by the client virtual machine. After the result, the processing result is returned to the requester of the preset operating system function; wherein the client virtual machine is a virtual machine where the client operating system is located, and the primary virtual machine is a virtual machine where the main operating system is located;
在主操作系统中,在监测到主虚拟机接收到功能服务申请后,调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,之后将处理后的结果返回给客户端虚拟机。After the main operating system detects that the primary virtual machine receives the function service request, the server software that provides the corresponding operating system function is invoked to process the function service request, and then the processed result is returned to the client. virtual machine.
第二方面,本发明实施例提供了一种虚拟机功能服务的实现装置,所述装置包括:In a second aspect, an embodiment of the present invention provides an apparatus for implementing a virtual machine function service, where the apparatus includes:
第一处理模块,用于在客户端操作系统中,在监测到针对预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务申请;并在客户端虚拟机接收到主虚拟机返回的处理结果后,将处理结果返回给预设操作系统功能的请求者;其中,所述客户端虚拟机为客户端操作系统所在的虚拟机,主虚拟机为主操作系统所在的虚拟机;The first processing module is configured to send, by the client virtual machine, a corresponding function service request to the primary virtual machine when the request for the preset operating system function is detected in the client operating system, and receive the corresponding function service request by the client virtual machine; After the processing result returned by the primary virtual machine is returned to the requester of the default operating system function, where the client virtual machine is the virtual machine where the client operating system is located, and the primary virtual machine is the main operating system. Virtual machine
第二处理模块,用于在主操作系统中,在监测到主虚拟机接收到功能服务申请后,调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,之后将处理后的结果返回给客户端虚拟机。a second processing module, configured to: after monitoring that the primary virtual machine receives the function service request, calling the server software for providing the corresponding operating system function to process the function service request, and then processing The result is returned to the client virtual machine.
第三方面,本发明实施例提供了一种电子设备,所述电子设备包括:In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:
存储器,一个或多个处理器;以及收发组件,存储器,一个或多个处 理器;以及一个或多个网络传输单元;存储器、处理器以及网络传输单元通过通信总线相连;其中网络传输单元用于收发网络数据;处理器被配置为执行存储器中的指令;所述存储介质中存储有用于执行第一方面所述方法中各个步骤的指令。Memory, one or more processors; and transceiver components, memory, one or more And one or more network transmission units; the memory, the processor, and the network transmission unit are connected by a communication bus; wherein the network transmission unit is configured to transceive network data; the processor is configured to execute instructions in the memory; the storage medium There are stored instructions for performing the various steps in the method of the first aspect.
第四方面,本发明实施例提供了一种与包括显示器的电子设备结合使用的计算机程序产品,所述计算机程序产品包括计算机可读的存储介质和内嵌于其中的计算机程序机制,所述计算机程序机制包括用于执行第一方面所述方法中各个步骤的指令。In a fourth aspect, an embodiment of the present invention provides a computer program product for use in conjunction with an electronic device including a display, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, the computer The program mechanism includes instructions for performing the various steps in the method of the first aspect.
有益效果如下:The benefits are as follows:
本发明实施例中各客户端虚拟机均可向主操作系统发送相应的功能服务申请,使主操作系统调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,主要用以降低虚拟机功能服务对嵌入式系统的性能的影响。In the embodiment of the present invention, each client virtual machine may send a corresponding function service request to the main operating system, so that the main operating system invokes the server software for providing the corresponding operating system function to process the function service application, mainly To reduce the impact of virtual machine function services on the performance of embedded systems.
附图说明DRAWINGS
下面将参照附图描述本发明的具体实施例,其中:Specific embodiments of the present invention will be described below with reference to the accompanying drawings, in which:
图1为本发明实施例中的一种虚拟机功能服务的实现系统结构示意图;1 is a schematic structural diagram of a system for implementing a virtual machine function service according to an embodiment of the present invention;
图2为本发明实施例中的一种虚拟机功能服务的实现方法流程示意图;2 is a schematic flowchart of a method for implementing a virtual machine function service according to an embodiment of the present invention;
图3为本发明实施例中的另一种虚拟机功能服务的实现系统结构示意图;3 is a schematic structural diagram of another system for implementing virtual machine function services according to an embodiment of the present invention;
图4为本发明实施例中的另一种虚拟机功能服务的实现系统结构示意图;4 is a schematic structural diagram of another system for implementing virtual machine function services according to an embodiment of the present invention;
图5为本发明实施例中的一种虚拟机功能服务的实现系统获取服务列表方面的功能服务流程示意图;FIG. 5 is a schematic diagram of a functional service flow for implementing a service list of a virtual machine according to an embodiment of the present invention;
图6为本发明实施例中的一种虚拟机功能服务的实现系统使能服务方面的功能服务流程示意图; FIG. 6 is a schematic diagram of a function service process for implementing a system function of a virtual machine function service according to an embodiment of the present invention; FIG.
图7为本发明实施例中的一种虚拟机功能服务的实现系统停止服务方面的功能服务流程示意图;FIG. 7 is a schematic diagram of a functional service flow for implementing a system stop service in a virtual machine function service according to an embodiment of the present invention; FIG.
图8为本发明实施例中的一种虚拟机功能服务的实现装置的结构示意图;FIG. 8 is a schematic structural diagram of an apparatus for implementing a virtual machine function service according to an embodiment of the present invention;
图9为本发明实施例中的一种电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的技术方案及优点更加清楚明白,以下结合附图对本发明的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本发明的一部分实施例,而不是所有实施例的穷举。并且在不冲突的情况下,本发明中的实施例及实施例中的特征可以互相结合。The embodiments of the present invention are further described in detail with reference to the accompanying drawings, in which FIG. An exhaustive example. And in the case of no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.
发明人在发明过程中注意到:The inventor noticed during the invention:
现有的虚拟机功能服务的实现方式中,对于某一种类型的功能服务,客户端与服务器端是一一对应的。当功能服务的类型增加时,服务器端的数量也随之成倍增加,这将影响嵌入式系统的稳定性,可靠性,以及系统资源的管理效率。In the implementation manner of the existing virtual machine function service, for a certain type of function service, the client and the server end are in one-to-one correspondence. As the types of functional services increase, the number of servers increases exponentially, which affects the stability, reliability, and management efficiency of system resources.
基于此,本发明提供了一种虚拟机功能服务的实现方法,该虚拟机功能服务的实现方法各客户端虚拟机均可向主操作系统发送相应的功能服务申请,使主操作系统调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,主要用以降低虚拟机功能服务对嵌入式系统的性能的影响。Based on this, the present invention provides a method for implementing a virtual machine function service, and a method for implementing the virtual machine function service, each client virtual machine can send a corresponding function service request to the main operating system, so that the main operating system call is used for The server-side software that provides the corresponding operating system function processes the function service request, and is mainly used to reduce the impact of the virtual machine function service on the performance of the embedded system.
本发明提供的一种虚拟机功能服务的实现方法,该方法应用于图1所示的一种虚拟机功能服务的实现系统中,该系统包括一个主操作系统101,主操作系统101上运行n个虚拟机103,其中,一个主虚拟机和n-1个客户端虚拟机,每个客户端虚拟机运行一个客户端操作系统102,n为大于等于 1的整数。客户端虚拟机为客户端操作系统所在的虚拟机,主虚拟机为主操作系统所在的虚拟机。The present invention provides a method for implementing a virtual machine function service, which is applied to an implementation system of a virtual machine function service shown in FIG. 1. The system includes a main operating system 101, and the main operating system 101 runs n. a virtual machine 103, wherein one primary virtual machine and n-1 client virtual machines, each client virtual machine running a client operating system 102, n is greater than or equal to An integer of 1. The client virtual machine is the virtual machine where the client operating system is located, and the primary virtual machine is the virtual machine where the operating system is located.
主操作系统101提供诸如处理机管理功能服务、内存管理功能服务、设备管理功能服务、文件系统管理功能服务、接口功能服务等m种类型的功能服务,m为大于等于1的整数。The main operating system 101 provides m types of functional services such as a processor management function service, a memory management function service, a device management function service, a file system management function service, and an interface function service, and m is an integer greater than or equal to 1.
该虚拟机功能服务的实现系统启动过程,如图2所示。The virtual machine function service implements the system startup process, as shown in FIG. 2 .
201,主操作系统101启动后,依次启动m个服务器端。201. After the main operating system 101 is started, the m server ends are sequentially started.
其中,每个服务器端对应一种类型的功能服务。Each server side corresponds to one type of functional service.
202,主操作系统101启动m个服务器端后,依次启动n个客户端操作系统102。202. After the main operating system 101 starts the m server ends, the n client operating systems 102 are sequentially started.
203,在主操作系统101中,在监测到客户端操作系统102启动时,针对该客户端操作系统102启动服务器端软件对应的进程。203. In the main operating system 101, when it is detected that the client operating system 102 is started, the process corresponding to the server software is started for the client operating system 102.
任一客户端操作系统102启动后,依次启动m个客户端,并通过服务器端软件对应的进程建立与服务器端的连接;After any client operating system 102 is started, m clients are sequentially started, and a connection with the server is established through a process corresponding to the server software;
其中,每个客户端对应一种类型的功能服务。客户端与相应服务器端对应相同的功能服务类型Among them, each client corresponds to one type of functional service. The client has the same functional service type as the corresponding server.
经过步骤201和步骤202,主操作系统101上启动m个服务器端,且每个服务器端一一对应一种类型的功能服务。每个客户端操作系统102均启动m个客户端,每个客户端也一一对应一种类型的功能服务。同时,对应同一种类型的功能服务的服务器端与客户端通过服务器端软件对应的进程建立连接。对于m种类型的功能服务中的任一功能服务A,每个主操作系统101上启动与功能服务A对应的唯一一个服务器端,每个客户端操作系统102也均启动与功能服务A对应的唯一一个服务器端,但由于客户端操作系统有n个,因此对于功能服务A,与其对应的服务器端和与其对应的客户端是一对多的关系。 After step 201 and step 202, m server ends are started on the main operating system 101, and each server end corresponds to one type of functional service. Each client operating system 102 starts m clients, and each client also corresponds to one type of functional service. At the same time, the server end corresponding to the same type of function service establishes a connection with the client through the process corresponding to the server software. For any of the m types of functional services A, each host operating system 101 starts a unique server end corresponding to the functional service A, and each client operating system 102 also starts corresponding to the functional service A. The only server side, but because there are n client operating systems, for functional service A, its corresponding server side and its corresponding client are one-to-many relationship.
图3示出了m=2,n=3时虚拟机功能服务的实现系统中客户端与服务器端之间的连接关系。FIG. 3 shows the connection relationship between the client and the server in the implementation system of the virtual machine function service when m=2 and n=3.
其中,主操作系统101上运行4个虚拟机103,分别为主虚拟机、客户端虚拟机A、客户端虚拟机B、客户端虚拟机C。每个虚拟机103上运行一个客户端操作系统102,即虚拟机A上运行客户端操作系统A、虚拟机B上运行客户端操作系统B、虚拟机C上运行客户端操作系统C。主操作系统101可以提供功能服务A和功能服务B。因此,主操作系统101启动2个服务器端,分别为对应功能服务A的服务器端A,对应功能服务B的服务器端B。每个客户端操作系统102上启动2个客户端,例如:客户端操作系统A上启动对应功能服务A的客户端AA、对应功能服务B的客户端AB,客户端操作系统B上启动对应功能服务A的客户端BA、对应功能服务B的客户端BB,客户端操作系统C上启动对应功能服务A的客户端CA、对应功能服务B的客户端CB。执行步骤能201至步骤203之后,建立6条连接,分别为对应功能服务A的3条连接(服务器端A与客户端AA之间的LAA,服务器端A与客户端BA之间的LAB,服务器端A与客户端CA之间的LAC),对应功能服务B的3条连接(服务器端B与客户端AB之间的LBA,服务器端B与客户端BB之间的LBB,服务器端B与客户端CB之间的LBC)。The main operating system 101 runs four virtual machines 103, which are a primary virtual machine, a client virtual machine A, a client virtual machine B, and a client virtual machine C. Each client VM 102 runs a client operating system 102, that is, the virtual machine A runs the client operating system A, the virtual machine B runs the client operating system B, and the virtual machine C runs the client operating system C. The main operating system 101 can provide the function service A and the function service B. Therefore, the main operating system 101 starts two server ends, which are respectively the server A of the corresponding function service A and the server B of the function service B. Two clients are started on each client operating system 102. For example, the client A is activated on the client operating system A, the client A is corresponding to the function service B, and the client AB is activated on the client operating system B. The client BA of the service A, the client BB of the corresponding function service B, and the client CA of the corresponding function service A and the client CB of the corresponding function service B are activated on the client operating system C. After performing step 201 to step 203, six connections are established, which are respectively three connections corresponding to function service A (LAA between server A and client AA, LAB between server A and client BA, server) LAC between the end A and the client CA, corresponding to the three connections of the function service B (the LBA between the server B and the client AB, the LLB between the server B and the client BB, the server B and the client LBC between end CBs).
204,在客户端操作系统102中,在监测到针对预设操作系统功能的请求时,通过客户端虚拟机103向主虚拟机103发送相应的功能服务申请。204. In the client operating system 102, when the request for the preset operating system function is monitored, the corresponding virtual service 103 is sent to the primary virtual machine 103 by the client virtual machine 103.
主操作系统101建立并维护各连接的上下文。将针对用以预设操作系统功能所产生的上下文信息通过客户端虚拟机103发送到主虚拟机103。The main operating system 101 establishes and maintains the context of each connection. The context information generated for presetting the operating system function is transmitted to the primary virtual machine 103 through the client virtual machine 103.
其中,连接的上下文包括但不限于连接执行时的环境,例如各个变量和数据等。The context of the connection includes, but is not limited to, the environment at the time of connection execution, such as various variables and data.
该连接的上下文随着连接的实时变化进行动态更新,即进行维护。 The context of the connection is dynamically updated as the connection changes in real time, ie maintenance.
在实际应用过程中,不同的客户端虚拟机103的配置等均不同,需要主操作系统101为之提供的功能服务种类不同。即使不同客户端虚拟机103需要主操作系统101提供同一种类的功能服务,其功能服务涉及的参数等也不同。因此,在执行步骤201至步骤204建立主操作系统101中的服务器端与客户端虚拟机103中运行的客户端操作系统102中的客户端之间建立针对所有种类的连接之后,还需要对建立的连接进行处理,以断开主操作系统101不会为客户端虚拟机103提供的功能服务所对应的连接,销毁该连接的上下文,释放资源,减少连接的维护数量。In the actual application process, the configurations of different client virtual machines 103 are different, and the types of functional services provided by the main operating system 101 are required to be different. Even if different client virtual machines 103 require the main operating system 101 to provide the same kind of functional services, the parameters and the like involved in the functional services are different. Therefore, after performing steps 201 to 204 to establish a connection between the server in the main operating system 101 and the client in the client operating system 102 running in the client virtual machine 103, it is necessary to establish the connection for all kinds of connections. The connection is processed to disconnect the connection corresponding to the functional service provided by the host operating system 101 for the client virtual machine 103, destroy the context of the connection, release resources, and reduce the number of maintenance of the connection.
205,在主操作系统101中,在监测到主虚拟机103接收到功能服务申请后,调用用于提供相应操作系统功能的服务器端软件对功能服务申请进行处理,之后将处理后的结果返回给客户端虚拟机103。205. In the main operating system 101, after monitoring that the primary virtual machine 103 receives the function service request, the server software for providing the corresponding operating system function is invoked to process the function service application, and then the processed result is returned to the Client virtual machine 103.
具体的,利用功能服务申请对应的进程对接收到的上下文信息进行处理。Specifically, the received context information is processed by using a process corresponding to the function service request.
206,客户端操作系统102在客户端虚拟机103接收到主虚拟机103返回的处理结果后,将处理结果返回给预设操作系统功能的请求者。206. After receiving the processing result returned by the main virtual machine 103, the client operating system 102 returns the processing result to the requester of the preset operating system function.
以图3的连接情况为例,如果客户端操作系统C在步骤204中通过客户端虚拟机103向主虚拟机103发送相应的功能服务A的功能服务申请,主操作系统101在步骤206中调用用于提供相应操作系统功能的服务器端软件对功能服务A申请进行处理,即在主操作系统101与客户端操作系统C建立的2个连接(LAC和LBC)中,LAC连接的客户端CA对应的功能服务A为主操作系统101向客户端操作系统C提供的功能服务。根据接收到的上下文信息;利用功能服务A的功能服务申请对应的进程对功能服务申请进行处理,如图4所示。Taking the connection situation of FIG. 3 as an example, if the client operating system C sends the function service request of the corresponding function service A to the main virtual machine 103 through the client virtual machine 103 in step 204, the main operating system 101 calls in step 206. The server-side software for providing the corresponding operating system function processes the function service A application, that is, in the two connections (LAC and LBC) established by the main operating system 101 and the client operating system C, the client CA corresponding to the LAC is corresponding. The functional service A is a functional service provided by the main operating system 101 to the client operating system C. According to the received context information, the function service application corresponding to the function service application of the function service A is processed, as shown in FIG. 4 .
执行步骤203之后主操作系统101还为功能服务申请对应的进程分配状态锁,状态锁用于使该进程处于运行状态。同时,在监测到预设的功能 服务停止条件时,解除状态锁。After performing step 203, the main operating system 101 also allocates a state lock for the corresponding process of the function service request, and the state lock is used to make the process run. At the same time, the preset function is monitored. When the service is stopped, the state lock is released.
在执行步骤205之后,在主操作系统101中,在监测到预设的功能服务停止条件时,停止对应的服务器端软件的进程。例如,在停止对应的服务器端软件的进程后,销毁上下文信息。After the step 205 is performed, in the main operating system 101, when the preset function service stop condition is monitored, the process of the corresponding server-side software is stopped. For example, after stopping the process of the corresponding server-side software, the context information is destroyed.
其中,预设的功能服务停止条件,为如下任意一条:Among them, the preset function service stop condition is any one of the following:
条件一:在主操作系统中监测到客户端虚拟机处于停止运行状态;Condition 1: The client virtual machine is detected to be in a running state in the main operating system;
条件二:在主操作系统中,监测到客户端操作系统处于休眠状态;Condition 2: In the main operating system, it is monitored that the client operating system is in a sleep state;
条件三:在主操作系统中,检测到客户端虚拟机发送的功能服务停止申请:此时,方法还包括:在客户端操作系统中,在监测到针对停止预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务停止申请。Condition 3: In the main operating system, detecting the function service stop request sent by the client virtual machine: At this time, the method further includes: in the client operating system, when monitoring the request for stopping the preset operating system function, The application is stopped by sending a corresponding function service to the primary virtual machine through the client virtual machine.
经过图2所示的流程,主操作系统101中的服务器端与客户端操作系统102中的客户端建立了连接。建立连接后,服务器端即可为连接的客户端提供功能服务,具体的包括如下三个方面:1)获取服务列表;2)使能服务;3)停止服务。Through the flow shown in FIG. 2, the server side in the main operating system 101 establishes a connection with the client in the client operating system 102. After the connection is established, the server can provide functional services for the connected client, including the following three aspects: 1) obtaining the service list; 2) enabling the service; 3) stopping the service.
●对于获取服务列表方面的功能服务,如图5所示。● For the function service of obtaining the service list, as shown in Figure 5.
501,任一客户端操作系统102向主操作系统101发送获取服务列表的申请。501. Any client operating system 102 sends an application for obtaining a service list to the main operating system 101.
502,主操作系统101向任一客户端操作系统102发送为任一客户端操作系统102提供的功能服务的列表。502. The host operating system 101 sends a list of functional services provided by any of the client operating systems 102 to any of the client operating systems 102.
以图4所示的连接情况为例,客户端操作系统C向主操作系统101发送获取服务列表的申请。主操作系统101向客户端操作系统C发送为客户端操作系统C提供的功能服务A的具体列表。Taking the connection situation shown in FIG. 4 as an example, the client operating system C sends an application for obtaining a service list to the main operating system 101. The main operating system 101 sends a specific list of functional services A provided to the client operating system C to the client operating system C.
●对于使能服务方面的功能服务,如图6所示。● For the functional services of the enabled service, as shown in Figure 6.
601,任一客户端操作系统102中的任一客户端向主操作系统101发送 功能服务的申请。601, any client in any of the client operating systems 102 sends to the host operating system 101 Application for functional services.
602,主操作系统101确定任一客户端操作系统102所在虚拟机103处于活动状态,通过相应服务器端向任一客户端提供功能服务。602. The main operating system 101 determines that the virtual machine 103 where any of the client operating systems 102 is located is in an active state, and provides functional services to any client through the corresponding server.
仍以图4所示的连接情况为例,客户端操作系统C中的客户端CA向主操作系统101发送功能服务的申请,主操作系统101确定客户端操作系统C所在虚拟机C处于活动状态,则通过服务器端A向客户端CA提供功能服务。Taking the connection situation shown in FIG. 4 as an example, the client CA in the client operating system C sends an application for the function service to the main operating system 101, and the main operating system 101 determines that the virtual machine C where the client operating system C is located is active. , through the server A to provide functional services to the client CA.
●对于停止服务方面的功能服务,如图7所示。● For the functional service of stopping the service, as shown in Figure 7.
701,客户端操作系统102向主操作系统101发送停止服务的申请。701. The client operating system 102 sends an application to stop the service to the main operating system 101.
702,主操作系统101销毁上下文信息。702. The main operating system 101 destroys context information.
仍以图4所示的连接情况为例,LAB的客户端BA对应的客户端操作系统B向主操作系统101发送停止服务的申请,主操作系统101销毁上下文信息。Still taking the connection situation shown in FIG. 4 as an example, the client operating system B corresponding to the client BA of the LAB sends an application to stop the service to the main operating system 101, and the main operating system 101 destroys the context information.
有益效果:Beneficial effects:
本发明实施例中各客户端虚拟机均可向主操作系统发送相应的功能服务申请,使主操作系统调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,主要用以降低虚拟机功能服务对嵌入式系统的性能的影响。In the embodiment of the present invention, each client virtual machine may send a corresponding function service request to the main operating system, so that the main operating system invokes the server software for providing the corresponding operating system function to process the function service application, mainly To reduce the impact of virtual machine function services on the performance of embedded systems.
基于同一发明构思,本实施例提供了一种虚拟机功能服务的实现装置,该虚拟机功能服务的实现装置解决问题的原理与一种虚拟机功能服务的实现方法相似,因此该虚拟机功能服务的实现装置实施可以参见一种虚拟机功能服务的实现方法的实施,重复之处不再赘述。Based on the same inventive concept, the present embodiment provides an apparatus for implementing a virtual machine function service. The principle of the virtual machine function service implementation device is similar to that of a virtual machine function service. Therefore, the virtual machine function service is similar. For implementation of the implementation device, reference may be made to the implementation of a virtual machine function service implementation method, and the repeated description is not repeated.
参见图8,该虚拟机功能服务的实现装置,包括:Referring to FIG. 8, the device for implementing the virtual machine function service includes:
第一处理模块801,用于在客户端操作系统中,在监测到针对预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务申 请;并在客户端虚拟机接收到主虚拟机返回的处理结果后,将处理结果返回给预设操作系统功能的请求者;其中,客户端虚拟机为客户端操作系统所在的虚拟机,主虚拟机为主操作系统所在的虚拟机;The first processing module 801 is configured to send, by using a client virtual machine, a corresponding functional service request to the primary virtual machine when the request for the preset operating system function is detected in the client operating system. After the client virtual machine receives the processing result returned by the primary virtual machine, the processing result is returned to the requester of the default operating system function; wherein the client virtual machine is the virtual machine where the client operating system is located, The virtual machine is the virtual machine where the operating system is located.
第二处理模块802,用于在主操作系统中,在监测到主虚拟机接收到功能服务申请后,调用用于提供相应操作系统功能的服务器端软件对功能服务申请进行处理,之后将处理后的结果返回给客户端虚拟机。The second processing module 802 is configured to: after detecting that the primary virtual machine receives the function service request, in the main operating system, invoke the server software for providing the corresponding operating system function to process the function service request, and then process the The result is returned to the client virtual machine.
可选地,该装置还包括:Optionally, the device further includes:
启动模块,用于在主操作系统中,在监测到客户端操作系统启动时,针对该客户端操作系统启动服务器端软件对应的进程;The startup module is configured to start, in the main operating system, a process corresponding to the server software for the client operating system when the client operating system is detected to be started;
第一处理模块,用于将针对用以预设操作系统功能所产生的上下文信息通过客户端虚拟机发送到主虚拟机;a first processing module, configured to send, by using a client virtual machine, context information generated by using a preset operating system function to the primary virtual machine;
第二处理模块,用于利用功能服务申请对应的进程对接收到的上下文信息进行处理。The second processing module is configured to process the received context information by using a process corresponding to the function service request.
可选地,该装置还包括:Optionally, the device further includes:
分配模块,用于为功能服务申请对应的进程分配状态锁,状态锁用于使该进程处于运行状态;An allocation module, configured to allocate a state lock for a corresponding process of the function service request, where the state lock is used to make the process run;
解除模块,用于在监测到预设的功能服务停止条件时,解除状态锁。The release module is used to release the state lock when the preset function service stop condition is monitored.
可选地,该装置还包括:Optionally, the device further includes:
停止模块,用于在主操作系统中,在监测到预设的功能服务停止条件时,停止对应的服务器端软件的进程。The stop module is configured to stop the process of the corresponding server software when the preset function service stop condition is detected in the main operating system.
可选地,该装置还包括:Optionally, the device further includes:
销毁模块,用于在停止对应的服务器端软件的进程后,销毁上下文信息。The destruction module is used to destroy the context information after stopping the process of the corresponding server software.
可选的,预设的功能服务停止条件,包括如下任意一条:Optionally, the preset function service stop condition includes any one of the following:
条件一:在主操作系统中监测到客户端虚拟机处于停止运行状态; Condition 1: The client virtual machine is detected to be in a running state in the main operating system;
条件二:在主操作系统中,监测到客户端操作系统处于休眠状态;Condition 2: In the main operating system, it is monitored that the client operating system is in a sleep state;
条件三:在主操作系统中,检测到客户端虚拟机发送的功能服务停止申请;此时,该装置还包括:Condition 3: In the main operating system, detecting that the function service sent by the client virtual machine stops the application; at this time, the device further includes:
发送模块,用于在客户端操作系统中,在监测到针对停止预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务停止申请。The sending module is configured to send, by the client virtual machine, a corresponding function service stop request to the primary virtual machine when the request for stopping the preset operating system function is detected in the client operating system.
有益效果:Beneficial effects:
本发明实施例中各客户端虚拟机均可向主操作系统发送相应的功能服务申请,使主操作系统调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,主要用以降低虚拟机功能服务对嵌入式系统的性能的影响。In the embodiment of the present invention, each client virtual machine may send a corresponding function service request to the main operating system, so that the main operating system invokes the server software for providing the corresponding operating system function to process the function service application, mainly To reduce the impact of virtual machine function services on the performance of embedded systems.
再一方面,本发明实施例还提供了一种电子设备,参见图9,电子设备包括:In another aspect, an embodiment of the present invention further provides an electronic device. Referring to FIG. 9, the electronic device includes:
存储器901,一个或多个处理器902;以及收发组件903,存储器901,一个或多个处理器902;以及一个或多个网络传输单元904;存储器901、处理器902以及网络传输单元904通过通信总线相连;其中网络传输单元904用于收发网络数据;处理器902被配置为执行存储器901中的指令;所述存储介质中存储有用于执行一种虚拟机功能服务的实现方法中各个步骤的指令。a memory 901, one or more processors 902; and a transceiver component 903, a memory 901, one or more processors 902; and one or more network transmission units 904; the memory 901, the processor 902, and the network transmission unit 904 are in communication a bus connection unit; wherein the network transmission unit 904 is configured to transceive network data; the processor 902 is configured to execute instructions in the memory 901; and the storage medium stores instructions for performing various steps in an implementation method of a virtual machine function service .
再一方面,本发明实施例还提供了一种与包括显示器的电子设备结合使用的计算机程序产品,所述计算机程序产品包括计算机可读的存储介质和内嵌于其中的计算机程序机制,所述计算机程序机制包括用于执行一种虚拟机功能服务的实现方法中各个步骤的指令。In still another aspect, an embodiment of the present invention provides a computer program product for use in conjunction with an electronic device including a display, the computer program product comprising a computer readable storage medium and a computer program mechanism embedded therein, The computer program mechanism includes instructions for performing various steps in an implementation of a virtual machine function service.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、 或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, Or a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和 修改。 While the preferred embodiment of the invention has been described, it will be understood that Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all modifications and modify.

Claims (12)

  1. 一种虚拟机功能服务的实现方法,其特征在于,所述方法包括:A method for implementing a virtual machine function service, the method comprising:
    在客户端操作系统中,在监测到针对预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务申请;并在客户端虚拟机接收到主虚拟机返回的处理结果后,将处理结果返回给预设操作系统功能的请求者;其中,所述客户端虚拟机为客户端操作系统所在的虚拟机,主虚拟机为主操作系统所在的虚拟机;In the client operating system, when the request for the preset operating system function is monitored, the corresponding virtual service request is sent to the primary virtual machine by the client virtual machine; and the processing returned by the primary virtual machine is received by the client virtual machine. After the result, the processing result is returned to the requester of the preset operating system function; wherein the client virtual machine is a virtual machine where the client operating system is located, and the primary virtual machine is a virtual machine where the main operating system is located;
    在主操作系统中,在监测到主虚拟机接收到功能服务申请后,调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,之后将处理后的结果返回给客户端虚拟机。After the main operating system detects that the primary virtual machine receives the function service request, the server software that provides the corresponding operating system function is invoked to process the function service request, and then the processed result is returned to the client. virtual machine.
  2. 根据权利要求1所述的方法,其特征在于,在所述调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理之前,所述方法还包括:The method according to claim 1, wherein before the invoking the server-side software for providing the corresponding operating system function to process the function service request, the method further includes:
    在主操作系统中,在监测到客户端操作系统启动时,针对该客户端操作系统启动所述服务器端软件对应的进程;In the main operating system, when the client operating system is detected to be started, the process corresponding to the server software is started for the client operating system;
    所述通过客户端虚拟机向主虚拟机发送相应的功能服务申请,包括:Transmitting, by the client virtual machine, a corresponding functional service request to the primary virtual machine, including:
    将针对用以预设操作系统功能所产生的上下文信息通过客户端虚拟机发送到主虚拟机;Sending context information generated by the operating system function to the primary virtual machine through the client virtual machine;
    所述调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,包括:The invoking server software for providing a corresponding operating system function processes the function service request, including:
    利用所述功能服务申请对应的进程对接收到的上下文信息进行处理。The received context information is processed by the process corresponding to the function service request.
  3. 根据权利要求2所述的方法,其特征在于,所述在主操作系统中,针对该客户端操作系统启动所述服务器端软件对应的进程之后,还包括:The method according to claim 2, wherein after the process corresponding to the server-side software is started for the client operating system in the main operating system, the method further includes:
    为所述功能服务申请对应的进程分配状态锁,所述状态锁用于使该进程处于运行状态; Assigning a state lock to the corresponding process of the function service request, the state lock is used to make the process in a running state;
    在监测到预设的功能服务停止条件时,解除状态锁。The state lock is released when the preset function service stop condition is detected.
  4. 根据权利要求2所述的方法,其特征在于,所述利用所述功能服务申请对应的进程对所述功能服务申请进行处理之后,所述方法还包括:The method according to claim 2, wherein after the processing of the function service request by the process corresponding to the function service request, the method further comprises:
    在主操作系统中,在监测到预设的功能服务停止条件时,停止对应的服务器端软件的进程。In the main operating system, when the preset function service stop condition is monitored, the process of the corresponding server software is stopped.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:在停止对应的服务器端软件的进程后,销毁所述上下文信息。The method according to claim 4, wherein the method further comprises: destroying the context information after stopping the process of the corresponding server-side software.
  6. 根据要求3或4所述的方法,其特征在于,预设的功能服务停止条件,包括如下任意一条:The method according to claim 3 or 4, characterized in that the preset function service stop condition comprises any one of the following:
    条件一:在主操作系统中监测到所述客户端虚拟机处于停止运行状态;Condition 1: monitoring, in the main operating system, that the client virtual machine is in a stopped state;
    条件二:在主操作系统中,监测到客户端操作系统处于休眠状态;Condition 2: In the main operating system, it is monitored that the client operating system is in a sleep state;
    条件三:在主操作系统中,检测到客户端虚拟机发送的功能服务停止申请;此时,所述方法还包括:在客户端操作系统中,在监测到针对停止预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务停止申请。Condition 3: In the main operating system, detecting that the function service sent by the client virtual machine stops the application; at this time, the method further includes: in the client operating system, monitoring the request for stopping the preset operating system function When the client virtual machine sends a corresponding function service to the primary virtual machine to stop the application.
  7. 一种虚拟机功能服务的实现装置,其特征在于,所述装置包括:An apparatus for implementing a virtual machine function service, the device comprising:
    第一处理模块,用于在客户端操作系统中,在监测到针对预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务申请;并在客户端虚拟机接收到主虚拟机返回的处理结果后,将处理结果返回给预设操作系统功能的请求者;其中,所述客户端虚拟机为客户端操作系统所在的虚拟机,主虚拟机为主操作系统所在的虚拟机;The first processing module is configured to send, by the client virtual machine, a corresponding function service request to the primary virtual machine when the request for the preset operating system function is detected in the client operating system, and receive the corresponding function service request by the client virtual machine; After the processing result returned by the primary virtual machine is returned to the requester of the default operating system function, where the client virtual machine is the virtual machine where the client operating system is located, and the primary virtual machine is the main operating system. Virtual machine
    第二处理模块,用于在主操作系统中,在监测到主虚拟机接收到功能服务申请后,调用用于提供相应操作系统功能的服务器端软件对所述功能服务申请进行处理,之后将处理后的结果返回给客户端虚拟机。a second processing module, configured to: after monitoring that the primary virtual machine receives the function service request, calling the server software for providing the corresponding operating system function to process the function service request, and then processing The result is returned to the client virtual machine.
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括: The device according to claim 7, wherein the device further comprises:
    启动模块,用于在主操作系统中,在监测到客户端操作系统启动时,针对该客户端操作系统启动所述服务器端软件对应的进程;a startup module, configured to start, in the main operating system, a process corresponding to the server software for the client operating system when the client operating system is detected to be started;
    所述第一处理模块,用于将针对用以预设操作系统功能所产生的上下文信息通过客户端虚拟机发送到主虚拟机;The first processing module is configured to send, by using a client virtual machine, context information generated by using a preset operating system function to the primary virtual machine;
    所述第二处理模块,用于利用所述功能服务申请对应的进程对接收到的上下文信息进行处理。The second processing module is configured to process the received context information by using a process corresponding to the function service request.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    分配模块,用于为所述功能服务申请对应的进程分配状态锁,所述状态锁用于使该进程处于运行状态;An allocating module, configured to allocate a state lock to a corresponding process of the function service request, where the state lock is used to make the process in a running state;
    解除模块,用于在监测到预设的功能服务停止条件时,解除状态锁。The release module is used to release the state lock when the preset function service stop condition is monitored.
  10. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    停止模块,用于在主操作系统中,在监测到预设的功能服务停止条件时,停止对应的服务器端软件的进程。The stop module is configured to stop the process of the corresponding server software when the preset function service stop condition is detected in the main operating system.
  11. 根据权利要求10所述的装置,其特征在于,所述装置还包括:The device according to claim 10, wherein the device further comprises:
    销毁模块,用于在停止对应的服务器端软件的进程后,销毁所述上下文信息。The destruction module is configured to destroy the context information after stopping the process of the corresponding server software.
  12. 根据要求9或10所述的装置,其特征在于,预设的功能服务停止条件,包括如下任意一条:The device according to claim 9 or 10, characterized in that the preset function service stop condition comprises any one of the following:
    条件一:在主操作系统中监测到所述客户端虚拟机处于停止运行状态;Condition 1: monitoring, in the main operating system, that the client virtual machine is in a stopped state;
    条件二:在主操作系统中,监测到客户端操作系统处于休眠状态;Condition 2: In the main operating system, it is monitored that the client operating system is in a sleep state;
    条件三:在主操作系统中,检测到客户端虚拟机发送的功能服务停止申请;此时,所述装置还包括:Condition 3: In the main operating system, detecting that the function service sent by the client virtual machine stops the application; at this time, the device further includes:
    发送模块,用于在客户端操作系统中,在监测到针对停止预设操作系统功能的请求时,通过客户端虚拟机向主虚拟机发送相应的功能服务停止申请。 The sending module is configured to send, by the client virtual machine, a corresponding function service stop request to the primary virtual machine when the request for stopping the preset operating system function is detected in the client operating system.
PCT/CN2016/108985 2016-12-08 2016-12-08 Method for implementing function service of virtual machine, apparatus, electronic device and computer program product WO2018103031A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201680002749.7A CN107438834B (en) 2016-12-08 2016-12-08 Method and device for realizing virtual machine function service, electronic equipment and computer program product
PCT/CN2016/108985 WO2018103031A1 (en) 2016-12-08 2016-12-08 Method for implementing function service of virtual machine, apparatus, electronic device and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/108985 WO2018103031A1 (en) 2016-12-08 2016-12-08 Method for implementing function service of virtual machine, apparatus, electronic device and computer program product

Publications (1)

Publication Number Publication Date
WO2018103031A1 true WO2018103031A1 (en) 2018-06-14

Family

ID=60458682

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/108985 WO2018103031A1 (en) 2016-12-08 2016-12-08 Method for implementing function service of virtual machine, apparatus, electronic device and computer program product

Country Status (2)

Country Link
CN (1) CN107438834B (en)
WO (1) WO2018103031A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108124475B (en) * 2017-12-29 2022-05-20 达闼机器人股份有限公司 Virtual system Bluetooth communication method and device, virtual system, storage medium and electronic equipment
JP6813010B2 (en) * 2018-08-31 2021-01-13 横河電機株式会社 Availability systems, methods, and programs

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593136A (en) * 2008-05-30 2009-12-02 国际商业机器公司 Make computing machine have the method and the computer system of high availability
CN101667144A (en) * 2009-09-29 2010-03-10 北京航空航天大学 Virtual machine communication method based on shared memory
CN101937357A (en) * 2009-07-01 2011-01-05 华为技术有限公司 Virtual machine migration decision-making method, device and system
CN103593246A (en) * 2012-08-15 2014-02-19 中国电信股份有限公司 Communication method between virtual machine and host machine, host machine and virtual machine system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7272831B2 (en) * 2001-03-30 2007-09-18 Intel Corporation Method and apparatus for constructing host processor soft devices independent of the host processor operating system
US8239655B2 (en) * 2010-01-18 2012-08-07 Vmware, Inc. Virtual target addressing during direct data access via VF of IO storage adapter
US8489699B2 (en) * 2010-08-13 2013-07-16 Vmware, Inc. Live migration of virtual machine during direct access to storage over SR IOV adapter
US9542715B2 (en) * 2012-05-02 2017-01-10 Nvidia Corporation Memory space mapping techniques for server based graphics processing
CN103389884A (en) * 2013-07-29 2013-11-13 华为技术有限公司 Method for processing input/output request, host, server and virtual machine
CN103501290B (en) * 2013-09-18 2017-10-24 万达信息股份有限公司 A kind of highly reliable service system construction method based on dynamic backup virtual machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593136A (en) * 2008-05-30 2009-12-02 国际商业机器公司 Make computing machine have the method and the computer system of high availability
CN101937357A (en) * 2009-07-01 2011-01-05 华为技术有限公司 Virtual machine migration decision-making method, device and system
CN101667144A (en) * 2009-09-29 2010-03-10 北京航空航天大学 Virtual machine communication method based on shared memory
CN103593246A (en) * 2012-08-15 2014-02-19 中国电信股份有限公司 Communication method between virtual machine and host machine, host machine and virtual machine system

Also Published As

Publication number Publication date
CN107438834B (en) 2021-10-12
CN107438834A (en) 2017-12-05

Similar Documents

Publication Publication Date Title
US10162661B2 (en) Interdependent virtual machine management
EP3343364B1 (en) Accelerator virtualization method and apparatus, and centralized resource manager
CN105243321B (en) A kind of cipher machine, realization and working method based on container virtualization technology
EP3637771A1 (en) Cloud desktop system, and image sequence compression and encoding method, and medium therefor
US8566847B2 (en) Out-of-band host management via a management controller
CN109218356B (en) Method and apparatus for managing stateful applications on a server
WO2015149625A1 (en) Method and system for network element access with multi-instance parallelism
US10291730B1 (en) Throttling push notifications using predictive workload modeling
WO2018103031A1 (en) Method for implementing function service of virtual machine, apparatus, electronic device and computer program product
CN110659104B (en) Service monitoring method and related equipment
WO2019000790A1 (en) Method and device for calling remote procedure using synchronous mode
WO2017045437A1 (en) Block storage service method and apparatus
US10193744B1 (en) Mass restoration of enterprise business services following service disruption
US20230185901A1 (en) Data processing method, host, and apparatus
US10789129B1 (en) Rolling restoration of enterprise business services following service disruption
WO2017000589A1 (en) Flexible capacity expansion method, apparatus and system
CN111831402A (en) Method, apparatus and computer program product for managing software functions
CN113935018A (en) Password operation method, system on chip and computer equipment
CN110691002B (en) Interrupt detection method and device
CN110022310B (en) Authorization method and device based on cloud computing open network operating system
MX2021009162A (en) Increasing processing capacity of partitions for an abnormal event.
JP7470879B2 (en) Remote Certificate Authority Management
JP6010672B2 (en) Security setting system, security setting method and program
CN115883200B (en) Log security management method, device, platform and medium
US11722552B2 (en) Accessing files from virtual desktops and applications during interruptions to connectivity

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: 16923626

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14.10.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16923626

Country of ref document: EP

Kind code of ref document: A1