WO2023060956A1 - 蓝牙行为的模拟方法、装置和设备 - Google Patents

蓝牙行为的模拟方法、装置和设备 Download PDF

Info

Publication number
WO2023060956A1
WO2023060956A1 PCT/CN2022/105295 CN2022105295W WO2023060956A1 WO 2023060956 A1 WO2023060956 A1 WO 2023060956A1 CN 2022105295 W CN2022105295 W CN 2022105295W WO 2023060956 A1 WO2023060956 A1 WO 2023060956A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
service module
module
behavior
attribute information
Prior art date
Application number
PCT/CN2022/105295
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 北京字节跳动网络技术有限公司
Publication of WO2023060956A1 publication Critical patent/WO2023060956A1/zh

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a simulation method, device, equipment, electronic equipment, readable storage medium, computer program product and computer program of Bluetooth behavior.
  • the application (APP) under the Android system creates a Bluetooth service behavior (Bluetooth Service) when it needs to query the information of the Bluetooth device.
  • the Bluetooth service accesses the underlying hardware interface through the Native framework (Java Native Interface, JNI) to set and obtain Bluetooth data.
  • JNI Java Native Interface
  • the Bluetooth service behavior is completed through the Bluetooth component bluez.
  • the present disclosure provides a Bluetooth behavior simulation method, device, device, electronic device, readable storage medium, computer program product and computer program to solve one or more technical problems in the prior art.
  • a method for simulating Bluetooth behavior is provided, which is applied to an Android system including an event loop module and a first Bluetooth service module, and the event loop module is set at the hardware adaptation layer, including:
  • the first bluetooth service module creates the bluetooth device scanning behavior of the Java layer according to the bluetooth device information query request of the bluetooth application, so that the hardware adaptation layer bluetooth device scanning behavior is triggered; when the hardware adaptation layer bluetooth device scanning behavior is triggered, the event loop
  • the module creates a communication event for connecting with the second bluetooth service module of the second system, so as to trigger the second bluetooth service module to send a bluetooth device scanning request to the kernel layer of the second system.
  • a Bluetooth behavior simulation method is provided, which is applied to a Linux system including a process communication transfer module, a second Bluetooth service module and a Bluetooth controller driver, including:
  • the process communication transfer module receives the communication event sent by the first system for connecting with the second bluetooth service module, and sends the communication event to the second bluetooth service module; the second bluetooth service module sends the driver bluetooth control to the kernel layer of the Linux system
  • the device performs a Bluetooth device scan request.
  • a Bluetooth behavior simulation device which is applied to an Android system including an event loop module and a first Bluetooth service module, and the event loop module is set at the hardware adaptation layer, wherein:
  • the first bluetooth service module is used to create the Java layer bluetooth device scanning behavior according to the bluetooth device information query request of the bluetooth application, so that the hardware adaptation layer bluetooth device scan behavior is triggered; when the hardware adaptation layer bluetooth device scan behavior is triggered
  • the event loop module is used to create a communication event for connecting with the second bluetooth service module of the second system, so as to trigger the second bluetooth service module to send a bluetooth device scanning request to the kernel layer of the second system.
  • a Bluetooth behavior simulation device is provided, which is applied to a Linux system including a process communication transfer module, a second Bluetooth service module and a Bluetooth controller, wherein:
  • the process communication transfer module is used to receive the communication event sent by the first system for connecting with the second bluetooth service module, and sends the communication event to the second bluetooth service module; the second bluetooth service module is used to send the communication event to the Linux system
  • the kernel layer sends a request to drive the Bluetooth controller to scan for Bluetooth devices.
  • a system-compatible electronic device for audio driving including: a processor and a memory storing programs.
  • the program includes instructions which, when executed by the processor, cause the processor to perform a simulation method of Bluetooth behavior according to an embodiment of the present disclosure.
  • a computer-readable storage medium stores computer instructions for causing a computer to execute the Bluetooth behavior simulation method according to the embodiment of the present disclosure.
  • a computer program product including a computer program, and the computer program implements the above Bluetooth behavior simulation method when executed by a processor.
  • a computer program is provided.
  • the computer program is executed by a processor, the above Bluetooth behavior simulation method is realized.
  • the bluetooth behavior simulation scheme of the present disclosure by constructing a communication mechanism for bluetooth service with the Linux system in the JNI layer of the bluetooth framework of the Android system, the Linux system can be used to realize the function of the bluetooth behavior on the Android device and simulate the bluetooth behavior.
  • FIG. 1 is a schematic diagram of a system architecture for realizing a simulation function of an Android Bluetooth device according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a simulation method for Bluetooth behavior according to an embodiment of the present disclosure
  • FIG. 3 is a structural block diagram of a simulation device for Bluetooth behavior according to an embodiment of the present disclosure
  • FIG. 4 is a structural block diagram of a simulation device for Bluetooth behavior according to an embodiment of the present disclosure
  • FIG. 5 is a block diagram of an electronic device used to implement the Bluetooth behavior simulation method of the embodiment of the present disclosure.
  • the compatibility of Android application operation can be achieved by deploying the Android operating environment in the container.
  • LXC, LXD, Docker, etc. can be used to support the operation of the Android system environment and application in the container.
  • the Android operating system covers Android OS issued by Google, AOSP and various derivative systems based on AOSP, such as MIUI, EMUI, One UI, Hongmeng, etc.
  • the full name of the Linux system is the GNU/Linux operating system, such as Ubuntu, Debian, RedHat and the like.
  • the Linux operating system is not limited to running on a physical machine, but can also be an operating system hosted on other operating systems, such as WSL in the Windows system.
  • the embodiment of the present disclosure provides a simulation function for an Android Bluetooth device under a Linux system, and the specific system deployment architecture is shown in FIG. 1 .
  • an event loop module a first bluetooth service module and a bluetooth application (APP) are arranged in the Android system.
  • the event loop module is arranged on the hardware adaptation (JNI) layer, and is used to create a communication event connected with the second bluetooth service module of the Linux system; Standard components of the service, such as the bluetooth Service module; the Bluetooth application is used to initiate a Bluetooth device information query request to use the Bluetooth function.
  • JNI hardware adaptation
  • Standard components of the service such as the bluetooth Service module
  • the Bluetooth application is used to initiate a Bluetooth device information query request to use the Bluetooth function.
  • the Bluetooth application can be a Bluetooth setting and configuration option function module in Android, such as the Bluetooth function item in the Android setting menu; it can also be an App that needs to use the Bluetooth function, such as QQ music can use Bluetooth headset function.
  • a process communication relay module In the Linux system, a process communication relay module, a second bluetooth service module and a host controller interface (Host Controller Interface, HCI) are arranged at the system layer, and a driver program of the bluetooth controller is arranged at the kernel layer.
  • the process communication transfer module is used to receive the communication events sent by the Android system to carry out inter-process communication (Inter-Process Communication, IPC);
  • the second bluetooth service module is a standard component for providing bluetooth services in the Linux system, such as bluez module;
  • HCI is used to receive instructions from the second bluetooth service module and send it to the kernel layer to drive the bluetooth controller, while receiving data from the bluetooth controller and sending it to the second bluetooth service module;
  • the bluetooth controller is executed in the Linux system Standard devices for Bluetooth scanning behavior, such as the bluetooth controller in the Bluetooth subsystem of the Linux system.
  • BUS bus such as D-BUS
  • Binder such as D-BUS
  • network socket socket such as D-BUS
  • message queue MQ such as FIFOs (named pipes), shared memory, etc.
  • FIFOs named pipes
  • the system in Figure 1 realizes the simulation function of the Bluetooth device behavior of the Android system by bridging the second Bluetooth service module under the Linux system and the first Bluetooth service module of the Android system inside and outside the Android container of the Android system.
  • Step S201 The first Bluetooth service module of the Android system creates a Java layer Bluetooth device scanning behavior according to the Bluetooth device information query request of the Bluetooth application, so that the hardware adaptation layer Bluetooth device scanning behavior is triggered.
  • Step S202 When the hardware adaptation layer bluetooth device scanning behavior is triggered, the event loop module of the Android system creates a communication event for connecting with the second bluetooth service module of the second system, so as to trigger the second bluetooth service module to send a message to the second
  • the kernel layer of the system sends a Bluetooth device scan request.
  • Step S203 The Linux system receives the communication event for connecting with the second Bluetooth service module sent by the Android system through the process communication transfer module, and sends the communication event to the second Bluetooth service module.
  • Step S204 the second Bluetooth service module of the Linux system sends a request to drive the Bluetooth controller to scan the Bluetooth device to the kernel layer of the Linux system.
  • the Linux system can be used to implement the Bluetooth behavior function on the Android device and simulate the Bluetooth behavior.
  • the communication event connected with the second bluetooth service module can be created in the following manner, specifically, the JNI layer of the Android system is constructed to connect with the bluez under the Linux system by constructing the dbus message mechanism under the Linux system .
  • the event loop module will build a dbus event, and the specific format is as follows:
  • msg dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC, get_adapter_path(env, object), DBUS_ADAPTER_IFACE, "StartDiscovery”);
  • the event loop module creates a communication event connected to the second Bluetooth service module and forwards it to the second Bluetooth service module through the process communication transfer module, triggering the Bluetooth device scanning behavior StartDiscovery under the Linux system.
  • Bluez under the Linux system sends a real Bluetooth device scanning request to the Bluetooth controller through HCI.
  • the bluetooth controller receives the bluetooth device scanning request, executes the bluetooth device discovery behavior, obtains the attribute information of the discovered bluetooth device, and sends the attribute information to the second bluetooth service module; the second bluetooth service module
  • the first broadcast message is sent to notify the Android system, and the first broadcast message includes attribute information of the Bluetooth device discovered by the Bluetooth controller driven by the kernel layer.
  • the Android system receives the broadcast message sent by the Linux system through the event loop module.
  • the event loop module receives the first broadcast message sent by the second Bluetooth service module, and the event loop module sends the attribute information included in the first broadcast message to the first Bluetooth service module; the first Bluetooth service module The module notifies the Bluetooth application of the attribute information through broadcasting.
  • the Bluetooth controller when the attribute information of the Bluetooth device discovered by the Bluetooth controller changes, the Bluetooth controller sends the change information of the attribute information of the Bluetooth device found to the second Bluetooth service module; the second Bluetooth service module A second broadcast message is sent to notify the Android system, where the second broadcast message includes change information of the attribute information of the Bluetooth device discovered by the Bluetooth controller.
  • the Android system receives the broadcast message sent by the Linux system through the event loop module.
  • the event loop module receives the second broadcast message sent by the second Bluetooth service module, and the event loop module sends the change information to the first The bluetooth service module; the first bluetooth service module notifies the bluetooth application of the change information through broadcasting.
  • bluez under the Linux system receives the attribute information of the discovered Bluetooth device through a kernel event, and broadcasts the address, name, and pairing status of the discovered Bluetooth device through a dbus message Wait for the information to be sent to the outside world.
  • the dbus broadcast message of bluez is received by constructing an event loop module receiving linux dbus event at the JNI layer of the Android system.
  • the reception of the broadcast message of the Bluetooth device discovery event and the reception of the attribute change event are realized by analyzing and filtering the Linux dbus message.
  • the change message of the attribute information of the Bluetooth device is broadcast to the event loop module of the JNI layer of the Android system through the attribute change event.
  • the first bluetooth service module can perform bluetooth pairing with the bluetooth controller according to the received attribute information and change information.
  • the specific process is: the first bluetooth service module builds a discovery list of bluetooth devices according to the attribute information and change information , the discovery list includes at least one Bluetooth device to be paired; the first Bluetooth service module notifies the Bluetooth application of the discovery list by broadcasting, so as to realize the Bluetooth function of the Bluetooth application.
  • the first Bluetooth service module stores the device information of the Bluetooth device that has been paired with the Bluetooth application and the device information of the Bluetooth controller, and is used to communicate with the paired Bluetooth device.
  • a Bluetooth device makes a Bluetooth connection.
  • the attribute information of the Bluetooth device includes at least one of the address, name and pairing status of the Bluetooth device.
  • an embodiment of the present disclosure provides a simulation device for Bluetooth behavior, which is applied to an Android system, and includes an event loop module 301 and a first Bluetooth service module 302, and the event loop module 301 is set in Hardware adaptation layer, where:
  • the first bluetooth service module 302 is used to create the Java layer bluetooth device scanning behavior according to the bluetooth device information query request of the bluetooth application, so that the hardware adaptation layer bluetooth device scan behavior is triggered;
  • the event loop module 301 is used to create a communication event for connecting with the second bluetooth service module of the second system, so as to trigger the second bluetooth service module to send to the kernel of the second system Layer sends a Bluetooth device scan request.
  • the event loop module 301 is also used to:
  • the first broadcast message includes the attribute information of the bluetooth device found by the kernel layer driver bluetooth controller; send the attribute information to the first bluetooth service module 302;
  • the first bluetooth service module 302 is further configured to notify the bluetooth application of the attribute information through broadcasting.
  • the event loop module 301 is also used to:
  • the attribute information of the bluetooth device found by the bluetooth controller changes, receive the second broadcast message sent by the second bluetooth service module, which includes the change information of the attribute information of the bluetooth device found by the bluetooth controller; change The information is sent to the first bluetooth service module 302;
  • the first Bluetooth service module 302 is further configured to notify the Bluetooth application of the change information through broadcasting.
  • the first Bluetooth service module 302 is also used to:
  • the first Bluetooth service module 302 is also used to:
  • the device information of the Bluetooth device paired with the Bluetooth application and the device information of the Bluetooth controller are stored for Bluetooth connection with the paired Bluetooth device.
  • the attribute information of the Bluetooth device includes at least one of an address, a name and a pairing state of the Bluetooth device.
  • the embodiment of the present disclosure provides a simulation device for Bluetooth behavior, which is applied to a Linux system and includes a process communication transfer module 401, a second Bluetooth service module 402 and a Bluetooth controller. 403, where:
  • the process communication transfer module 401 is used to receive the communication event sent by the first system for connecting with the second Bluetooth service module 402, and send the communication event to the second Bluetooth service module 402;
  • the second bluetooth service module 402 is used for sending the drive bluetooth controller to carry out bluetooth device scanning request to the kernel layer of Linux system.
  • the bluetooth controller 403 is also used for:
  • the second bluetooth service module 402 is further configured to send a first broadcast message to notify the first system, the first broadcast message includes attribute information of the bluetooth device discovered by the kernel layer driver bluetooth controller.
  • the bluetooth controller 403 is also used for:
  • the second bluetooth service module 402 is further configured to send a second broadcast message to notify the first system, the second broadcast message includes change information of the attribute information of the bluetooth device discovered by the bluetooth controller.
  • the acquisition, storage and application of user personal information and device attribute information involved are in compliance with relevant laws and regulations, and do not violate public order and good customs.
  • the present disclosure also provides an electronic device, a readable storage medium, a computer program product and a computer program.
  • FIG. 5 shows a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure.
  • Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
  • the device 500 includes a computing unit 501 that can be loaded into a random access memory (Random Access Memory, RAM) according to a computer program stored in a read-only memory (Read-Only Memory, ROM) 502 or from a storage unit 508. ) 503 to execute various appropriate actions and processes. In the RAM 503, various programs and data necessary for the operation of the device 500 can also be stored.
  • the computing unit 501, ROM 502, and RAM 503 are connected to each other through a bus 504.
  • An input/output (Input/Output, I/O) interface 505 is also connected to the bus 504 .
  • the I/O interface 505 includes: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc. ; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, and the like.
  • the communication unit 509 allows the device 500 to exchange information/data with other devices over a computer network such as the Internet and/or various telecommunication networks.
  • the computing unit 501 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), various dedicated artificial intelligence (Artificial Intelligence, AI) computing chips, various operating The computing unit of the machine learning model algorithm, the digital signal processor (Digital Signal Processor, DSP), and any appropriate processor, controller, microcontroller, etc.
  • the calculation unit 501 executes various methods and processes described above, such as a simulation method of Bluetooth behavior.
  • the method for simulating Bluetooth behavior may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508 .
  • part or all of the computer program may be loaded and/or installed on the device 500 via the ROM 502 and/or the communication unit 509.
  • the computing unit 501 may be configured in any other appropriate way (for example, by means of firmware) to perform a simulation method of Bluetooth behavior.
  • programmable processor can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.
  • Program codes for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented.
  • the program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (Electrically Erasable Programmable Read-Only Memory, EPROM or flash memory (flash EPROM)), optical fiber, portable compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • EPROM Electrical Erasable Programmable Read-Only Memory
  • flash EPROM flash EPROM
  • optical fiber Portable compact disc read-only memory
  • CD-ROM Compact Disc Read-Only Memory
  • optical storage devices magnetic storage devices, or any suitable combination of the above.
  • the systems and techniques described herein can be implemented on a computer having a display device (e.g., a Cathode-Ray Tube (CRT) or a liquid crystal display) for displaying information to the user. (Liquid Crystal Display, LCD) monitor); and a keyboard and pointing device (such as a mouse or trackball) through which the user can provide input to the computer.
  • a display device e.g., a Cathode-Ray Tube (CRT) or a liquid crystal display
  • LCD Liquid Crystal Display
  • keyboard and pointing device such as a mouse or trackball
  • Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.
  • the systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (Wide Area Network, WAN), and the Internet.
  • a computer system may include clients and servers.
  • Clients and servers are generally remote from each other and typically interact through a communication network.
  • the relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
  • the server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
  • steps may be reordered, added or deleted using the various forms of flow shown above.
  • each step described in the present disclosure may be executed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in the present disclosure can be achieved, no limitation is imposed herein.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本公开提供了一种蓝牙行为的模拟方法、装置、设备、电子设备、可读存储介质、计算机程序产品及计算机程序,应用于包括事件循环模块和第一蓝牙服务模块的安卓***,事件循环模块设置在硬件适配层,包括:第一蓝牙服务模块根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发;在硬件适配层蓝牙设备扫描行为被触发时,事件循环模块创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求,这样能够利用Linux***在安卓设备上实现蓝牙行为的功能,模拟蓝牙行为。

