CN117389682A - Bluetooth equipment sharing system - Google Patents

Bluetooth equipment sharing system Download PDF

Info

Publication number
CN117389682A
CN117389682A CN202311300365.1A CN202311300365A CN117389682A CN 117389682 A CN117389682 A CN 117389682A CN 202311300365 A CN202311300365 A CN 202311300365A CN 117389682 A CN117389682 A CN 117389682A
Authority
CN
China
Prior art keywords
bluetooth
virtual machine
power management
client virtual
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311300365.1A
Other languages
Chinese (zh)
Inventor
王建修
刘亮
江茂
李健
曹超倚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ecarx Hubei Tech Co Ltd
Original Assignee
Ecarx Hubei Tech Co Ltd
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 Ecarx Hubei Tech Co Ltd filed Critical Ecarx Hubei Tech Co Ltd
Priority to CN202311300365.1A priority Critical patent/CN117389682A/en
Publication of CN117389682A publication Critical patent/CN117389682A/en
Pending legal-status Critical Current

Links

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/16Performing reselection for specific purposes
    • H04W36/18Performing reselection for specific purposes for allowing seamless reselection, e.g. soft reselection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • 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/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a Bluetooth equipment sharing system, which comprises a host and at least two client virtual machines, wherein each client virtual machine comprises a Bluetooth switch control module, a Bluetooth driver and a Bluetooth power management front-end module; the method solves the problems that the Bluetooth equipment switching speed is low and the normal work of the virtual machines is influenced in the process of sharing the Bluetooth equipment by multiple virtual machines, and the connection switching of the Bluetooth equipment is rapidly completed under the condition that the normal work of the client virtual machines is not influenced, the implementation process is simple, the users are free from feeling, and the time sharing of the Bluetooth equipment among multiple virtual machine operating systems under the Bluetooth virtualization scheme architecture is realized.

Description

Bluetooth equipment sharing system
Technical Field
The invention relates to the technical field of Bluetooth, in particular to a Bluetooth equipment sharing system.
Background
The virtualization technology brings a new revolution to the electronic ecology of the automobile by realizing resource sharing and safety isolation. The hardware resources of CPU, memory, GPU, input and output can be shared by virtualization technology. Virtualization solution architecture generally includes a Host operating system, namely a Host virtual machine operating system, and several guest virtual machine operating systems, where these operating systems run on the same hardware device, and each virtual operating system shares access to actual hardware resources, such as GPUs, input-output devices, etc., through virtualized hardware by using a device virtualization technology. In the process of sharing the Bluetooth equipment by the multiple virtual operating systems, if connection switching of the Bluetooth equipment is performed, the whole virtual machine needs to be powered on and powered off, the Bluetooth switching process consumes a long time, the implementation process is complex, and normal work of the virtual machine can be affected by the power on and off of the virtual machine.
Disclosure of Invention
The invention provides a Bluetooth equipment sharing system, which aims to solve the problems that in the process of sharing Bluetooth equipment by multiple virtual machines, the switching speed of the Bluetooth equipment is low and the normal operation of the virtual machines is influenced.
According to an aspect of the present invention, there is provided a bluetooth device sharing system, the system including a host and at least two client virtual machines, each of the client virtual machines including a bluetooth switch control module, a bluetooth driver, and a bluetooth power management front end module, the bluetooth switch control module, the bluetooth driver, and the bluetooth power management front end module of each of the client virtual machines being sequentially connected, the bluetooth switch control modules of each of the client virtual machines being communicatively connected by means of inter-domain communication, the host including a power management device, the power management device being connected with the bluetooth power management front end module of each of the client virtual machines;
the Bluetooth switch control module of the client virtual machine is used as a Bluetooth switch control module of the client virtual machine to be connected when receiving a Bluetooth connection instruction, and is used for sending a Bluetooth closing instruction to the Bluetooth switch control module of the target client virtual machine when the target client virtual machine connected with Bluetooth equipment exists;
the Bluetooth switch control module of the target client virtual machine is used for indicating the Bluetooth driver of the target client virtual machine to close Bluetooth equipment connection when receiving a Bluetooth closing instruction;
the Bluetooth driver of the target client virtual machine is used for sending a power-off instruction to the Bluetooth power management front-end module of the target client virtual machine under the instruction of the Bluetooth switch control module of the target client virtual machine and closing interface connection of Bluetooth equipment;
the Bluetooth power management front-end module of the target client virtual machine is used for closing the power connection of the Bluetooth equipment through the power management device after receiving the power closing instruction;
the Bluetooth switch control module of the to-be-connected client virtual machine is further used for performing Bluetooth equipment connection after the target client virtual machine breaks the Bluetooth equipment connection.
The embodiment of the invention provides a Bluetooth equipment sharing system, which comprises a host and at least two client virtual machines, wherein each client virtual machine comprises a Bluetooth switch control module, a Bluetooth driver and a Bluetooth power management front-end module, the Bluetooth switch control module, the Bluetooth driver and the Bluetooth power management front-end module of each client virtual machine are sequentially connected, the Bluetooth switch control modules of the client virtual machines are in communication connection in an inter-domain communication mode, and the host comprises a power management device; when receiving a Bluetooth connection instruction through a Bluetooth switch control module, the client virtual machine is used as a client virtual machine to be connected, whether a target client virtual machine connected with Bluetooth equipment exists or not is detected through the Bluetooth switch control module, and if yes, a Bluetooth closing instruction is sent to the Bluetooth switch control module of the target client virtual machine; the Bluetooth switch control module of the target client virtual machine indicates the Bluetooth driver to close the Bluetooth equipment connection, the Bluetooth driver closes the power supply of the Bluetooth equipment through the matching of the Bluetooth power supply management front-end module and the power supply management device, and simultaneously closes the interface connection with the Bluetooth equipment, thereby closing the Bluetooth equipment; after the Bluetooth of the target client virtual machine is closed, the Bluetooth switch control module of the client virtual machine to be connected is connected with Bluetooth equipment, connection switching of the Bluetooth equipment is completed, the Bluetooth equipment switching speed is low in the process of sharing the Bluetooth equipment by multiple virtual machines, and the problem that normal work of the virtual machine is influenced is solved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a bluetooth device sharing system according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of another bluetooth device sharing system according to a first embodiment of the present invention;
fig. 3 is a schematic structural diagram of another bluetooth device sharing system according to a first embodiment of the present invention;
fig. 4 is a schematic structural diagram of a bluetooth device sharing system according to a second embodiment of the present invention;
fig. 5 is a flowchart of a bluetooth device sharing method according to a second embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a schematic structural diagram of a bluetooth device sharing system according to a first embodiment of the present invention, where the embodiment is applicable to a situation where multiple virtual machines share bluetooth devices. As shown in fig. 1, the system includes: the host 11 and at least two guest virtual machines 12, each guest virtual machine 12 includes a bluetooth switch control module 1201, a bluetooth driver 1202 and a bluetooth power management front-end module 1203, the bluetooth switch control module 1201 and the bluetooth driver 1202 of each guest virtual machine 12 are sequentially connected with the bluetooth power management front-end module 1203, the bluetooth switch control modules 1201 of each guest virtual machine 12 are in communication connection by means of inter-domain communication, the host 11 includes a power management device 111, and the power management device 111 is connected with the bluetooth power management front-end module 1203 of each guest virtual machine.
In this embodiment, the Host 11 may be a Host virtual machine, the Guest virtual machine 12 may be a Guest virtual machine, the Host 11 and the Guest virtual machine 12 may be disposed on the same physical Host 11, different operating systems may be run on each Guest virtual machine 12, and each operating system independently runs, so as to implement corresponding service functions; the host 11 may provide background assistance for the operation of each guest virtual machine 12.
The bluetooth switch control module 1201 may be specifically understood as a data processing device that controls on/off (or connection/disconnection) of bluetooth, and the bluetooth switch control module 1201 may be deployed on the guest virtual machine 12 in the form of an application, i.e., installed on an operating system of the guest virtual machine 12; the bluetooth switch control module 1201 may also be configured as an operable hardware switch, and installed on a physical machine or other hardware device, for example, in the case where the bluetooth device 20 is disposed on a vehicle as a shared system, two systems, i.e., an instrument system and a car system, are typically disposed on the vehicle, the instrument system and the car system are disposed on two client virtual machines 12, respectively, and the bluetooth switch control module 1201 is configured as a button and disposed inside the vehicle, for example, on one side of a display screen of the car. The bluetooth power management front end module 1203 may be specifically understood as a data processing module for performing power up and power down management on the bluetooth device 20, where the bluetooth power management front end module 1203 is deployed in the client virtual machine 12; the power management device 111 may be specifically understood as a data processing module for performing power-on/power-off management on the bluetooth device 20, and is disposed in the host 11, where the power management device 111 is connected to the bluetooth device 20 to implement power-on/power-off control. The bluetooth power management front-end module 1203 cooperates with the power management device 111 to realize power-on and power-off management of the bluetooth device 20.
Each client virtual machine 12 includes a bluetooth switch control module 1201, a bluetooth driver 1202 and a bluetooth power management front end module 1203, where the bluetooth switch control module 1201 is connected with the bluetooth driver 1202, and the bluetooth driver 1202 is connected with the bluetooth power management front end module 1203, where the connection mode may be communication connection, hardware connection, or a combination of the two modes. The bluetooth switch control module 1201 of each client virtual machine 12 is communicatively connected by inter-domain communication, and can exchange information about connection conditions between each client virtual machine 12 and the bluetooth device 20 by communication. The power management device 111 is connected to the bluetooth apparatus 20, and the power management device 111 may be directly connected to a hardware module of the bluetooth apparatus 20 through a Hypervisor.
In the process of sharing the bluetooth device, if there is a client virtual machine to which the bluetooth device is already connected, connection switching of the bluetooth device is required. Fig. 2 provides a schematic diagram of another bluetooth device sharing system, which illustrates a bluetooth device sharing process, taking a system including a client virtual machine to which a bluetooth device is already connected as an example.
The bluetooth switch control module 1201 of the client virtual machine 12, when receiving the bluetooth connection instruction, is used as the bluetooth switch control module 1211 of the client virtual machine 121 to be connected, and is used for sending a bluetooth closing instruction to the bluetooth switch control module 1221 of the target client virtual machine 122 when the target client virtual machine 122 connected with the bluetooth device 20 exists;
a bluetooth switch control module 1221 of the target client virtual machine 122, configured to instruct, when receiving the bluetooth shutdown instruction, the bluetooth driver 1222 of the target client virtual machine 122 to shutdown the bluetooth device 20 connection;
the bluetooth driver 1222 of the target client virtual machine 122 is configured to send a power-off instruction to the bluetooth power management front-end module 1223 of the target client virtual machine 122 under the instruction of the bluetooth switch control module 1221 of the target client virtual machine 122, and close the interface 30 connection of the bluetooth device 20;
the bluetooth power management front end module 1223 of the target client virtual machine 122 is configured to close, after receiving the power shutdown instruction, the power connection of the bluetooth device 20 through the power management apparatus 111;
the bluetooth switch control module 1211 of the to-be-connected client virtual machine 121 is further configured to perform bluetooth device 20 connection after the target client virtual machine 122 disconnects the bluetooth device 20.
In this embodiment, the bluetooth connection instruction may be specifically understood as an instruction instructing the client virtual machine 12 to connect to the bluetooth device 20; the to-be-connected guest virtual machine 121 can be understood as a guest virtual machine having a need to connect to the bluetooth device 20; the target guest virtual machine 122 can be understood as a guest virtual machine to which the bluetooth device 20 has been connected. The bluetooth shutdown instruction may be understood as an instruction that instructs the target guest virtual machine 122 to disconnect from the bluetooth device 20, in particular.
The bluetooth connection instruction can be triggered manually by a user, or can be automatically triggered to generate the bluetooth connection instruction when the operation of the user or the working state of an application program is detected to meet the bluetooth connection condition. The bluetooth switch control module 1201 of the guest virtual machine 12 may receive a bluetooth connection instruction. Normally, at the same time, only the bluetooth switch control module 1201 of one client virtual machine 12 can receive a bluetooth connection instruction; if the bluetooth switch control modules 1201 of the plurality of client virtual machines 12 receive bluetooth connection instructions at the same time, at this time, one client virtual machine 12 may be selected as the client virtual machine 121 to be connected according to a certain rule, for example, randomly selected, selected according to priority, etc., the implementation manner may be that the client virtual machines 12 exchange priorities of each other, and when the client virtual machine 12 with the highest priority determines that the priority of the local machine is the highest, the local machine may be determined as the client virtual machine 121 to be connected; alternatively, the guest virtual machine 12 having the highest priority is randomly selected or determined by the host 11 as the guest virtual machine 121 to be connected. The bluetooth switch control module 1211 of the guest virtual machine 121 to be connected detects whether there is a guest virtual machine 12 connected to the bluetooth device 20, and if so, determines the guest virtual machine 12 connected to the bluetooth device 20 as the target guest virtual machine 122. The to-be-connected guest virtual machine 121 generates a bluetooth shutdown instruction and transmits to the bluetooth switch control module 1221 of the target guest virtual machine 122. The bluetooth shutdown instruction may include only indication information, for example, 0 represents shutdown bluetooth; other information may also be written according to requirements or pre-agreed information types.
The bluetooth switch control module 1221 of the target client virtual machine 122, upon receiving the bluetooth shutdown instruction, sends an indication to the bluetooth driver 1222 of the target client virtual machine 122 instructing the bluetooth driver 1202 to shutdown the bluetooth device 20 connection.
In this embodiment, the power-off instruction may be specifically understood as an instruction for turning off the power of the bluetooth device 20 and powering off the bluetooth device 20. The bluetooth driver 1222 of the target client virtual machine 122 generates a power-off instruction and transmits the power-off instruction to the bluetooth power management front-end module 1223 under the instruction of the bluetooth switch control module 1221, and powers down the bluetooth device 20 through the bluetooth power management front-end module 1223. At the same time, the bluetooth driver 1222 closes the connection with the interface 30 of the bluetooth device 20, stopping reading data from the bluetooth device 20.
The bluetooth power management front end module 1223 of the target client virtual machine 122 is connected to the power management device 111 of the host 11, and cooperates with the power management device 111 to realize power-down of the bluetooth device 20. After receiving the power-off instruction, the bluetooth power management front-end module 1223 instructs the power management device 111 to turn off the power connection of the bluetooth device 20, and completes the power-off control of the bluetooth device 20, thereby disconnecting the target client virtual machine 122 from the bluetooth device 20.
The bluetooth switch control module 1211 of the guest virtual machine 121 to be connected determines whether the target guest virtual machine 122 has disconnected from the bluetooth device 20, and if so, controls the host to connect with the bluetooth device 20. The manner of determining whether the target guest virtual machine 122 has disconnected from the bluetooth device 20 may be: receiving bluetooth device 20 disconnection information transmitted by the target client virtual machine 122 after disconnecting the bluetooth device 20; alternatively, the time threshold may be set in advance according to the time required for the bluetooth device 20 to disconnect, the timing may be started after sending the bluetooth switch control module 1221 for the target client virtual machine 122 a bluetooth off command, the determination may be made that the target client virtual machine 122 has disconnected from the bluetooth device 20 after the time reaches the time threshold, and so on.
The embodiment of the invention provides a Bluetooth equipment sharing system, wherein a client virtual machine is used as a client virtual machine to be connected when a Bluetooth switch control module receives a Bluetooth connection instruction, and a Bluetooth switch control module detects whether a target client virtual machine connected with Bluetooth equipment exists or not, if so, a Bluetooth closing instruction is sent to the Bluetooth switch control module of the target client virtual machine; the Bluetooth switch control module of the target client virtual machine indicates the Bluetooth driver to close the Bluetooth equipment connection, the Bluetooth driver closes the power supply of the Bluetooth equipment through the matching of the Bluetooth power supply management front-end module and the power supply management device, and simultaneously closes the interface connection with the Bluetooth equipment, thereby closing the Bluetooth equipment; after the Bluetooth of the target client virtual machine is closed, the Bluetooth switch control module of the client virtual machine to be connected is connected with Bluetooth equipment to complete connection switching of the Bluetooth equipment, so that the problems that the Bluetooth equipment switching speed is low and normal operation of the virtual machine is influenced in the process of sharing the Bluetooth equipment by multiple virtual machines are solved, the connection switching of the Bluetooth equipment is rapidly completed under the condition that normal operation of the client virtual machine is not influenced, the implementation process is simple, users are not felt, normal operation of the users is not influenced, and time sharing of the Bluetooth equipment among multiple virtual machine operating systems under the Bluetooth virtualization scheme architecture is realized.
Optionally, the bluetooth switch control module 1211 of the guest virtual machine 121 to be connected is further configured to: when there is no guest virtual machine 12 connected to the bluetooth device 20, the bluetooth device 20 connection is made.
When the bluetooth switch control module 1211 of the client virtual machine 121 to be connected determines that there is no client virtual machine 12 connected to the bluetooth device 20 according to the bluetooth connection status of the other bluetooth switch control modules 1211, the bluetooth device 20 may be directly connected in the same manner as the bluetooth device 20 connection performed after the connection of the bluetooth device 20 to the target client virtual machine 122 is disconnected.
In the sharing process of the Bluetooth device, if the client virtual machine connected with the Bluetooth device does not exist, the client virtual machine to be connected can be directly connected with the Bluetooth device. Fig. 3 provides a schematic diagram of another bluetooth device sharing system, taking an example that there is no target client virtual machine already connected to a bluetooth device in the system, where the client virtual machine to be connected directly connects to the bluetooth device.
Example two
Fig. 4 is a schematic structural diagram of a bluetooth device sharing system according to a second embodiment of the present invention, where the embodiment is further refined based on the foregoing embodiment. As shown in fig. 4, the power management device 111 includes a bluetooth module power management module 1111 and at least two bluetooth power management back-end modules 1112.
The bluetooth switch control module 1211 of the guest virtual machine 121 to be connected is specifically configured to: communicate with each other bluetooth switch control module 1201 and acquire a bluetooth connection status; whether or not there is a guest virtual machine 12 connected to the bluetooth device 20 is determined based on the bluetooth connection status of each bluetooth switch control module 1201, and if so, the guest virtual machine 12 connected to the bluetooth device 20 is determined as the target guest virtual machine 122.
In this embodiment, the bluetooth connection status is specifically understood as status information indicating whether the client virtual machine 12 is connected to the bluetooth device 20, and the bluetooth connection status is connected or disconnected, for example, 1 represents connected and 0 represents disconnected. The bluetooth switch control module 1201 of each client virtual machine 12 performs communication connection by means of inter-domain communication, so that information interaction can be realized. The bluetooth switch control module 1211 of the to-be-connected guest virtual machine 121 communicates with the bluetooth switch control modules 1201 of the other guest virtual machines 12, and transmits an acquisition instruction of the bluetooth connection state to each of the other bluetooth switch control modules 1201 to acquire the bluetooth connection state thereof. The bluetooth connection state of each bluetooth switch control module 1201 is analyzed to determine whether or not there is a guest virtual machine 12 to which the bluetooth device 20 is connected, and if so, the guest virtual machine 12 to which the bluetooth device 20 is connected is determined as the target guest virtual machine 122.
In the embodiment of the present application, when performing bluetooth connection switching, the priority of the client virtual machine 12 may also be considered, for example, when the priority of the target client virtual machine 122 is higher than the priority of the client virtual machine 121 to be connected, the switching of bluetooth connection is not performed; the priority may be preconfigured.
Optionally, the bluetooth switch control module 1221 of the target client virtual machine 122 is further configured to: after the bluetooth connection of the target client virtual machine 122 is disconnected, the bluetooth connection state is updated.
Since the bluetooth switch control module 1201 manages the bluetooth connection status of the guest virtual machine 12, the bluetooth switch control module 1221 of the target guest virtual machine 122 updates the bluetooth connection status from connected to unconnected after the local bluetooth connection is disconnected.
Optionally, the power management device 111 includes a bluetooth module power management module 1111 and at least two bluetooth power management back-end modules 1112, where the bluetooth module power management module 1111 is connected to the bluetooth device 20 and each bluetooth power management back-end module 1112, and each bluetooth power management back-end module 1112 is connected to each bluetooth power management front-end module 1203 in a one-to-one correspondence;
the bluetooth power management back end module 1112, which is connected to the bluetooth power management front end module 1223 of the target client virtual machine 122, is configured to control the bluetooth module power management module 1111 to power down the bluetooth device 20 after receiving the power-off instruction sent by the bluetooth power management front end module 1223, so as to disconnect the target client virtual machine 122 from the bluetooth device 20.
In this embodiment, the bluetooth module power management module 1111 may be specifically understood as a data processing module in the host 11 for managing the power on/off of the bluetooth device 20, and is responsible for powering on/off the bluetooth device 20, and may be a controller, for example, a gpio controller; the bluetooth module power management module 1111 interfaces through the virtual machine manager 40 (i.e., hypervisor) to the hardware modules of the bluetooth device 20. The bluetooth power management back end module 1112 may be understood as a data processing module for controlling powering up and powering down of the bluetooth device 20, for example, virtio-gpio. The bluetooth power management back-end modules 1112 and the bluetooth power management front-end modules 1203 are in one-to-one correspondence, that is, each client virtual machine 12 sets a bluetooth power management front-end module 1203, and simultaneously sets a bluetooth power management back-end module 1112 on the host 11 to communicate with the client virtual machine, and the front end and the back end are in power-on and power-off control through cooperation, so that the power-on and power-off control on the bluetooth device 20 is realized through controlling the bluetooth module power management module 1111.
The bluetooth power management front end module 1223 of the target guest virtual machine 122 is connected to one bluetooth power management back end module 1112 on the host 11, and after receiving the power-off instruction, sends the power-off instruction to the bluetooth power management back end module 1112 to which it is connected. The bluetooth power management back end module 1112 controls the bluetooth module power management module 1111 to power down the bluetooth device 20 after receiving the power-off instruction, thereby disconnecting the target client virtual machine 122 from the bluetooth device 20.
Optionally, each client virtual machine 12 further includes an interface driver 1204, the bluetooth driver 1202 of each client virtual machine 12 is connected to the interface driver 1204, each interface driver 1204 is directly connected to the interface 30 through the virtual machine manager, and the interface 30 is connected to the bluetooth device 20;
the bluetooth driver 1222 of the target client virtual machine 122 is specifically configured to: the connection with the interface driver 1224 of the target guest virtual machine 121 is closed to enable the closing of the connection with the bluetooth device 20.
In this embodiment, the interface driver 1204 may be specifically understood as a driver of the interface 30 connected to the bluetooth device 20, where the type of the interface driver 1204 is consistent with the type of the interface 30, and the interface 30 may be a universal asynchronous receiver/transmitter UART, a universal serial bus USB, a secure digital interface SD, a three-wire UART, or the like. Taking the interface 30 as a UART for example, the interface driver 1204 is a UART driver, each client virtual machine 12 is provided with an interface driver 1204, the interface driver 1204 is connected with the bluetooth driver 1202, and simultaneously, the interface driver 1204 is directly connected with the interface 30 through the virtual machine management program 40, and the interface 30 is connected with the bluetooth device 20 so as to read data of the bluetooth device 20 through the interface 30.
In this embodiment, the interface driver 1204 may be connected to the bluetooth host controller interface HCI of the bluetooth device when connected to the bluetooth device 20 through an interface, i.e., the bluetooth host controller interface may be UART, USB, SD, three-wire UART, or the like.
When the connection of the interface 30 of the Bluetooth device 20 is closed, the Bluetooth driver 1202 directly closes the connection with the interface driver 1204, and stops reading the data of the Bluetooth device 20 from the interface driver 1204, thereby closing the connection of the Bluetooth device 20.
Optionally, the bluetooth driver 1222 of the target client virtual machine 122 is further configured to: the bluetooth protocol stack is closed.
After connection, the bluetooth device 20 needs to operate according to the bluetooth protocol stack. Thus, the present application requires the bluetooth driver 1222 of the target client virtual machine 122 to close the bluetooth protocol stack at the same time when closing the connection of the bluetooth device 20.
It should be appreciated that when the target client virtual machine 122 is disconnected from the bluetooth device 20, it may operate sequentially in the order of turning off the bluetooth protocol stack, turning off the interface 30, and turning off the power of the bluetooth device 20 (i.e., controlling the bluetooth device 20 to be powered down). The target client virtual machine 122 disconnects from the bluetooth device 20, and in fact, needs to perform the closing of the bluetooth protocol stack, the interface 30 and the power supply, and may send feedback information to the bluetooth switch control module 1221 after each closing, to prompt the bluetooth switch control module 1221 what is closed at the time, or may set the closing order, and finally send feedback information to the bluetooth switch control module 1221 after all closing, to prompt the bluetooth switch control module 1221 that the connection with the bluetooth device 20 has been disconnected.
The bluetooth switch control module 1211 of the guest virtual machine 121 to be connected makes a bluetooth device 20 connection when there is no guest virtual machine 12 connected to the bluetooth device 20.
Optionally, the bluetooth switch control module 1211 of the client virtual machine 121 to be connected is specifically configured to: the bluetooth driver 1212 of the client virtual machine 121 to be connected is invoked to connect with the bluetooth device 20.
When the to-be-connected client virtual machine 121 connects with the bluetooth device 20, the bluetooth driver 1212 is invoked by the bluetooth switch control module 1211, and the bluetooth device 20 is connected by the bluetooth driver 1212. The connection of the bluetooth device 20 includes at least powering up the bluetooth device 20, opening the interface 30, and initializing a bluetooth protocol stack.
Optionally, the power management device 111 includes a bluetooth module power management module 1111 and at least two bluetooth power management back-end modules 1112, where each bluetooth power management back-end module 1112 is connected to each other, the bluetooth module power management module 1111 is connected to the bluetooth device 20 and each bluetooth power management back-end module 1112, and each bluetooth power management back-end module 1112 is connected to each bluetooth power management front-end module 1203 in a one-to-one correspondence;
the bluetooth driver 1202 of the to-be-connected client virtual machine 121 sends a power-on instruction to the bluetooth power management front-end module 1213 of the to-be-connected client virtual machine 121 after receiving the call of the bluetooth switch control module 1211 of the to-be-connected client virtual machine 121;
the bluetooth power management front end module 1213 of the to-be-connected client virtual machine 121 is configured to send a power-on instruction to the bluetooth power management back end module 1112 connected thereto after receiving the power-on instruction;
the bluetooth power management back end module 1112 connected to the bluetooth power management front end module 1203 of the to-be-connected client virtual machine 121 is configured to establish a connection with the bluetooth module power management module 1111 after receiving the power-up instruction and determining that there is no bluetooth power management back end module 1112 controlling the bluetooth module power management module 1111, so as to power up the bluetooth device 20.
In this embodiment, the bluetooth power management back end modules 1112 may also be connected to each other for communication, so as to perform information interaction. The power-up instruction may be understood as an instruction for instructing power-up of the bluetooth device 20 in particular. After the bluetooth driver 1212 is invoked by the bluetooth switch control module 1211 of the client virtual machine 121 to be connected, the bluetooth driver 1212 receives the invocation of the bluetooth switch control module 1211, generates a power-on instruction, and sends the power-on instruction to the bluetooth power management front-end module 1213 of the client virtual machine 121 to be connected, so as to instruct the bluetooth power management front-end module 1213 to complete power-on of the bluetooth device 20. After receiving the power-up instruction, the bluetooth power management front end module 1213 of the to-be-connected client virtual machine 121 sends the power-up instruction to the bluetooth power management back end module 1112 connected thereto. After receiving the power-on instruction, the bluetooth power management back end module 1112 communicates with other bluetooth power management back end modules 1112, obtains the control condition of other bluetooth power management back end modules 1112 on the bluetooth module power management module 1111, and if the bluetooth power management back end module 1112 controlling the bluetooth module power management module 1111 does not exist, controls the bluetooth module power management module 1111 to power on the bluetooth device 20.
In order to avoid that a plurality of client virtual machines are connected with Bluetooth at the same time, the embodiment of the application sets a Bluetooth switch control module and a Bluetooth power management back-end module to be responsible for mutual exclusion use of the client virtual machines on Bluetooth equipment, and the Bluetooth switch control module judges whether other client virtual machines are connected with the Bluetooth equipment when the Bluetooth equipment is connected; when the Bluetooth power management back-end module controls the Bluetooth module power management module, the Bluetooth power management back-end module also judges whether other Bluetooth power management back-end modules are controlling the Bluetooth module power management module, and only one Bluetooth power management back-end module is guaranteed to have control right on the Bluetooth module power management module at the same time.
Optionally, each guest virtual machine 12 further includes an interface driver 1204, the bluetooth driver 1202 of each guest virtual machine 12 is connected to the interface driver 1204, each interface driver 1204 is in direct communication with the interface 30 through the virtual machine manager 40, and the interface 30 is connected to the bluetooth device 20;
the bluetooth driver 1212 of the to-be-connected client virtual machine 121 is specifically configured to: opening a connection with an interface driver 1214 of the client virtual machine 121 to be connected to enable connection with the bluetooth device 20;
the bluetooth driver 1212 of the to-be-connected client virtual machine 121 is specifically configured to: the bluetooth protocol stack is initialized.
The bluetooth driver 1212 of the to-be-connected client virtual machine 121 realizes connection between the to-be-connected virtual machine and the bluetooth device 20 by opening connection with the interface driver 1214 in the process of bluetooth connection, and after opening connection with the interface driver 1214, can read the interface 30 data through the interface driver 1214. The bluetooth driver 1212 of the to-be-connected client virtual machine 121 initializes the bluetooth protocol stack, and after completing the power-up, the interface connection, and the initialization of the bluetooth protocol stack, the to-be-connected client virtual machine 121 can complete the connection with the bluetooth device 20, and the bluetooth device 20 can be used.
Optionally, the bluetooth switch control module 1211 of the to-be-connected client virtual machine 121 is further configured to update the bluetooth connection status after the to-be-connected client virtual machine 121 is connected to the bluetooth device 20.
The bluetooth switch control module 1211 of the to-be-connected guest virtual machine 121 updates the bluetooth connection state after the to-be-connected guest virtual machine 121 connects to the bluetooth device 20, and updates the bluetooth connection state from unconnected to connected.
For example, fig. 5 provides a flowchart of a bluetooth device sharing method, taking a bluetooth switch control module as a bluetooth switch application and an interface as a UART serial port as an example, the method includes the following steps:
s1, when a Bluetooth switch control module of a client virtual machine receives a Bluetooth connection instruction, the Bluetooth switch control module of the client virtual machine to be connected is used as a Bluetooth switch control module of the client virtual machine to be connected.
S2, the Bluetooth switch application of the client virtual machine to be connected checks whether other client virtual machines are using Bluetooth functions in an inter-domain communication mode, and if so, S3 is executed; otherwise, S7 is performed.
S3, the Bluetooth switch application of the client virtual machine to be connected notifies the Bluetooth switch application of the target client virtual machine using the Bluetooth function to close the Bluetooth function.
S4, the Bluetooth switch application of the target client virtual machine calls the Bluetooth driver to close the Bluetooth protocol stack.
S5, the Bluetooth switch application of the target client virtual machine calls the Bluetooth driver to close the UART serial port.
S6, the Bluetooth switch application of the target client virtual machine calls the Bluetooth driver to turn off the power supply of the Bluetooth device.
The step can be completed through the cooperation of the Bluetooth power management front-end module, the Bluetooth power management rear-end module and the Bluetooth module power management module.
S7, the Bluetooth switch application of the client virtual machine to be connected calls the Bluetooth driver to turn on the power supply of the Bluetooth module.
S8, the Bluetooth switch application of the client virtual machine to be connected calls the Bluetooth driver to open the UART serial port.
S9, initializing a Bluetooth protocol stack by the to-be-connected client virtual machine.
S10, the to-be-connected client virtual machine uses a Bluetooth function.
The embodiment of the invention provides a Bluetooth equipment sharing system, which solves the problems that the switching speed of Bluetooth equipment is low and the normal operation of a virtual machine is influenced in the process of sharing Bluetooth equipment by a plurality of virtual machines, realizes the mutual exclusion use of the operating systems of client virtual machines on Bluetooth through a Bluetooth switch control module, and realizes the time sharing of the Bluetooth equipment among the operating systems of the plurality of virtual machines under the framework of a Bluetooth virtualization scheme on the basis of not damaging the Bluetooth protocol stack and the integrity of Bluetooth drive; ensuring that only one client virtual machine can turn on the Bluetooth device at the same time; the interface driver in the client virtual machine is connected with the interface hardware in a Hypervisor direct connection mode, and the client virtual machine is opened to be connected with the interface driver when Bluetooth is needed. Under the condition that normal work of the client virtual machine is not affected, connection switching of the Bluetooth equipment is completed rapidly, the implementation process is simple, a user does not feel, and normal operation of the user is not affected.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
It should be noted that, in the embodiment of the bluetooth device sharing system, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. The Bluetooth equipment sharing system is characterized by comprising a host and at least two client virtual machines, wherein each client virtual machine comprises a Bluetooth switch control module, a Bluetooth driver and a Bluetooth power management front-end module, the Bluetooth switch control module, the Bluetooth driver and the Bluetooth power management front-end module of each client virtual machine are sequentially connected, the Bluetooth switch control modules of the client virtual machines are in communication connection through inter-domain communication, and the host comprises a power management device which is connected with the Bluetooth power management front-end module of each client virtual machine;
the Bluetooth switch control module of the client virtual machine is used as a Bluetooth switch control module of the client virtual machine to be connected when receiving a Bluetooth connection instruction, and is used for sending a Bluetooth closing instruction to the Bluetooth switch control module of the target client virtual machine when the target client virtual machine connected with Bluetooth equipment exists;
the Bluetooth switch control module of the target client virtual machine is used for indicating the Bluetooth driver of the target client virtual machine to close Bluetooth equipment connection when receiving a Bluetooth closing instruction;
the Bluetooth driver of the target client virtual machine is used for sending a power-off instruction to the Bluetooth power management front-end module of the target client virtual machine under the instruction of the Bluetooth switch control module of the target client virtual machine and closing interface connection of Bluetooth equipment;
the Bluetooth power management front-end module of the target client virtual machine is used for closing the power connection of the Bluetooth equipment through the power management device after receiving the power closing instruction;
the Bluetooth switch control module of the to-be-connected client virtual machine is further used for performing Bluetooth equipment connection after the target client virtual machine breaks the Bluetooth equipment connection.
2. The system according to claim 1, wherein the bluetooth switch control module of the guest virtual machine to be connected is specifically configured to:
communicating with other Bluetooth switch control modules and acquiring Bluetooth connection states;
and determining whether a client virtual machine connected with the Bluetooth equipment exists or not according to the Bluetooth connection state of each Bluetooth switch control module, and if so, determining the client virtual machine connected with the Bluetooth equipment as a target client virtual machine.
3. The system of claim 2, wherein the bluetooth switch control module of the target guest virtual machine is further configured to: and updating the Bluetooth connection state after the Bluetooth connection of the target client virtual machine is disconnected.
4. The system of claim 1, wherein the power management device comprises a bluetooth module power management module and at least two bluetooth power management back-end modules, the bluetooth module power management module being connected to the bluetooth device and each of the bluetooth power management back-end modules, each of the bluetooth power management back-end modules being connected to each of the bluetooth power management front-end modules in a one-to-one correspondence;
and the Bluetooth power management back-end module is connected with the Bluetooth power management front-end module of the target client virtual machine and is used for controlling the Bluetooth module power management module to power down the Bluetooth equipment after receiving the power-off instruction sent by the Bluetooth power management front-end module so as to disconnect the connection between the target client virtual machine and the Bluetooth equipment.
5. The system of claim 1, wherein each of said guest virtual machines further comprises an interface driver, each of said guest virtual machines bluetooth driver being connected to said interface driver, each of said interface drivers being in direct communication with an interface through a virtual machine manager, said interface being connected to said bluetooth device;
the bluetooth driver of the target client virtual machine is specifically configured to: and closing the connection with the interface driver of the target client virtual machine to realize closing the connection with the Bluetooth equipment.
6. The system of any of claims 1-5, wherein the bluetooth driver of the target guest virtual machine is further configured to: the bluetooth protocol stack is closed.
7. The system of claim 1, wherein the bluetooth switch control module of the guest virtual machine to be connected is further configured to:
and when the client virtual machine connected with the Bluetooth device does not exist, the Bluetooth device is connected.
8. The system according to any one of claims 1 or 7, wherein the bluetooth switch control module of the guest virtual machine to be connected is specifically configured to:
and calling the Bluetooth driver of the client virtual machine to be connected, and connecting with the Bluetooth equipment.
9. The system of claim 8, wherein the power management device comprises a bluetooth module power management module and at least two bluetooth power management back-end modules, each of the bluetooth power management back-end modules being connected to each other, the bluetooth module power management module being connected to the bluetooth device and each of the bluetooth power management back-end modules, each of the bluetooth power management back-end modules being connected to each of the bluetooth power management front-end modules in a one-to-one correspondence;
the Bluetooth driver of the to-be-connected client virtual machine sends a power-on instruction to a Bluetooth power management front-end module of the to-be-connected client virtual machine after receiving the call of a Bluetooth switch control module of the to-be-connected client virtual machine;
the Bluetooth power management front-end module of the to-be-connected client virtual machine is used for sending the power-on instruction to the Bluetooth power management back-end module connected with the power-on instruction after receiving the power-on instruction;
and the Bluetooth power management back-end module is connected with the Bluetooth power management front-end module of the client virtual machine to be connected and is used for controlling the Bluetooth module power management module to electrify the Bluetooth equipment after receiving the electrifying instruction and determining that the Bluetooth power management back-end module for controlling the Bluetooth module power management module does not exist.
10. The system of claim 8, wherein each of said guest virtual machines further comprises an interface driver, a bluetooth driver of each of said guest virtual machines being connected to said interface driver, each of said interface drivers being in direct communication with an interface through a virtual machine manager, said interface being connected to said bluetooth device;
the Bluetooth driver of the to-be-connected client virtual machine is specifically configured to: opening connection with an interface driver of the client virtual machine to be connected so as to realize connection with the Bluetooth equipment;
the Bluetooth driver of the to-be-connected client virtual machine is specifically configured to: the bluetooth protocol stack is initialized.
11. The system according to claim 1 or 7, wherein the bluetooth switch control module of the to-be-connected client virtual machine is further configured to update a bluetooth connection status after the to-be-connected client virtual machine connects to a bluetooth device.
CN202311300365.1A 2023-10-08 2023-10-08 Bluetooth equipment sharing system Pending CN117389682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311300365.1A CN117389682A (en) 2023-10-08 2023-10-08 Bluetooth equipment sharing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311300365.1A CN117389682A (en) 2023-10-08 2023-10-08 Bluetooth equipment sharing system

Publications (1)

Publication Number Publication Date
CN117389682A true CN117389682A (en) 2024-01-12

Family

ID=89467588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311300365.1A Pending CN117389682A (en) 2023-10-08 2023-10-08 Bluetooth equipment sharing system

Country Status (1)

Country Link
CN (1) CN117389682A (en)

Similar Documents

Publication Publication Date Title
US8521929B2 (en) Virtual serial port management system and method
CN102934085B (en) The system and method for switching between multiple environment in multi-environment operating system
CN101788845B (en) For performing the method and system of computer task reducing power consumption state
CN102473102A (en) System and method for initiating a multi-environment operating system
US20120019069A1 (en) Computer system and control method thereof
CN102023940B (en) CPCI (compact peripheral component interconnection) hot swapping system
CN107220192B (en) Electronic equipment, channel switching control method and control circuit
CN101539897B (en) Multi-computer switching device and operation method thereof
CN114153782B (en) Data processing system, method and storage medium
CN101236544A (en) Method and device for multiple USB master device for sharing USB slave device
CN109032888A (en) A kind of server start-up course fault detection method, device and controlled terminal
CN100542105C (en) Method that system mode is obtained in the multicomputer system and device
CN112269086A (en) Charging cable identification method and device, charging cable and readable storage medium
US7464133B1 (en) Server/client system
CN101770434A (en) Method and system for switching different function units in PCI device
CN108108314B (en) Exchanger system
CN117389682A (en) Bluetooth equipment sharing system
CN117407065A (en) Network card pre-start control method, device, equipment, system and storage medium
CN110764398B (en) Intelligent watch and mode switching method thereof
CN207424873U (en) network physical isolation computer and system
CN111522766A (en) Communication system, method, device, equipment and storage medium thereof
CN108055212B (en) Method and device compatible with PSE chip
EP2760157B1 (en) Method, device and system for backing up device information
CN112015690A (en) Intelligent device management method and device, network device and readable storage medium
CN108874504A (en) A kind of management method and device of multiple virtualization platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination