WO2019174010A1 - 硬件控制方法、装置、电子设备及计算机可读介质 - Google Patents

硬件控制方法、装置、电子设备及计算机可读介质 Download PDF

Info

Publication number
WO2019174010A1
WO2019174010A1 PCT/CN2018/079190 CN2018079190W WO2019174010A1 WO 2019174010 A1 WO2019174010 A1 WO 2019174010A1 CN 2018079190 W CN2018079190 W CN 2018079190W WO 2019174010 A1 WO2019174010 A1 WO 2019174010A1
Authority
WO
WIPO (PCT)
Prior art keywords
hardware
operating system
program
operation instruction
setting data
Prior art date
Application number
PCT/CN2018/079190
Other languages
English (en)
French (fr)
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 PCT/CN2018/079190 priority Critical patent/WO2019174010A1/zh
Priority to CN201880001129.0A priority patent/CN109074275A/zh
Publication of WO2019174010A1 publication Critical patent/WO2019174010A1/zh

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
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/4401Bootstrapping
    • G06F9/4405Initialisation of multiprocessor systems
    • 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/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • the present disclosure relates to the field of computer information processing, and in particular to a hardware control method, apparatus, electronic device, and computer readable medium.
  • multiple operating systems or virtual machines can run on the electronic device at the same time, and multiple operating systems or virtual machines share the processor, memory, and input and output devices provided by the hardware device.
  • Multiple operating systems collectively implement their respective system functions based on the same set of hardware.
  • users may have different hardware settings for different operating systems. For example, for mobile mobile terminals used by users, in some systems, users use Bluetooth headsets to answer incoming calls, and in some systems, Bluetooth functionality may need to be disabled.
  • the effect achieved by the above problems is not satisfactory.
  • the user sets to answer the call through the Bluetooth
  • the headset is used to answer the call.
  • the guest operating system is running in the foreground, if other users make calls through the user's main system, in this case, hardware control confusion often occurs, which may exist in a system that should not use Bluetooth.
  • the Bluetooth device is activated.
  • the present disclosure provides a hardware control method, apparatus, electronic device, and computer readable medium capable of providing independent and accurate hardware settings for each operating system in a multi-operating system environment, thereby improving user experience.
  • a hardware control method which is applicable to a multi-operating system, the method comprising: receiving a hardware operation instruction, the hardware operation instruction including hardware setting data; determining that the hardware operation instruction belongs to An operating state of the operating system, the operating state includes the operating system being in a foreground running state or a background running state; and when the operating system to which the hardware operating instruction belongs is in a background running state, saving the hardware setting data in the context information.
  • a hardware control apparatus which is applicable to a multi-operating system, the apparatus comprising: a receiving module, configured to receive a hardware operation instruction, the hardware operation instruction includes hardware setting data; and a determining module, An operating state of the operating system to which the hardware operation instruction belongs, the operating state includes the operating system being in a foreground running state or a background running state; and the first storage module is configured to: when the operating system to which the hardware operation instruction belongs When the background is running, the hardware setting data is saved in the context information.
  • an electronic device comprising: one or more processors; a storage device configured to store one or more programs; when one or more programs are processed by one or more The processor is executed such that one or more processors implement the method as described above.
  • a computer readable medium having stored thereon a computer program that, when executed by a processor, implements a method as hereinbefore described.
  • independent and accurate hardware settings can be provided for each operating system in a multi-operating system environment, thereby improving the user experience.
  • FIG. 1 is a system architecture diagram of a hardware control method according to an exemplary embodiment.
  • FIG. 2 is a flowchart of a hardware control method according to an exemplary embodiment.
  • FIG. 3 is a schematic diagram of a background hardware service of a hardware control method according to an exemplary embodiment.
  • FIG. 4 is a flowchart of a hardware control method according to another exemplary embodiment.
  • FIG. 5 is a block diagram of a hardware control apparatus according to an exemplary embodiment.
  • FIG. 6 is a block diagram of a hardware control apparatus according to another exemplary embodiment.
  • FIG. 7 is a block diagram of an electronic device, according to an exemplary embodiment.
  • FIG. 8 schematically shows a schematic diagram of a computer readable storage medium in an exemplary embodiment of the present disclosure.
  • the implementation of the multi-system is to directly operate the main operating system in the virtual machine back-end program that performs hardware control in the virtual machine supporting the operation of the guest operating system.
  • Device node or device file When the guest operating system initiates a hardware controlled operation, the hardware control operation triggers the virtual device backend program operation in the virtual machine to perform hardware control via the virtual device hardware abstraction layer, the virtual device hardware device node or the device file.
  • Device node or device file The main technology of the current technology is to use the "goldfish (channel technology)" virtual hardware platform for hardware virtualization.
  • the virtual hardware platform supports the virtual Android operating system supported by the QEMU virtual machine.
  • QEMU is a set of analog processors distributed under the GPL license. It is widely used on the GNU/Linux platform. QEMU can simulate speeds close to real computers.
  • the inventors of the present disclosure have found that the processing method of hardware control in multiple systems in the prior art has the following disadvantages: the first point is that the hardware control of the main operating system and the guest operating system is not isolated, and the two systems independently set the same hardware. The device, and it is not known that the settings it has made may be changed by another operating system, causing the final hardware control to be in a state of confusion; the second point is that although multiple guest operating systems are isolated, but multiple clients Setting the same hardware device independently in the operating system will also lead to the same result as the problem.
  • FIG. 1 is a system architecture diagram of a hardware control method according to an exemplary embodiment.
  • a main operating system at least one guest operating system, and a CPU, a memory, and an input/output device provided by the hardware device are shared among the plurality of operating systems.
  • the first operating system is the host operating system (host OS)
  • the second operating system is the guest operating system (guest OS).
  • guest OS guest operating system
  • the second or more operating systems are all guest operating systems (guest OS).
  • guest OS guest operating system
  • the virtual machine emulates the hardware device for its use.
  • the virtual machine is running as an application for the main operating system (host OS).
  • 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 system generates a completely new virtual image of the existing operating system. It has the same function as the real system. After entering the virtual system, all operations are performed in this new independent virtual system.
  • the software can be installed and saved independently. It has its own independent desktop, does not have any impact on the real system, and has a type of operating system that can flexibly switch between the existing system and the virtual image.
  • the difference between a virtual system and a traditional virtual machine is that the virtual system does not degrade the performance of the computer.
  • Starting the virtual system does not require as much time as starting the normal system, and the running program is more convenient and faster; the virtual system can only simulate the same as the existing operating system.
  • the environment, while the virtual machine can simulate other kinds of operating systems; and the virtual machine needs to emulate the underlying hardware instructions, so the application runs much slower than the virtual system.
  • the guest operating system runs on a hardware platform consisting of a virtual CPU managed by a virtual machine, a virtual clock, a virtual interrupt manager, and virtual peripherals.
  • a virtual CPU is the main unit of instruction execution and operation; a virtual processor is also called a virtual processor and refers to a physical central processing unit (CPU) assigned to a virtual machine.
  • CPU central processing unit
  • the virtual clock provides a clock source for the operating system to perform process scheduling and the like;
  • the virtual interrupt manager manages interrupt signals generated by various virtual peripherals and provided to the virtual CPU;
  • Virtual peripherals are various input and output device modules implemented by virtual machines.
  • the emulator software running on the main operating system controls the real CPU of the main operating system to start executing virtual machine instructions, and is switched from the main operating system to the guest operating system on the real CPU; and when switched by the guest operating system to After the main operating system, whether the guest operating system continues to execute, etc.
  • the virtual machine software also needs to operate and monitor the real input and output devices and associated files on the main operating system for use by the virtual peripherals of the virtual machine.
  • hardware abstraction layer software of the corresponding hardware may be implemented, for example, in the guest operating system.
  • the application in the guest operating system communicates with the hardware service program, and the hardware service program calls the hardware abstraction layer to implement the operation of the corresponding operating hardware by the guest operating system.
  • the hardware abstraction layer is the interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, provides a virtual hardware platform for the operating system, makes it hardware-independent, and can be ported on multiple platforms. From the perspective of hardware and software testing, the testing of hardware and software can be done based on the hardware abstraction layer, making parallel implementation of software and hardware testing work possible.
  • the software in the hardware abstraction layer transfers instructions for operating the hardware from the guest operating system to the host operating system through a mechanism for communication between the guest operating system and the host operating system.
  • a back-end program in the main operating system that can, for example, implement hardware operations, which is typically integrated into a virtual machine that supports the operation of the guest operating system.
  • the hardware-operated back-end program communicates hardware operation instructions sent from the guest operating system and communicates with corresponding hardware service programs in the host operating system.
  • the hardware service program in the main operating system receives the hardware operation instruction sent by the backend program, and operates the real hardware device through the hardware abstraction layer in the main operating system.
  • the multi-operating system using the method of the present disclosure is used.
  • the guest operating system performs hardware control
  • the hardware control operation initiated by the guest operating system can be set to the real hardware.
  • the main operating system performs hardware control
  • the main operating system can perform comprehensive control operations on the hardware device. If the main operating system is in the background at this time, the hardware control operation initiated by the main operating system cannot be set to the real hardware device.
  • guest OS when there are more than two operating systems in the electronic device, if a guest operating system (guest OS) is restarted due to an abnormality, the host operating system (host OS) and other guest operating systems (guest) OS) still works normally and is not affected. Conversely, when the host operating system (host OS) restarts due to an exception, all guest operating systems (guest OS) will be restarted.
  • FIG. 2 is a flowchart of a hardware control method according to an exemplary embodiment.
  • the hardware control method is applicable to the hardware control method system framework described in the foregoing embodiments, and includes at least steps S202 to S206, which are described in detail as follows:
  • a hardware operation instruction is received, the hardware operation instruction including hardware setting data.
  • the hardware operation instructions are received by a hardware service program located in a hardware service layer of an operating system.
  • receiving hardware operation instructions includes: the main operating system receiving the hardware operation instructions from an application on the main operating system.
  • receiving hardware operation instructions includes: the hardware service program in the host operating system receiving the hardware operation instructions from the guest operating system.
  • the hardware operation instruction is sent through a backend program of the guest operating system.
  • determining an operating state of an operating system to which the hardware operation instruction belongs where the operating state includes the operating system being in a foreground running state or a background running state.
  • the hardware setting data is saved in the context information.
  • the context information corresponding to the hardware setting data may be retained in a hardware service program of the host operating system.
  • the context information is the previous and next state associated with the current operation. In many cases, a lot of preparation work is required to perform an operation, and the state that must be satisfied before this operation is the above information of the current operation. Thus, the state to be reached after the current operation is the following information of the current operation.
  • the context information may include, for example, a virtual machine identifier, a state of a guest operating system supported by the virtual machine, and an existing hardware operation instruction.
  • FIG. 3 is a schematic diagram of a hardware service of a hardware control method according to an exemplary embodiment.
  • FIG. 3 exemplarily illustrates a maintenance framework for hardware service pairs with context information of a host operating system and a guest operating system.
  • a hardware service program in the main operating system that receives hardware operation instructions sent by a backend program of the guest operating system hardware service program.
  • the hardware service program After the hardware service program establishes a connection with the backend program, the hardware service program maintains a set of context information for each backend program that establishes a connection with it.
  • the context information stores the virtual machine ID of the backend program service, the virtual machine supports the front and back running state of the running guest operating system, and the latest hardware operation instruction received by the hardware service program from the backend program.
  • the hardware control method of the present disclosure in a multi-operating system environment, by running a guest operating system on a virtual machine and storing context information of hardware settings corresponding to different operating systems in a hardware service program of the main operating system, Provide independent and accurate hardware settings for each operating system to enhance the user experience.
  • FIG. 4 is a flowchart of a hardware control method according to another exemplary embodiment.
  • the hardware control method is applicable to the hardware control method system framework described in the foregoing embodiments, and includes at least steps S402 to S410, which are described in detail as follows:
  • a hardware operation instruction is received, the hardware operation instruction including hardware setting data.
  • the hardware operation instructions are received by a hardware service program located in a hardware service layer of an operating system.
  • receiving hardware operation instructions includes: the main operating system receiving the hardware operation instructions from an application on the main operating system.
  • receiving hardware operation instructions includes: the hardware service program in the host operating system receiving the hardware operation instructions from the guest operating system.
  • the hardware operation instruction is sent through a backend program of the guest operating system.
  • an operating state of an operating system to which the hardware operation instruction belongs is determined, and the state includes a foreground running state and a background running state.
  • the existing hardware configuration parameters in the electronic device are cleared.
  • the hardware configuration parameters are used to indicate the basic hardware configuration of the load balancing product, such as parameters such as CPU, memory, and hard disk.
  • hardware parameters in the electronic device are set by the hardware setting data.
  • the display resolution of the electronic device, the open and closed state of the hardware-related device, and the like can be configured, and the present application is not limited thereto.
  • the hardware setting data is saved in the context information.
  • the context information corresponding to the hardware setting data may be retained in a hardware service program of the main operating system.
  • the hardware control method of the present disclosure by determining the operating state of the operating system corresponding to the hardware instruction, the operating system is distinguished from the running in the background, and the corresponding setting processing is performed on the hardware setting operation. In the multi-operating system environment, it can avoid different settings of the hardware of each operating system, and the hardware setting confusion caused by the actual use process.
  • the hardware service program in the main operating system after receiving the hardware operation instruction sent from the backend program, determines the status of the current guest operating system. If the guest operating system is in the foreground state, first clear the settings on the hardware control, ie reset the hardware; then set the new hardware control instructions to the hardware; finally save the new hardware control instructions to the backend The context of the program. If the guest operating system is in the background state, the new hardware control instructions are directly saved to the context corresponding to the backend program, and the operation is completed. When the guest operating system switches from the background running state to the foreground running state, the hardware service program updates the front background running state saved in the context corresponding to the guest operating system, and sets the latest hardware operation instruction saved in the context to the hardware.
  • a hardware service program in the host operating system that can receive hardware control settings that other applications require to perform, which also maintains a set of hardware-set contexts for the primary operating system.
  • the context saves the status of the front and back of the main operating system and the latest hardware operation instructions.
  • the process of performing hardware control is as follows: when the main operating system is in the foreground, first clear the setting on the hardware control, that is, reset the hardware; then set the new hardware control instruction to the hardware; finally save the new hardware control instruction to In the context.
  • the new hardware control instructions are directly saved to the context of the main operating system to complete the operation.
  • the hardware service program updates the pre-background running state saved in the context of the main operating system, and sets the latest hardware operation instruction saved in the context to the hardware.
  • the hardware service program in the main operating system clears the context corresponding to the guest operating system when the guest operating system running on the device is shut down. When the guest operating system is restarted, create a new set of contexts corresponding to it.
  • the program may be stored in a computer readable storage medium, which may be a read only memory, a magnetic disk or an optical disk, or the like.
  • FIG. 5 is a block diagram of a hardware control apparatus according to an exemplary embodiment. As shown in FIG. 5, the hardware control device 50 includes a receiving module 502, a determining module 504, and a first storage module 506.
  • the receiving module 502 is configured to receive a hardware operation instruction, where the hardware operation instruction includes hardware setting data.
  • the receiving module 502 is further configured to receive the hardware operation instruction by using a hardware service program, where the hardware service program is located in the main system.
  • the operating system includes a host operating system and at least one guest operating system on which the virtual machine program runs, the at least one guest operating system operating on the virtual machine program.
  • the receiving module 502 is configured to receive, by the main operating system, the hardware operation instruction from an application on the main operating system.
  • the receiving module 502 is configured to receive, by the guest operating system, the hardware operation instruction by using a hardware service program in the main operating system.
  • the hardware operation instruction is sent through a backend program of the guest operating system.
  • the determining module 504 is configured to determine an operating state of an operating system to which the hardware operation instruction belongs, and the running state includes a foreground running state and a background running state. Without loss of generality, in the normal operation state of an electronic system with multiple operating systems, only one operating system can be in the foreground running state at the same time, and other operating systems are in the background running state.
  • the first storage module 506 is configured to save the hardware setting data in the context information when the operating system to which the hardware operation instruction belongs is in a background running state.
  • the first storage module 506 is configured to retain context information corresponding to the hardware setting data in a hardware service program of the host operating system.
  • the context information is the previous and next state associated with the current operation. In many cases, a lot of preparation work is required to perform an operation, and the state that must be satisfied before this operation is the above information of the current operation. Thus, the state to be reached after the current operation is the following information of the current operation.
  • the context information may include, for example, a virtual machine identifier, an operating state of a guest operating system supported by the virtual machine, and an existing hardware operation instruction.
  • the hardware control apparatus of the present disclosure in a multi-operating system environment, by running a guest operating system on a virtual machine and storing context information of hardware settings corresponding to different operating systems in a hardware service program of the main operating system, Provide independent and accurate hardware settings for each operating system to enhance the user experience.
  • FIG. 6 is a block diagram of a hardware control apparatus according to another exemplary embodiment.
  • the hardware control device 60 further includes a clearing module 602, a setting module 604, and a second storage module 606, in addition to the receiving module 502, the determining module 504, and the first storage module 506 shown in FIG.
  • the clearing module 602 is configured to: when the operating system to which the hardware operation instruction belongs is in a foreground running state, clear the existing hardware parameters in the electronic device; the hardware configuration parameter is used to indicate a hardware basic configuration of the load balancing product, such as a CPU, a memory, and Indicators for parameters such as hard disks.
  • the setting module 604 is configured to set the hardware parameters in the electronic device by using the hardware setting data; for example, the display resolution of the electronic device, the open and closed state of the hardware-related device, and the like can be configured, and the present application is not limited thereto.
  • the second storage module 606 is configured to save the hardware setting data in the context information.
  • the context information corresponding to the hardware setting data may be retained in a hardware service program of the main operating system.
  • the hardware control apparatus of the present disclosure by determining the operating state of the operating system corresponding to the hardware instruction, the operating system is distinguished from the running in the background by the operating system, and the corresponding setting processing of the hardware setting operation is performed. In the multi-operating system environment, it can avoid different settings of the hardware of each operating system, and the hardware setting confusion caused by the actual use process.
  • FIG. 7 is a block diagram of an electronic device, according to an exemplary embodiment.
  • FIG. 7 An electronic device 200 according to such an embodiment of the present disclosure is described below with reference to FIG.
  • the electronic device 200 shown in Fig. 7 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • electronic device 200 is embodied in the form of a general purpose computing device.
  • the components of the electronic device 200 may include, but are not limited to, at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, and the like.
  • the storage unit stores a program code
  • the program code may be executed by the processing unit 210, such that the processing unit 210 performs various exemplary embodiments according to the present disclosure described in the electronic recipe flow processing method section of the present specification described above.
  • the processing unit 210 can perform the steps as shown in FIG. 3 or 6.
  • the storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 2201 and/or a cache storage unit 2202, and may further include a read only storage unit (ROM) 2203.
  • RAM random access storage unit
  • ROM read only storage unit
  • the storage unit 220 may also include a program/utility 2204 having a set (at least one) of the program modules 2205, including but not limited to: an operating system, one or more applications, other program modules, and programs. Data, each of these examples or some combination may include an implementation of a network environment.
  • Bus 230 may be representative of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any of a variety of bus structures. bus.
  • the electronic device 200 can also communicate with one or more external devices 300 (eg, a keyboard, pointing device, Bluetooth device, etc.), and can also communicate with one or more devices that enable the user to interact with the electronic device 200, and/or with Any device (eg, router, modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. This communication can take place via an input/output (I/O) interface 250.
  • electronic device 200 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) via network adapter 260.
  • Network adapter 260 can communicate with other modules of electronic device 200 via bus 230.
  • the example embodiments described herein may be implemented by software or by software in combination with necessary hardware. Therefore, the technical solution according to an embodiment of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network.
  • a non-volatile storage medium which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a number of instructions are included to cause a computing device (which may be a personal computer, server, or network device, etc.) to perform the above-described processing methods in accordance with embodiments of the present disclosure.
  • FIG. 8 schematically shows a schematic diagram of a computer readable storage medium in an exemplary embodiment of the present disclosure.
  • a program product 800 configured to implement the above method, which may employ a portable compact disk read only memory (CD-ROM) and includes program code, and may be in a terminal device, is illustrated in accordance with an embodiment of the present disclosure.
  • CD-ROM portable compact disk read only memory
  • the program product of the present disclosure is not limited thereto, and in this document, the readable storage medium may be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
  • the computer readable medium carries one or more programs that, when executed by one of the devices, cause the computer readable medium to perform functions of receiving hardware operation instructions, the hardware operation instructions including hardware settings Data; determining an operating state of an operating system to which the hardware operation instruction belongs, the operating state including a foreground running state and a background running state; and saving the context information when the operating system to which the hardware operation instruction belongs is in a background running state
  • the hardware sets the data. Clearing an existing hardware configuration parameter in the electronic device when the operating system to which the hardware operation instruction belongs is in a foreground running state; setting hardware parameters in the electronic device by using the hardware setting data; and saving the location information in the context information The hardware setting data.

Landscapes

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

Abstract

本公开涉及一种硬件控制方法、装置、电子设备及计算机可读介质,可应用于多操作系统中,该方法包括:接收硬件操作指令,所述硬件操作指令包括硬件设置数据;判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括操作系统处于前台运行状态或后台运行状态;当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。本公开的硬件控制方法、装置、电子设备及计算机可读介质,能够在多操作系统环境中,为每一个操作系统提供独立准确的硬件设置,提升用户使用体验。

Description

硬件控制方法、装置、电子设备及计算机可读介质 技术领域
本公开涉及计算机信息处理领域,具体而言,涉及一种硬件控制方法、装置、电子设备及计算机可读介质。
背景技术
基于虚拟化技术多个操作系统或者虚拟机可以同时运行在电子设备上,多个操作系统或者虚拟机共享硬件设备提供的处理器、内存和输入输出设备。多个操作系统共同基于同样的一组硬件进行各自的系统功能实现。但是在实际的操作中,用户对于不同的操作系统可能会有不同的硬件设置,比如对于用户使用的移动手机终端而言,在有些系统中,用户使用蓝牙耳机接听来电,而在有些系统中,蓝牙功能可能需要被禁用。
而在现有技术中,对上述问题实现的效果并不尽如人意,比如如上文所述的情况下,在主系统中,用户设置通过蓝牙接听电话,而在客户系统中,使用耳机接听电话,当客户操作系统在前台运行过程中,如果有其他用户通过该用户的主系统进行来电,这种情况下,经常会出现硬件控制混淆的情况,可能会存在,在不应该使用蓝牙的系统中,蓝牙装置被激活。
因此,需要一种新的硬件控制方法、装置、电子设备及计算机可读介质。
在所述背景技术部分公开的上述信息仅用于加强对本公开的背景的理解,因此它可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
有鉴于此,本公开提供一种硬件控制方法、装置、电子设备及计算机可读介质,能够在多操作系统环境中,为每一个操作系统提供独立准确的硬件设置,提升用户使用体验。
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。
根据本公开的第一方面,提出一种硬件控制方法,可应用于多操作系统中,该方法包括:接收硬件操作指令,所述硬件操作指令包括硬件设置数据;判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括操作系统处于前台运行状态或后台运行状态;当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。
根据本公开的第二方面,提出一种硬件控制装置,可应用于多操作系统中,该装置包括:接收模块,用于接收硬件操作指令,所述硬件操作指令包括硬件设置数据;判断模块,用于判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括操作系统处于前台运行状态或后台运行状态;第一储存模块,用于当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。
根据本公开的第三方面,提出一种电子设备,该电子设备包括:一个或多个处理器;存储装置,设置为存储一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如上文的方法。
根据本公开的第四方面,提出一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如上文中的方法。
根据本公开的硬件控制方法、装置、电子设备及计算机可读介质,能够在多操作系统环境中,为每一个操作系统提供独立准确的硬件设置,提升用户使用体验。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。
附图说明
图1是根据一示例性实施例示出的一种硬件控制方法的系统架构图。
图2是根据一示例性实施例示出的一种硬件控制方法的流程图。
图3是根据一示例性实施例示出的一种硬件控制方法的后台硬件服务示意图。
图4是根据另一示例性实施例示出的一种硬件控制方法的流程图。
图5是根据一示例性实施例示出的一种硬件控制装置的框图。
图6是根据另一示例性实施例示出的一种硬件控制装置的框图。
图7是根据一示例性实施例示出的一种电子设备的框图。
图8示意性示出本公开示例性实施例中一种计算机可读存储介质示意图。
具体实施方式
现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的实施例;相反,提供这些实施例使得本公开将全面和完整,并将示例实施例的构思全面地传达给本领域的技术人员。在图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。 在下面的描述中,提供许多具体细节从而给出对本发明的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本公开的各方面。
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。
本领域技术人员可以理解,附图只是示例实施例的示意图,附图中的模块或流程并不一定是实施本公开所必须的,因此不能用于限制本公开的保护范围。
本公开的发明人发现,现行技术的中,对多系统的实现方式是在支持客户操作系统运行的虚拟机中,在进行硬件控制的虚拟设备后端程序中直接操作主操作系统中进行硬件控制的设备节点或者设备文件。当客户操作系统发起硬件控制的操作时,硬件控制操作经由虚拟设备硬件抽象层,虚拟设备硬件的设备节点或者设备文件,触发虚拟机中的虚拟设备后端程序操作主操作系统中进行硬件控制的设备节点或者设备文件。现行的技术主要采取的手段是,采用“goldfish(通道技术)”虚拟硬件平台进行硬件虚拟化,该虚拟硬件平台支持在QEMU虚拟机支持下虚拟安卓操作系统。QEMU是一套以GPL许可证分发源码的模拟处理器,在GNU/Linux平台上使用广泛,QEMU能模拟至接近真实电脑的速度。
本公开的发明人发现,现行技术中对多系统中硬件控制的处理方式存在如下缺点:第一点是主操作系统与客户操作系统的硬件控制没有进行隔离,两个系统独立的设置相同的硬件设备,并且并不知晓其已经进行的设置可能会被另外一个操作系统更改,造成最终的硬件控制陷入混乱的状态;第二点是多个客户操作系统之间虽然进行了隔离,但是多个客户操作系统在独立的设置相同的硬件设备,也会导致与问题一一样的结果。
为了解决上文中出现的技术问题,本公开的发明人提出了硬件控制方法,该方法可适用于具有多操作系统的电子设备。图1是根据一示例性实施例示出的一种硬件控制方法的系统架构图。
如图1所示,在电子设备中可例如运行有一个主操作系统,至少一个客户操作系统,多个操作系统之间共享硬件设备提供的CPU,内存和输入输出设备。可例如,进行如下 命名,第一个操作系统为主操作系统(host OS),第二个操作系统为客户操作系统(guest OS)。当存在2个以上的操作系统时,以此类推,第二个以上的操作系统皆为客户操作系统(guest OS)。客户操作系统(guest OS)运行时,虚拟机模拟了硬件设备供其使用。该虚拟机是作为主操作系统(host OS)的一个应用程序运行的。
虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。虚拟系统通过生成现有操作系统的全新虚拟镜像,它具有真实系统完全一样的功能,进入虚拟系统后,所有操作都是在这个全新的独立的虚拟系统里面进行,可以独立安装运行软件,保存数据,拥有自己的独立桌面,不会对真正的系统产生任何影响,而且具有能够在现有系统与虚拟镜像之间灵活切换的一类操作系统。
虚拟系统和传统的虚拟机不同在于:虚拟系统不会降低电脑的性能,启动虚拟系统不需要像启动正常系统那样耗费时间,运行程序更加方便快捷;虚拟系统只能模拟和现有操作系统相同的环境,而虚拟机则可以模拟出其他种类的操作系统;而且虚拟机需要模拟底层的硬件指令,所以在应用程序运行速度上比虚拟系统慢得多。
在一个实施例中,客户操作系统运行在由虚拟机管理的虚拟CPU,虚拟时钟,虚拟中断管理器及虚拟外设构成的硬件平台上。
虚拟CPU是指令执行和运算的主要单元;虚拟处理器也被称为虚拟处理机,是指分配给虚拟机的物理的中央处理单元(CPU)。
虚拟时钟提供操作系统进行进程调度等操作的时钟源;
虚拟中断管理器管理各种虚拟外设生成的提供给虚拟CPU的中断信号;
虚拟外设是虚拟机实现的各种输入输出设备模块。
主操作系统上运行的虚拟机(emulator)软件,控制主操作系统的真实CPU开始执行虚拟机指令,及在真实的CPU上由主操作系统切换至客户操作系统;以及当由客户操作系统切换至主操作系统之后,客户操作系统是否继续执行等。虚拟机软件还需要操作和监控主操作系统上真实的输入输出设备和相关的文件,以供虚拟机的虚拟外设使用。
基于如图1所示的系统架构,在一个实施例中,客户操作系统中可例如实现相应硬件的硬件抽象层软件。客户操作系统中的应用程序,与硬件服务程序通信,硬件服务程序调用硬件抽象层,从而实现客户操作系统对相应硬件的操作。
硬件抽象层是位于操作系统内核与硬件电路之间的接口层,其目的在于将硬件抽象化。它隐藏了特定平台的硬件接口细节,为操作系统提供虚拟硬件平台,使其具有硬件无关性,可在多种平台上进行移植。从软硬件测试的角度来看,软硬件的测试工作都可分别 基于硬件抽象层来完成,使得软硬件测试工作的并行进行成为可能。
硬件抽象层中的软件通过客户操作系统与主操作系统之间通信的机制,将操作硬件的指令从客户操作系统传递到主操作系统。主操作系统中可例如实现硬件操作的后端程序,该程序一般集成在支持客户操作系统运行的虚拟机中。
硬件操作的后端程序相应从客户操作系统发送来的硬件操作指令,并与主操作系统系统中的相应硬件服务程序通信。主操作系统中的硬件服务程序接收到后端程序发送的硬件操作指令,通过主操作系统中的硬件抽象层,对真实的硬件设备进行操作。
基于以上的系统架构,使得使用本公开中方法的多操作系统,当客户操作系统进行硬件控制时,如果此时客户操作系统在前台,则客户操作系统发起的硬件控制操作能够设置到真实的硬件设备上。如果此时客户操作系统在后台,则客户操作系统发起的硬件控制操作不能够设置到真实的硬件设备上。当主操作系统进行硬件控制时,如果此时主操作系统在前台,则主操作系统能够在硬件设备上进行全面的控制操作。如果此时主操作系统在后台,则主操作系统发起的硬件控制操作不能够设置到真实的硬件设备上。
在一个实施例中,当电子设备中存在2个以上的操作系统时,如果某一个客户操作系统(guest OS)因为异常重新启动时,主操作系统(host OS)和其他的客户操作系统(guest OS)依然可以正常运行,不受影响。反之,当主操作系统(host OS)因为异常重新启动时,所有的客户操作系统(guest OS)都会随之重新启动。
图2是根据一示例性实施例示出的一种硬件控制方法的流程图。该硬件控制方法的适用于前述实施例中所述的硬件控制方法系统框架,并至少包括步骤S202至步骤S206,详细介绍如下:
如图2所示,在S202中,接收硬件操作指令,所述硬件操作指令包括硬件设置数据。
在一个实施例中,通过硬件服务程序接收所述硬件操作指令,所述硬件服务程序位于操作系统的硬件服务层中。
在一个实施例中,当所述操作系统为主操作系统时,接收硬件操作指令包括:主操作系统接收来自于主操作系统上应用程序的所述硬件操作指令。
在一个实施例中,当所述操作系统为客户操作系统时,接收硬件操作指令包括:主操作系统中的硬件服务程序接收来自客户操作系统的所述硬件操作指令。其中,所述硬件操作指令通过所述客户操作系统的后端程序发出。
在S204中,判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括操作系统处于前台运行状态或后台运行状态。不失一般性,在具有多个操作系统的电子系 统的正常运行状态下,在同一时刻,只能有一个操作系统位于前台运行状态,其他的操作系统位于后台运行状态中。
在S206中,当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。可例如,在主操作系统的硬件服务程序中保留所述硬件设置数据对应的上下文信息(Context)。上下文信息是与当前操作相关的前一步状态和下一步状态。在很多情况下,要执行某一操作,需要做很多的准备工作,而这一操作前必须满足的状态,就是当前操作的上文信息。由此及彼,当前操作之后要达到的状态就是当前操作的下文信息。其中,在本实施例中,所述上下文信息可例如包括:虚拟机标识、虚拟机支持的客户操作系统的状态、已有的硬件操作指令。
图3是根据一示例性实施例示出的一种硬件控制方法的硬件服务示意图。图3示例性的说明了硬件服务对与主操作系统与客户操作系统的上下文信息的维护框架。主操作系统中的硬件服务程序,其接收客户操作系统硬件服务程序的后端程序发送的硬件操作指令。当硬件服务程序与后端程序建立连接之后,硬件服务程序针对每个与它建立连接的后端程序维护一套上下文信息。该上下文信息中保存有后端程序服务的虚拟机ID,虚拟机支持运行的客户操作系统的前后台运行状态,以及硬件服务程序从后端程序接收到的最近一条硬件操作指令等信息。
根据本公开的硬件控制方法,通过在虚拟机上运行客户操作系统,且在主操作系统的硬件服务程序中保存不同操作系统对应的硬件设置的上下文信息的方式,能够在多操作系统环境中,为每一个操作系统提供独立准确的硬件设置,提升用户使用体验。
应清楚地理解,本公开描述了如何形成和使用特定示例,但本公开的原理不限于这些示例的任何细节。相反,基于本公开公开的内容的教导,这些原理能够应用于许多其它实施例。
图4是根据另一示例性实施例示出的一种硬件控制方法的流程图。该硬件控制方法的适用于前述实施例中所述的硬件控制方法系统框架,并至少包括步骤S402至步骤S410,详细介绍如下:
如图4所示,在S402中,接收硬件操作指令,所述硬件操作指令包括硬件设置数据。
在一个实施例中,通过硬件服务程序接收所述硬件操作指令,所述硬件服务程序位于操作系统的硬件服务层中。
在一个实施例中,当所述操作系统为主操作系统时,接收硬件操作指令包括:主操作系统接收来自于主操作系统上应用程序的所述硬件操作指令。
在一个实施例中,当所述操作系统为客户操作系统时,接收硬件操作指令包括:主操作系统中的硬件服务程序接收来自客户操作系统的所述硬件操作指令。其中,所述硬件操作指令通过所述客户操作系统的后端程序发出。
在S404中,判断所述硬件操作指令所属的操作系统的运行状态,所述状态包括前台运行状态与后台运行状态。不失一般性,在具有多个操作系统的电子系统的正常运行状态下,在同一时刻,只能有一个操作系统位于前台运行状态,其他的操作系统位于后台运行状态中。
在S406中,当所述硬件操作指令所属的操作系统处于前台运行状态时,清除电子设备中已有的硬件配置参数。硬件配置参数用来表示负载均衡产品的硬件基本配置,如CPU、内存、硬盘等参数的指标。
在S408中,通过所述硬件设置数据设置所述电子设备中的硬件参数。可例如配置电子设备的显示分辨率,硬件相关设备的开启与闭合状态等等,本申请不以此为限。
在S410中,在上下文信息中保存所述硬件设置数据。可例如,在主操作系统的硬件服务程序中保留所述所述硬件设置数据对应的上下文信息(Context)。
根据本公开的硬件控制方法,通过判断硬件指令对应的操作系统的运行状态的方式,将操作系统在前台运行与在后台运行不同的情况进行区分,对硬件的设置操作进行对应的区别处理的方式,能够在多操作系统环境中,避免各个操作系统对硬件进行的不同设置,而给实际使用过程中带来的硬件设置混乱问题。
在一个实施例中,主操作系统中的硬件服务程序,其接收到从后端程序发送的硬件操作指令后,判断当前客户操作系统前后台的状态。如果客户操作系统当时处在前台的状态,则首先清除硬件控制上的设置,即复位该硬件;然后将新的硬件控制指令设置到该硬件上;最后将新的硬件控制指令保存到该后端程序对应的上下文中。如果客户操作系统当时处在后台的状态,则直接将新的硬件控制指令保存到该后端程序对应的上下文中,完成本次操作。当客户操作系统从后台运行状态切换到前台运行状态时,硬件服务程序更新客户操作系统对应的上下文中保存的前后台运行状态,并且将上下文中保存的最近一次硬件操作指令设置到该硬件上。
在一个实施例中,主操作系统中的硬件服务程序,其可以接收到其他应用程序要求其进行的硬件控制设置,其为主操作系统也维护一套硬件设置的上下文。上下文中保存主操作系统前后台的状态与最近一条硬件操作指令等信息。其执行硬件控制的过程如下:当主操作系统在前台时,首先清除硬件控制上的设置,即复位该硬件;然后将新的硬件控制指 令设置到该硬件上;最后将新的硬件控制指令保存到上下文中。当主操作系统在后台时,则直接将新的硬件控制指令保存到主操作系统的上下文中,完成本次操作。当主操作系统从后台运行状态切换到前台运行状态时,硬件服务程序更新主操作系统的上下文中保存的前后台运行状态,并且将上下文中保存的最近一次硬件操作指令设置到该硬件上。
在一个实施例中,主操作系统中的硬件服务程序,当器上运行的客户操作系统关闭后,清除与客户操作系统对应的上下文。当客户操作系统重新启动后,新建一套与其对应的上下文。
本领域技术人员可以理解实现上述实施例的全部或部分步骤被实现为由CPU执行的计算机程序。在该计算机程序被CPU执行时,执行本公开提供的上述方法所限定的上述功能。所述的程序可以存储于一种计算机可读存储介质中,该存储介质可以是只读存储器,磁盘或光盘等。
此外,需要注意的是,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。
图5是根据一示例性实施例示出的一种硬件控制装置的框图。如图5所示,硬件控制装置50包括:接收模块502,判断模块504,第一储存模块506。
其中,接收模块502用于接收硬件操作指令,所述硬件操作指令包括硬件设置数据。其中,接收模块502还用于通过硬件服务程序接收所述硬件操作指令,所述硬件服务程序位于主系统中。
在一个实施例中,所述操作系统包括主操作系统与至少一个客户操作系统,所述主系统上运行虚拟机程序,所述至少一个客户操作系统在所述虚拟机程序上运作。
在一个实施例中,当所述操作系统为主操作系统时,所述接收模块502用于通过主操作系统接收来自于主操作系统上应用程序的所述硬件操作指令。
在一个实施例中,当所述操作系统为客户操作系统时,所述接收模块502用于客户操作系统通过主操作系统中的硬件服务程序接收所述硬件操作指令。其中,所述硬件操作指令通过所述客户操作系统的后端程序发出。
判断模块504用于判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态 包括前台运行状态与后台运行状态。不失一般性,在具有多个操作系统的电子系统的正常运行状态下,在同一时刻,只能有一个操作系统位于前台运行状态,其他的操作系统位于后台运行状态中。
第一储存模块506用于当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。
在一个实施例中,第一储存模块506被设置为在主操作系统的硬件服务程序中保留所述所述硬件设置数据对应的上下文信息。上下文信息是与当前操作相关的前一步状态和下一步状态。在很多情况下,要执行某一操作,需要做很多的准备工作,而这一操作前必须满足的状态,就是当前操作的上文信息。由此及彼,当前操作之后要达到的状态就是当前操作的下文信息。其中,在本实施例中,所述上下文信息可例如包括:虚拟机标识、虚拟机支持的客户操作系统的运行状态、已有的硬件操作指令。
根据本公开的硬件控制装置,通过在虚拟机上运行客户操作系统,且在主操作系统的硬件服务程序中保存不同操作系统对应的硬件设置的上下文信息的方式,能够在多操作系统环境中,为每一个操作系统提供独立准确的硬件设置,提升用户使用体验。
图6是根据另一示例性实施例示出的一种硬件控制装置的框图。如图6所示,硬件控制装置60在包括图5所示的接收模块502,判断模块504,第一储存模块506之外,还包括:清除模块602,设置模块604,第二储存模块606。
清除模块602用于当所述硬件操作指令所属的操作系统处于前台运行状态时,清除电子设备中已有的硬件参数;硬件配置参数用来表示负载均衡产品的硬件基本配置,如CPU、内存、硬盘等参数的指标。
设置模块604用于通过所述硬件设置数据设置所述电子设备中的硬件参数;可例如配置电子设备的显示分辨率,硬件相关设备的开启与闭合状态等等,本申请不以此为限。
第二储存模块606用于在上下文信息中保存所述硬件设置数据。可例如,在主操作系统的硬件服务程序中保留所述所述硬件设置数据对应的上下文信息(Context)。
根据本公开的硬件控制装置,通过判断硬件指令对应的操作系统的运行状态的方式,将操作系统在前台运行与在后台运行不同的情况进行区分,对硬件的设置操作进行对应的区别处理的方式,能够在多操作系统环境中,避免各个操作系统对硬件进行的不同设置,而给实际使用过程中带来的硬件设置混乱问题。
图7是根据一示例性实施例示出的一种电子设备的框图。
下面参照图7来描述根据本公开的这种实施方式的电子设备200。图7显示的电子设 备200仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图7所示,电子设备200以通用计算设备的形式表现。电子设备200的组件可以包括但不限于:至少一个处理单元210、至少一个存储单元220、连接不同系统组件(包括存储单元220和处理单元210)的总线230、显示单元240等。
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元210执行,使得所述处理单元210执行本说明书上述电子处方流转处理方法部分中描述的根据本公开各种示例性实施方式的步骤。例如,所述处理单元210可以执行如图3或图6中所示的步骤。
所述存储单元220可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)2201和/或高速缓存存储单元2202,还可以进一步包括只读存储单元(ROM)2203。
所述存储单元220还可以包括具有一组(至少一个)程序模块2205的程序/实用工具2204,这样的程序模块2205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线230可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
电子设备200也可以与一个或多个外部设备300(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备200交互的设备通信,和/或与使得该电子设备200能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口250进行。并且,电子设备200还可以通过网络适配器260与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器260可以通过总线230与电子设备200的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备200使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一 台计算设备(可以是个人计算机、服务器、或者网络设备等)执行根据本公开实施方式的上述处理方法。
图8示意性示出本公开示例性实施例中一种计算机可读存储介质示意图。
参考图8所示,描述了根据本公开的实施方式的设置为实现上述方法的程序产品800,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本公开的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该计算机可读介质实现如下功能:接收硬件操作指令,所述硬件操作指令包括硬件设置数据;判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括前台运行状态与后台运行状态;当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。当所述硬件操作指令所属的操作系统处于前台运行状态时,清除电子设备中已有的硬件配置参数;通过所述硬件设置数据设置所述电子设备中的硬件参数;以及在上下文信息中保存所述硬件设置数据。
此外,本说明书说明书附图所示出的结构、比例、大小等,均仅用以配合说明书所公开的内容,以供本领域技术人员了解与阅读,并非用以限定本公开可实施的限定条件,故不具技术上的实质意义,任何结构的修饰、比例关系的改变或大小的调整,在不影响本公开所能产生的技术效果及所能实现的目的下,均应仍落在本公开所公开的技术内容得能涵盖的范围内。同时,本说明书中所引用的如“上”、“第一”、“第二”及“一”等的用语,也仅为便于叙述的明了,而非用以限定本公开可实施的范围,其相对关系的改变或调整,在无实质变更技术内容下,当也视为本公开可实施的范畴。

Claims (22)

  1. 一种硬件控制方法,可应用于多操作系统中,包括:
    接收硬件操作指令,所述硬件操作指令包括硬件设置数据;
    判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括所述操作系统处于前台运行状态或处于后台运行状态;
    当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。
  2. 如权利要求1所述的方法,还包括:
    当所述硬件操作指令所属的操作系统处于前台运行状态时,清除电子设备中已有的硬件配置参数;
    通过所述硬件设置数据设置所述电子设备中的硬件参数;以及
    在上下文信息中保存所述硬件设置数据。
  3. 如权利要求1所述的方法,接收硬件操作指令包括:
    通过硬件服务程序接收所述硬件操作指令,所述硬件服务程序位于操作系统的硬件服务层中。
  4. 如权利要求1所述的方法,所述操作系统包括主操作系统与至少一个客户操作系统。
  5. 如权利要求4所述的方法,所述主系统上运行虚拟机程序,所述至少一个客户操作系统在所述虚拟机程序上运作。
  6. 如权利要求1所述的方法,当所述操作系统为主操作系统时,接收硬件操作指令包括:
    主操作系统接收来自于主操作系统上应用程序的所述硬件操作指令。
  7. 如权利要求6所述的方法,在上下文信息中保存所述硬件设置数据包括:
    在主操作系统的硬件服务程序中保留所述硬件设置数据对应的上下文信息。
  8. 如权利要求1所述的方法,当所述操作系统为客户操作系统时,接收硬件操作指令包括:
    主操作系统中的硬件服务程序接收来自客户操作系统的所述硬件操作指令。
  9. 如权利要求8所述的方法,所述硬件操作指令通过所述客户操作系统的后端程序发出。
  10. 如权利要求1所述的方法,所述上下文信息包括:虚拟机标识、虚拟机支持的客 户操作系统的运行状态、已有的硬件操作指令。
  11. 一种硬件控制装置,可应用于多操作系统中,包括:
    接收模块,用于接收硬件操作指令,所述硬件操作指令包括硬件设置数据;
    判断模块,用于判断所述硬件操作指令所属的操作系统的运行状态,所述运行状态包括所述操作系统处于前台运行状态或后台运行状态;
    第一储存模块,用于当所述硬件操作指令所属的操作系统处于后台运行状态时,在上下文信息中保存所述硬件设置数据。
  12. 如权利要求11所述的装置,还包括:
    清除模块,用于当所述硬件操作指令所属的操作系统处于前台运行状态时,清除电子设备中已有的硬件配置参数;
    设置模块,用于通过所述硬件设置数据设置所述电子设备中的硬件参数;以及
    第二储存模块,用于在上下文信息中保存所述硬件设置数据。
  13. 如权利要求11所述的装置,所述接收模块还用于通过硬件服务程序接收所述硬件操作指令,所述硬件服务程序位于操作系统的硬件服务层中。
  14. 如权利要求11所述的装置,所述操作系统包括主操作系统与至少一个客户操作系统。
  15. 如权利要求14所述的装置,所述主系统上运行虚拟机程序,所述至少一个客户操作系统在所述虚拟机程序上运作。
  16. 如权利要求11所述的装置,当所述操作系统为主操作系统时,所述接收模块用于通过主操作系统接收来自于主操作系统上应用程序的所述硬件操作指令。
  17. 如权利要求16所述的装置,第一储存模块被设置为在主操作系统的硬件服务程序中保留所述所述硬件设置数据对应的上下文信息。
  18. 如权利要求11所述的装置,当所述操作系统为客户操作系统时,所述接收模块用于主操作系统中的硬件服务程序接收来自客户操作系统的所述硬件操作指令。
  19. 如权利要求18所述的装置,所述硬件操作指令通过所述客户操作系统的后端程序发出。
  20. 如权利要求1所述的装置,所述上下文信息包括:虚拟机标识、虚拟机支持的客户操作系统的运行状态、已有的硬件操作指令。
  21. 一种电子设备,包括:
    一个或多个处理器;
    存储装置,设置为存储一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-10中任一所述的方法。
  22. 一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现如权利要求1-10中任一所述的方法。
PCT/CN2018/079190 2018-03-15 2018-03-15 硬件控制方法、装置、电子设备及计算机可读介质 WO2019174010A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/079190 WO2019174010A1 (zh) 2018-03-15 2018-03-15 硬件控制方法、装置、电子设备及计算机可读介质
CN201880001129.0A CN109074275A (zh) 2018-03-15 2018-03-15 硬件控制方法、装置、电子设备及计算机可读介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/079190 WO2019174010A1 (zh) 2018-03-15 2018-03-15 硬件控制方法、装置、电子设备及计算机可读介质

Publications (1)

Publication Number Publication Date
WO2019174010A1 true WO2019174010A1 (zh) 2019-09-19

Family

ID=64789218

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/079190 WO2019174010A1 (zh) 2018-03-15 2018-03-15 硬件控制方法、装置、电子设备及计算机可读介质

Country Status (2)

Country Link
CN (1) CN109074275A (zh)
WO (1) WO2019174010A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110825606B (zh) * 2019-11-08 2023-04-07 北京金山云网络技术有限公司 数据操作方法、装置和中台系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226487A (zh) * 2008-01-30 2008-07-23 中国船舶重工集团公司第七〇九研究所 基于嵌入式Linux操作系统的内核级线程库的实现方法
CN101414277A (zh) * 2008-11-06 2009-04-22 清华大学 一种基于虚拟机的按需增量恢复容灾系统及方法
CN104598294A (zh) * 2015-01-07 2015-05-06 杨学仕 用于移动设备的高效安全的虚拟化方法及其设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100561438C (zh) * 2006-11-15 2009-11-18 联想(北京)有限公司 一种虚拟机系统及其显卡使用方法
KR101651202B1 (ko) * 2009-12-21 2016-08-26 삼성전자주식회사 가상화 장치 및 가상화 장치의 동작 방법
CN103902322B (zh) * 2012-12-28 2017-06-27 联想(北京)有限公司 系统切换方法和电子设备
CN105677315B (zh) * 2015-12-28 2020-02-07 北京元心科技有限公司 多操作系统的界面显示方法及智能终端
WO2018103022A1 (zh) * 2016-12-07 2018-06-14 深圳前海达闼云端智能科技有限公司 帧缓存实现方法、装置、电子设备和计算机程序产品

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226487A (zh) * 2008-01-30 2008-07-23 中国船舶重工集团公司第七〇九研究所 基于嵌入式Linux操作系统的内核级线程库的实现方法
CN101414277A (zh) * 2008-11-06 2009-04-22 清华大学 一种基于虚拟机的按需增量恢复容灾系统及方法
CN104598294A (zh) * 2015-01-07 2015-05-06 杨学仕 用于移动设备的高效安全的虚拟化方法及其设备

Also Published As

Publication number Publication date
CN109074275A (zh) 2018-12-21

Similar Documents

Publication Publication Date Title
US20200409732A1 (en) Sharing multimedia physical functions in a virtualized environment on a processing unit
US9672060B2 (en) Managing virtual machine migration
US9514507B2 (en) Methods and systems for maintaining state in a virtual machine when disconnected from graphics hardware
US10176007B2 (en) Guest code emulation by virtual machine function
US20190235904A1 (en) Cloning services in virtualized computing systems
US20120054740A1 (en) Techniques For Selectively Enabling Or Disabling Virtual Devices In Virtual Environments
US9529615B2 (en) Virtual device emulation via hypervisor shared memory
JP2006018814A (ja) 仮想マシン環境におけるエミュレートされたデバイスの開発のためのシステムおよび方法
JP2011100431A (ja) 仮想マシン制御装置及び仮想マシン制御方法
JP2015503784A (ja) グラフィックス処理部における仮想マシン間の移行
KR20160033517A (ko) 인터럽트 컨트롤러를 위한 하이브리드 가상화 방법
US20150121377A1 (en) Method for implementing inter-virtual processor interrupt, related apparatus, and system
US11709692B2 (en) Hot growing a cloud hosted block device
US11875145B2 (en) Virtual machine update while keeping devices attached to the virtual machine
US11366679B2 (en) Guest operating system wake-up method, device, electronic apparatus, and readable medium
WO2019174010A1 (zh) 硬件控制方法、装置、电子设备及计算机可读介质
US9110731B1 (en) Hard allocation of resources partitioning
WO2021057649A1 (zh) 定时器处理方法、装置、电子设备及计算机存储介质
US11513983B2 (en) Interrupt migration
WO2019119438A1 (zh) 一种操作系统屏幕锁定的方法、装置及电子设备
CN114115703A (zh) 裸金属服务器在线迁移方法以及系统
US20230032967A1 (en) Establishing process connections utilizing an intermediary broker
WO2024127177A1 (en) Continuity of service for virtualized device after resumption from hibernation

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

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 20.01.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18909548

Country of ref document: EP

Kind code of ref document: A1