Description

蓝牙行为的模拟方法、装置和设备
相关申请的交叉引用
本公开要求于2021年10月14日提交的申请号为202111198931.3、名称为“蓝牙行为的模拟方法、装置和设备”的中国专利申请的优先权,此申请的内容通过引用并入本文。
技术领域
本公开涉及计算机技术领域,尤其涉及蓝牙行为的模拟方法、装置、设备、电子设备、可读存储介质、计算机程序产品及计算机程序。
背景技术
安卓(Android)***下的应用(APP)在需要查询蓝牙设备信息的情况下,创建蓝牙服务行为(Bluetooth Service)。蓝牙服务通过Native框架(Java Native Interface,JNI)访问底层硬件接口来设置和获取蓝牙数据。在Linux***中,蓝牙服务行为通过蓝牙组件bluez完成。
在Linux***中,通过在容器中部署Android运行环境可以实现Android应用运行的兼容。但是,未发现相关技术中存在Linux***下实现对安卓蓝牙设备的模拟功能的相关解决方案。
发明内容
本公开提供了一种蓝牙行为的模拟方法、装置、设备、电子设备、可读存储介质、计算机程序产品及计算机程序,以解决现有技术中的一个或多个技术问题。
根据本公开的一方面,提供了一种蓝牙行为的模拟方法,应用于包括事件循环模块和第一蓝牙服务模块的安卓***,事件循环模块设置在硬件适配层,包括:
第一蓝牙服务模块根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发;在硬件适配层蓝牙设备扫描行为被触发时,事件循环模块创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求。
根据本公开的另一方面,提供了一种蓝牙行为的模拟方法,应用于包括进程通信中转模块、第二蓝牙服务模块和蓝牙控制器驱动的Linux***,包括:
进程通信中转模块接收第一***发送的用于与第二蓝牙服务模块连接的通信事件,并将通信事件发送给第二蓝牙服务模块;第二蓝牙服务模块向Linux***的内核层发送驱动蓝牙控制器进行蓝牙设备扫描请求。
根据本公开的另一方面,提供了一种蓝牙行为的模拟装置,应用于包括事件循环模块和第一蓝牙服务模块的安卓***,事件循环模块设置在硬件适配层,其中:
第一蓝牙服务模块,用于根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发;在硬件适配层蓝牙设备扫描行为被触发时,事件循环模块用于创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求。
根据本公开的另一方面,提供了一种蓝牙行为的模拟装置,应用于包括进程通信中转模块、第二蓝牙服务模块和蓝牙控制器的Linux***,其中:
进程通信中转模块,用于接收第一***发送的用于与第二蓝牙服务模块连接的通信事件,并将通信事件发送给第二蓝牙服务模块;第二蓝牙服务模块,用于向Linux***的内核层发送驱动蓝牙控制器进行蓝牙设备扫描请求。
根据本公开的另一方面,提供了一种用于音频驱动的***兼容的电子设备,包括:处理器和存储程序的存储器。程序包括指令,指令在由处理器执行时使处理器执行根据本公开实施例的蓝牙行为的模拟方法。
根据本公开的另一方面,提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机指令,计算机指令用于使计算机执行根据本公开实施例的蓝牙行为的模拟方法。
根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现如上的蓝牙行为的模拟方法。
根据本公开的另一方面,提供了一种计算机程序,该计算机程序被处理器执行时实现如上的蓝牙行为的模拟方法。
根据本公开的蓝牙行为的模拟方案,通过在安卓***的蓝牙框架的JNI层构建与Linux***进行蓝牙服务的通信机制,能够利用Linux***在安卓设备上实现蓝牙行为的功能,模拟蓝牙行为。
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。
附图说明
附图用于更好地理解本方案,不构成对本公开的限定。其中:
图1是根据本公开实施例的实现对安卓蓝牙设备的模拟功能的***架构示意图;
图2是根据本公开实施例的蓝牙行为的模拟方法流程图;
图3是根据本公开实施例的蓝牙行为的模拟装置结构框图;
图4是根据本公开实施例的蓝牙行为的模拟装置结构框图;
图5是用来实现本公开实施例的蓝牙行为的模拟方法的电子设备的框图。
具体实施方式
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
在Linux***中,通过在容器中部署Android运行环境可以实现Android应用运行的兼容,在技术实现上可以通过LXC、LXD、Docker等实现在容器中支持Android***环境和应用的运行。
在下述实施例中,安卓操作***(Android),涵盖Google发行的Android OS以及AOSP和基于AOSP的各种衍生***,如MIUI、EMUI、One UI、鸿蒙等。
在下述实施例中,Linux***,全称GNU/Linux操作***,如Ubuntu、Debian、RedHat等。Linux操作***并不限定是运行在物理机上的,也可以是托管在其它操作***上的操作***,例如Windows***中的WSL。
本公开实施例提供了一种在Linux***下实现对安卓蓝牙设备的模拟功能,具体的***部署架构参阅图1所示。
请参阅图1所示,安卓***中设置有事件循环模块、第一蓝牙服务模块和蓝牙应用(APP)。其中,事件循环模块设置在硬件适配(JNI)层,用于创建与Linux***的第二蓝牙服务模块连接的通信事件;第一蓝牙服务模块为安卓***中设置在Java层的用于提供蓝牙服务的标准组件,例如bluetooth Service模块;蓝牙应用用于发起蓝牙设备信息查询请求,以使用蓝牙功能。
在本公开实施例中,蓝牙应用既可以是Android中的蓝牙设置和配置选项功能模块,例如Android的设置菜单中的蓝牙功能项目;也可以是需要使用到蓝牙功能的App,例如QQ音乐可以使用蓝牙耳机功能。
Linux***中在***层设置有进程通信中转模块、第二蓝牙服务模块和主机控制器接口(Host Controller Interface,HCI),在内核层设置有蓝牙控制器的驱动程序。其中,进程通信中转模块用于接收安卓***发送的通信事件,以进行进程间通信(Inter-Process Communication,IPC);第二蓝牙服务模块为Linux***中的用于提供蓝牙服务的标准组件,例如bluez模块;HCI用于从第二蓝牙服务模块接收到指令发送给内核层以驱动蓝牙控制器,同时接收来自蓝 牙控制器的数据,发送给第二蓝牙服务模块;蓝牙控制器为Linux***中执行蓝牙扫描行为的标准器件例如Linux***的蓝牙子***中的bluetooth controller。
在本公开实施例中,可以有多种方式支持进程通信中转模块实现进程间通讯,包括但不限于BUS总线(如D-BUS)、Binder、网络套接字Socket、消息队列MQ、FIFOs(命名管道)、共享内存等。
图1的***通过在安卓***的安卓容器内外对Linux***下的第二蓝牙服务模块和安卓***的第一蓝牙服务模块进行桥接,实现对安卓***的蓝牙设备行为的模拟功能。
基于图1所示的***架构,请参阅图2所示,本公开实施例提供一种蓝牙行为的模拟方法,具体流程如下:
步骤S201:安卓***的第一蓝牙服务模块根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发。
步骤S202:在硬件适配层蓝牙设备扫描行为被触发时,安卓***的事件循环模块创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求。
步骤S203:Linux***通过进程通信中转模块接收安卓***发送的用于与第二蓝牙服务模块连接的通信事件,并将通信事件发送给第二蓝牙服务模块。
步骤S204:Linux***的第二蓝牙服务模块向Linux***的内核层发送驱动蓝牙控制器进行蓝牙设备扫描请求。
由此可知,通过在安卓***的蓝牙框架的JNI层构建与Linux***进行蓝牙服务的通信机制,能够利用Linux***在安卓设备上实现蓝牙行为的功能,模拟蓝牙行为。
本公开实施例中可以通过如下方式创建与第二蓝牙服务模块连接的通信事件,具体的,在安卓***的JNI层通过构建与Linux***下的dbus消息机制来构建与Linux***下的bluez的连接。当JNI层的设备扫描行为Start Discovery Native触发,事件循环模块会构建dbus事件,具体格式如下所示:
msg=dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC,get_adapter_path(env,object),DBUS_ADAPTER_IFACE,“StartDiscovery”);
本公开实施例中,事件循环模块创建与第二蓝牙服务模块连接的通信事件后通过进程通信中转模块转发给第二蓝牙服务模块,触发Linux***下的蓝牙设备扫描行为StartDiscovery。Linux***下的bluez通过HCI向蓝牙控制器发送真正的蓝牙设备扫描请求。
在一种可能的实施方式中,蓝牙控制器接收蓝牙设备扫描请求,执行蓝牙设备发现行为,获取发现的蓝牙设备的属性信息,并将属性信息发送给第二蓝牙服务模块;第二蓝牙服务模 块发送第一广播消息以通知安卓***,第一广播消息中包括内核层驱动蓝牙控制器发现的蓝牙设备的属性信息。
由于本公开中安卓***通过事件循环模块接收Linux***发送的广播消息。在一种可能的实施方式中,事件循环模块接收第二蓝牙服务模块发送的第一广播消息,事件循环模块将第一广播消息中包括的属性信息发送给第一蓝牙服务模块;第一蓝牙服务模块将属性信息通过广播方式通知蓝牙应用。
在一种可能的实现方式中,在蓝牙控制器发现的蓝牙设备的属性信息发生变更时,蓝牙控制器向第二蓝牙服务模块发送发现的蓝牙设备的属性信息的变化信息;第二蓝牙服务模块向发送第二广播消息以通知安卓***,第二广播消息中包括蓝牙控制器发现的蓝牙设备的属性信息的变化信息。
由于本公开中安卓***通过事件循环模块接收Linux***发送的广播消息。在一种可能的实施方式中,在蓝牙控制器发现的蓝牙设备的属性信息发生变更时,事件循环模块接收第二蓝牙服务模块发送的第二广播消息,事件循环模块将变化信息发送给第一蓝牙服务模块;第一蓝牙服务模块将变化信息通过广播方式通知蓝牙应用。
本公开实施例中,当蓝牙控制器发现蓝牙设备时,Linux***下的bluez通过内核事件收到发现的蓝牙设备的属性信息,并通过dbus广播消息将发现的蓝牙设备的地址,名称,配对状态等信息对外发送。
进一步的,通过在Android***的JNI层构建接收linux dbus事件的事件循环模块来接收bluez的dbus广播消息。通过对Linux dbus消息的解析过滤实现对蓝牙设备发现事件的广播消息的接收,以及属性变化事件的接收。为了减小每次蓝牙设备的属性信息频繁变更导致的数据发送性能的损耗,蓝牙设备的属性信息的变更消息通过属性变化事件广播到Android***的JNI层的事件循环模块。
通过上述过程第一蓝牙服务模块根据能够根据接收到的属性信息和变化信息,与蓝牙控制器进行蓝牙配对,具体过程为:第一蓝牙服务模块根据属性信息和变化信息,构建蓝牙设备的发现列表,发现列表包括至少一个待配对的蓝牙设备;第一蓝牙服务模块将发现列表通过广播方式通知蓝牙应用,以实现蓝牙应用的蓝牙功能。
在蓝牙控制器与蓝牙设备配对成功,实现蓝牙连接后,可选的,第一蓝牙服务模块存储与蓝牙应用已配对的蓝牙设备的设备信息和蓝牙控制器的设备信息,用于与已配对的蓝牙设备进行蓝牙连接。
示例性的,蓝牙设备的属性信息包括蓝牙设备的地址,名称和配对状态中的至少一种。
基于相同的发明构思,请参阅图3,本公开实施例提供一种蓝牙行为的模拟装置,该装 置应用于安卓***,包括事件循环模块301和第一蓝牙服务模块302,事件循环模块301设置在硬件适配层,其中:
第一蓝牙服务模块302,用于根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发;
在硬件适配层蓝牙设备扫描行为被触发时,事件循环模块301用于创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求。
在一种可能的实现方式中,事件循环模块301还用于:
接收第二蓝牙服务模块发送的第一广播消息,第一广播消息中包括内核层驱动蓝牙控制器发现的蓝牙设备的属性信息;将属性信息发送给第一蓝牙服务模块302;
第一蓝牙服务模块302,还用于将属性信息通过广播方式通知蓝牙应用。
在一种可能的实现方式中,事件循环模块301还用于:
在蓝牙控制器发现的蓝牙设备的属性信息发生变更时,接收第二蓝牙服务模块发送的第二广播消息,第二广播消息中包括蓝牙控制器发现的蓝牙设备的属性信息的变化信息;将变化信息发送给第一蓝牙服务模块302;
第一蓝牙服务模块302,还用于将变化信息通过广播方式通知蓝牙应用。
在一种可能的实现方式中,第一蓝牙服务模块302还用于:
根据属性信息和变化信息,构建蓝牙设备的发现列表,发现列表包括至少一个待配对的蓝牙设备;
将发现列表通过广播方式通知蓝牙应用,以实现蓝牙应用的蓝牙功能。
在一种可能的实现方式中,第一蓝牙服务模块302还用于:
存储与蓝牙应用已配对的蓝牙设备的设备信息和蓝牙控制器的设备信息,用于与已配对的蓝牙设备进行蓝牙连接。
在一种可能的实现方式中,蓝牙设备的属性信息包括蓝牙设备的地址,名称和配对状态中的至少一种。
基于相同的发明构思,请参阅图4所示,本公开实施例提供一种蓝牙行为的模拟装置,该装置应用于Linux***,包括进程通信中转模块401、第二蓝牙服务模块402和蓝牙控制器403,其中:
进程通信中转模块401,用于接收第一***发送的用于与第二蓝牙服务模块402连接的通信事件,并将通信事件发送给第二蓝牙服务模块402;
第二蓝牙服务模块402,用于向Linux***的内核层发送驱动蓝牙控制器进行蓝牙设备扫 描请求。
在一种可能的实现方式中,蓝牙控制器403还用于:
接收蓝牙设备扫描请求,执行蓝牙设备发现行为,获取发现的蓝牙设备的属性信息,并将属性信息发送给第二蓝牙服务模块402;
第二蓝牙服务模块402,还用于发送第一广播消息以通知第一***,第一广播消息中包括内核层驱动蓝牙控制器发现的蓝牙设备的属性信息。
在一种可能的实现方式中,蓝牙控制器403还用于:
在蓝牙控制器发现的蓝牙设备的属性信息发生变更时,向第二蓝牙服务模块402发送发现的蓝牙设备的属性信息的变化信息;
第二蓝牙服务模块402,还用于向发送第二广播消息以通知第一***,第二广播消息中包括蓝牙控制器发现的蓝牙设备的属性信息的变化信息。
本公开的技术方案中,所涉及的用户个人信息和设备的属性信息的获取,存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质、一种计算机程序产品及计算机程序。
图5示出了可以用来实施本公开的实施例的示例电子设备500的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。
如图5所示,设备500包括计算单元501,其可以根据存储在只读存储器(Read-Only Memory,ROM)502中的计算机程序或者从存储单元508加载到随机访问存储器(Random Access Memory,RAM)503中的计算机程序,来执行各种适当的动作和处理。在RAM 503中,还可存储设备500操作所需的各种程序和数据。计算单元501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(Input/Output,I/O)接口505也连接至总线504。
设备500中的多个部件连接至I/O接口505,包括:输入单元506,例如键盘、鼠标等;输出单元507,例如各种类型的显示器、扬声器等;存储单元508,例如磁盘、光盘等;以及通信单元509,例如网卡、调制解调器、无线通信收发机等。通信单元509允许设备500通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。
计算单元501可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元501 的一些示例包括但不限于中央处理单元(Central Processing Unit,CPU)、图形处理单元(Graphics Processing Unit,GPU)、各种专用的人工智能(Artificial Intelligence,AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(Digital Signal Processor,DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元501执行上文所描述的各个方法和处理,例如蓝牙行为的模拟方法。例如,在一些实施例中,蓝牙行为的模拟方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元508。在一些实施例中,计算机程序的部分或者全部可以经由ROM 502和/或通信单元509而被载入和/或安装到设备500上。当计算机程序加载到RAM 503并由计算单元501执行时,可以执行上文描述的蓝牙行为的模拟方法的一个或多个步骤。备选地,在其他实施例中,计算单元501可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行蓝牙行为的模拟方法。
本文中以上描述的***和技术的各种实施方式可以在数字电子电路***、集成电路***、场可编程门阵列(Field-Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Product,ASSP)、芯片上***的***(System on Chip,SOC)、负载可编程逻辑设备(Load programmable logic device,CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程***上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储***、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储***、该至少一个输入装置、和该至少一个输出装置。
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行***、装置或设备使用或与指令执行***、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体***、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EPROM或快闪存储器(flash EPROM))、光纤、 便捷式紧凑盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
为了提供与用户的交互,可以在计算机上实施此处描述的***和技术,该计算机具有:用于向用户显示信息的显示装置(例如,阴极射线管(Cathode-Ray Tube,CRT)或者液晶显示器(Liquid Crystal Display,LCD)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的***和技术实施在包括后台部件的计算***(例如,作为数据服务器)、或者包括中间件部件的计算***(例如,应用服务器)、或者包括前端部件的计算***(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的***和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算***中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将***的部件相互连接。通信网络的示例包括:局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)和互联网。
计算机***可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式***的服务器,或者是结合了区块链的服务器。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。

Claims (15)

  1. 一种蓝牙行为的模拟方法,其特征在于,应用于包括事件循环模块和第一蓝牙服务模块的安卓***,所述事件循环模块设置在硬件适配层,包括:
    所述第一蓝牙服务模块根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发;
    在所述硬件适配层蓝牙设备扫描行为被触发时,所述事件循环模块创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发所述第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求。
  2. 根据权利要求1所述的方法,其特征在于,还包括:
    所述事件循环模块接收所述第二蓝牙服务模块发送的第一广播消息,所述第一广播消息中包括所述内核层驱动蓝牙控制器发现的蓝牙设备的属性信息;
    所述事件循环模块将所述属性信息发送给所述第一蓝牙服务模块;
    所述第一蓝牙服务模块将所述属性信息通过广播方式通知所述蓝牙应用。
  3. 根据权利要求2所述的方法,其特征在于,还包括:
    在所述蓝牙控制器发现的蓝牙设备的属性信息发生变更时,所述事件循环模块接收所述第二蓝牙服务模块发送的第二广播消息,所述第二广播消息中包括所述蓝牙控制器发现的蓝牙设备的属性信息的变化信息;
    所述事件循环模块将所述变化信息发送给所述第一蓝牙服务模块;
    所述第一蓝牙服务模块将所述变化信息通过广播方式通知所述蓝牙应用。
  4. 根据权利要求3所述的方法,其特征在于,还包括:
    所述第一蓝牙服务模块根据所述属性信息和所述变化信息,构建蓝牙设备的发现列表,所述发现列表包括至少一个待配对的蓝牙设备;
    所述第一蓝牙服务模块将所述发现列表通过广播方式通知所述蓝牙应用,以实现所述蓝牙应用的蓝牙功能。
  5. 根据权利要求2~4中任一项所述的方法,其特征在于,还包括:
    所述第一蓝牙服务模块存储与所述蓝牙应用已配对的蓝牙设备的设备信息和所述蓝牙控制器的设备信息,用于与所述已配对的蓝牙设备进行蓝牙连接。
  6. 根据权利要求2~5中任一项所述的方法,其特征在于,蓝牙设备的属性信息包括蓝牙设备的地址,名称和配对状态中的至少一种。
  7. 一种蓝牙行为的模拟方法,其特征在于,应用于包括进程通信中转模块、第二蓝牙服务模块和蓝牙控制器驱动的Linux***,包括:
    所述进程通信中转模块接收第一***发送的用于与所述第二蓝牙服务模块连接的通信事件,并将所述通信事件发送给所述第二蓝牙服务模块;
    所述第二蓝牙服务模块向Linux***的内核层发送驱动所述蓝牙控制器进行蓝牙设备扫描请求。
  8. 根据权利要求7所述的方法,其特征在于,还包括:
    所述蓝牙控制器接收所述蓝牙设备扫描请求,执行蓝牙设备发现行为,获取发现的蓝牙设备的属性信息,并将所述属性信息发送给所述第二蓝牙服务模块;
    所述第二蓝牙服务模块发送第一广播消息以通知所述第一***,所述第一广播消息中包括所述内核层驱动所述蓝牙控制器发现的蓝牙设备的属性信息。
  9. 根据权利要求8所述的方法,其特征在于,还包括:
    在所述蓝牙控制器发现的蓝牙设备的属性信息发生变更时,所述蓝牙控制器向所述第二蓝牙服务模块发送发现的蓝牙设备的属性信息的变化信息;
    所述第二蓝牙服务模块向发送第二广播消息以通知所述第一***,所述第二广播消息中包括所述蓝牙控制器发现的蓝牙设备的属性信息的变化信息。
  10. 一种蓝牙行为的模拟装置,其特征在于,应用于包括事件循环模块和第一蓝牙服务模块的安卓***,所述事件循环模块设置在硬件适配层,包括:
    所述第一蓝牙服务模块,用于根据蓝牙应用的蓝牙设备信息查询请求,创建Java层蓝牙设备扫描行为,以使硬件适配层蓝牙设备扫描行为触发;
    在所述硬件适配层蓝牙设备扫描行为被触发时,所述事件循环模块用于创建用于与第二***的第二蓝牙服务模块连接的通信事件,以触发所述第二蓝牙服务模块向第二***的内核层发送蓝牙设备扫描请求。
  11. 一种蓝牙行为的模拟装置,其特征在于,应用于包括进程通信中转模块、第二蓝牙服务模块和蓝牙控制器驱动的Linux***,包括:
    所述进程通信中转模块,用于接收第一***发送的用于与所述第二蓝牙服务模块连接的通信事件,并将所述通信事件发送给所述第二蓝牙服务模块;
    所述第二蓝牙服务模块,用于向Linux***的内核层发送驱动所述蓝牙控制器进行蓝牙设备扫描请求。
  12. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1~9中任一项所述的方法。
  13. 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行根据权利要求1~9中任一项所述的方法。
  14. 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1~9中任一项所述的方法。
  15. 一种计算机程序,其特征在于,所述计算机程序在被处理器执行时实现根据权利要求1~9中任一项所述的方法。
PCT/CN2022/105295 2021-10-14 2022-07-12 蓝牙行为的模拟方法、装置和设备 WO2023060956A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111198931.3 2021-10-14
CN202111198931.3A CN113950034B (zh) 2021-10-14 2021-10-14 蓝牙行为的模拟方法、装置和设备

Publications (1)

Publication Number Publication Date
WO2023060956A1 true WO2023060956A1 (zh) 2023-04-20

Family

ID=79329868

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/105295 WO2023060956A1 (zh) 2021-10-14 2022-07-12 蓝牙行为的模拟方法、装置和设备

Country Status (2)

Country Link
CN (1) CN113950034B (zh)
WO (1) WO2023060956A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113950034B (zh) * 2021-10-14 2024-04-26 北京字节跳动网络技术有限公司 蓝牙行为的模拟方法、装置和设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105846859A (zh) * 2015-01-12 2016-08-10 芋头科技(杭州)有限公司 一种嵌入式操作***实现蓝牙从设备功能的***及方法
CN107509161A (zh) * 2017-08-25 2017-12-22 精赟智能科技(上海)有限公司 智能蓝牙控制***及方法
US20190342737A1 (en) * 2018-05-04 2019-11-07 Linctronix Ltd. Remote bluetooth communication system
CN110933614A (zh) * 2019-10-12 2020-03-27 阿里巴巴集团控股有限公司 通信处理方法、装置及电子设备
CN113950034A (zh) * 2021-10-14 2022-01-18 北京鲸鲮信息***技术有限公司 蓝牙行为的模拟方法、装置和设备

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203352799U (zh) * 2013-06-06 2013-12-18 肇庆市云能数码科技有限公司 网络移动计算终端及***
US10924904B2 (en) * 2014-12-02 2021-02-16 Lg Electronics Inc. Method and apparatus for performing object transfer service by using bluetooth communication in wireless communication system
US9838507B2 (en) * 2015-06-22 2017-12-05 Dell Products L.P. System and method for providing redirection of Bluetooth devices
CN104967971B (zh) * 2015-06-26 2018-04-27 飞天诚信科技股份有限公司 一种实现Android***下蓝牙自动回连的方法
CN106095413B (zh) * 2016-05-31 2019-09-17 青岛海信电器股份有限公司 一种蓝牙驱动程序的配置方法及装置
US11039486B2 (en) * 2017-02-02 2021-06-15 Hypori Llc System, method and computer program product for secure bluetooth cryptography in a virtual mobile device platform
CN107395297A (zh) * 2017-07-07 2017-11-24 广州视源电子科技股份有限公司 一种WiFi热点的信道选择方法、***及存储介质
WO2019028680A1 (zh) * 2017-08-08 2019-02-14 华为技术有限公司 一种广播事件处理方法及设备
CN108124475B (zh) * 2017-12-29 2022-05-20 达闼机器人股份有限公司 虚拟***蓝牙通信方法及装置、虚拟***、存储介质及电子设备
CN108319480A (zh) * 2018-02-01 2018-07-24 微鲸科技有限公司 蓝牙服务启动方法、装置及电子设备
CN111557097B (zh) * 2018-05-29 2022-04-05 华为技术有限公司 一种虚拟遥控器中电源键的控制方法及终端
KR20200042793A (ko) * 2018-10-16 2020-04-24 삼성전자주식회사 복수의 운영체제들을 실행하는 전자장치 및 그 제어 방법
CN112789934B (zh) * 2018-12-25 2023-04-18 华为技术有限公司 一种蓝牙服务的查询方法及电子设备
CN110188848A (zh) * 2019-05-29 2019-08-30 江苏智联天地科技有限公司 一种基于Android设备的激光扫码数据Bluetooth HID***及方法
CN112394906B (zh) * 2019-08-15 2022-10-25 华为技术有限公司 一种应用切换运行的方法及设备
CN112559199A (zh) * 2019-09-24 2021-03-26 中兴通讯股份有限公司 在glibc环境下控制安卓蓝牙的装置、方法及终端设备
CN112203132A (zh) * 2020-11-13 2021-01-08 四川长虹电器股份有限公司 一种安卓智能电视开机快速回连蓝牙遥控器的方法
CN113099429B (zh) * 2021-03-06 2023-06-27 深圳市智之祺科技有限公司 基于Android平台的蓝牙主从模式切换***和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105846859A (zh) * 2015-01-12 2016-08-10 芋头科技(杭州)有限公司 一种嵌入式操作***实现蓝牙从设备功能的***及方法
CN107509161A (zh) * 2017-08-25 2017-12-22 精赟智能科技(上海)有限公司 智能蓝牙控制***及方法
US20190342737A1 (en) * 2018-05-04 2019-11-07 Linctronix Ltd. Remote bluetooth communication system
CN110933614A (zh) * 2019-10-12 2020-03-27 阿里巴巴集团控股有限公司 通信处理方法、装置及电子设备
CN113950034A (zh) * 2021-10-14 2022-01-18 北京鲸鲮信息***技术有限公司 蓝牙行为的模拟方法、装置和设备

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
F. DUARTE ; S. WONG: "Profiling Bluetooth and Linux on the Xilinx Virtex II Pro", DIGITAL SYSTEM DESIGN: ARCHITECTURES, METHODS AND TOOLS, 2006. DSD 200 6. 9TH EUROMICRO CONFERENCE ON, IEEE, PI, 1 January 2006 (2006-01-01), Pi , pages 229 - 235, XP031102287, ISBN: 978-0-7695-2609-6 *
LEI PENG ; HAN TINGTING: "Design of the embedded bluetooth server for mobile terminals", COMPUTER SCIENCE AND INFORMATION TECHNOLOGY (ICCSIT), 2010 3RD IEEE INTERNATIONAL CONFERENCE ON, IEEE, PISCATAWAY, NJ, USA, 9 July 2010 (2010-07-09), Piscataway, NJ, USA , pages 149 - 152, XP031748038, ISBN: 978-1-4244-5537-9 *

Also Published As

Publication number Publication date
CN113950034B (zh) 2024-04-26
CN113950034A (zh) 2022-01-18

Similar Documents

Publication Publication Date Title
WO2023284653A1 (zh) 音频驱动的***兼容的方法、装置和设备
US9071625B2 (en) Cross-environment event notification
CN110032512B (zh) 一种小程序的调试方法、相关设备及终端
WO2023109138A1 (zh) Linux***中启动安卓应用的方法、装置和电子设备
US10547999B2 (en) Data transmission method and apparatus
KR20130096059A (ko) 원격의 싱크 장치를 표시하는 방법, 이를 위한 소스 장치 및 시스템
WO2020000445A1 (zh) 一种浏览应用文件夹的方法及电子设备
US10404568B2 (en) Agent manager for distributed transaction monitoring system
WO2015176352A1 (zh) 一种基于安卓***的应用间信息交互方法及装置
EP4119207A1 (en) Vibration control method and apparatus, and electronic device and computer-readable storage medium
WO2023060956A1 (zh) 蓝牙行为的模拟方法、装置和设备
CN112882709A (zh) 基于容器引擎***的渲染方法、装置、设备以及存储介质
KR20220151585A (ko) 업무 데이터 처리 방법, 장치, 전자 기기, 저장 매체 및 컴퓨터 프로그램
WO2023082716A1 (zh) 在Linux***中操作安卓应用的方法、装置和设备
WO2022179034A1 (zh) 自动化测试方法、装置、电子设备及存储介质
KR20230079348A (ko) 클라우드 코드 개발 시스템, 방법, 장치, 기기 및 저장 매체
US10261937B2 (en) Method and system for communication of device information
CN113840271B (zh) 一种nfc数据的传输方法、装置、电子设备及存储介质
JP2023519774A (ja) 自動化テスト方法、装置、電子デバイス、記憶媒体、及びプログラム
WO2023088199A1 (zh) 传感器设备适配的方法、装置、电子设备和存储介质
US20220311662A1 (en) Network configuring method for cloud mobile phone, device and storage medium
CN113617020B (zh) 游戏控制方法、装置、存储介质、服务器以及终端
US10620964B2 (en) System and method for software plug and play
WO2018121652A1 (zh) 通过用户设备中的应用连接无线接入点的方法与设备
WO2015192671A1 (zh) 一种电视界面交互方法、装置及机顶盒

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE