CN111427617B - Data processing method, device and equipment - Google Patents

Data processing method, device and equipment Download PDF

Info

Publication number
CN111427617B
CN111427617B CN201910020581.8A CN201910020581A CN111427617B CN 111427617 B CN111427617 B CN 111427617B CN 201910020581 A CN201910020581 A CN 201910020581A CN 111427617 B CN111427617 B CN 111427617B
Authority
CN
China
Prior art keywords
protocol stack
data
blue
control interface
host control
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.)
Active
Application number
CN201910020581.8A
Other languages
Chinese (zh)
Other versions
CN111427617A (en
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.)
Banma Zhixing Network Hongkong Co Ltd
Original Assignee
Banma Zhixing Network Hongkong 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 Banma Zhixing Network Hongkong Co Ltd filed Critical Banma Zhixing Network Hongkong Co Ltd
Priority to CN201910020581.8A priority Critical patent/CN111427617B/en
Publication of CN111427617A publication Critical patent/CN111427617A/en
Application granted granted Critical
Publication of CN111427617B publication Critical patent/CN111427617B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Communication Control (AREA)

Abstract

The invention provides a data processing method, a device, equipment and a storage medium, which can realize that a first protocol stack (such as bluze) is adapted to a corresponding drive of a second protocol stack (such as bluedroid). Registering a virtual host control interface in the kernel, the virtual host control interface being for communicating with the first protocol stack; monitoring the virtual host control interface, analyzing the monitored first data from the first protocol stack into data adapted to the drive corresponding to the second protocol stack, sending the analyzed data to the drive corresponding to the second protocol stack, and/or monitoring the drive corresponding to the second protocol stack, analyzing the monitored second data from the hardware module into data adapted to the first protocol stack, and sending the analyzed data to the virtual host control interface. Therefore, the upper protocol stack and the lower hardware module can be communicated without the drive carried by the upper protocol stack and the lower hardware module, and the dependence of hardware manufacturers is reduced.

Description

Data processing method, device and equipment
Technical Field
The present invention relates to the field of communications, and in particular, to a data processing method, apparatus, device, and storage medium.
Background
Generally, different protocol stacks need to be collocated with different drivers. However, with the continuous alternation of communication technology, the protocol stack in the communication field is also continuously updated, which requires hardware manufacturers to provide source codes or drive under specific scenes according to the protocol stack used by the system.
Taking a bluetooth protocol stack as an example, the bluetooth protocol stack mainly comprises two kinds of blue and blue. The architecture of blue is already well defined, so the bluetooth vendor that needs to be adapted can provide bluetooth drivers for blue and register the HCI interface for blue, so the underlying drivers are more dependent on vendor support. blue is the bluetooth protocol stack used in the android system, and most vendors currently only support or only provide standard drivers for blue. This results in different protocol stacks being required to match different bluetooth drivers, making the start up difficult, too dependent on the vendor, requiring the vendor to provide source code or to target the drivers in a specific scenario.
Disclosure of Invention
An object of the present invention is to provide a data processing scheme to solve the above technical problems.
According to a first aspect of the present invention, there is provided a data processing method comprising: registering a virtual host control interface in the kernel, wherein the virtual host control interface is used for communicating with a blue protocol stack; monitoring the virtual host control interface, analyzing the monitored first data from the blue protocol stack into data adapted to a driver corresponding to the blue protocol stack, and sending the analyzed data to the driver corresponding to the blue protocol stack, and/or monitoring the driver corresponding to the blue protocol stack, analyzing the monitored second data from the Bluetooth hardware module into data adapted to the blue protocol stack, and sending the analyzed data to the virtual host control interface, so that the virtual host control interface sends the analyzed data to the blue protocol stack.
Optionally, the step of monitoring the virtual host control interface includes: opening a first file descriptor of a virtual host control interface and monitoring the first file descriptor.
Optionally, the method further comprises: and loading a manufacturer Bluetooth library in the android environment by using the adaptation library so as to use a driver corresponding to the blue protocol stack.
Optionally, the step of loading the vendor bluetooth library in the android environment by using the adaptation library to use the driver corresponding to the blue protocol stack includes: and loading a manufacturer Bluetooth library in the android environment by using the adaptation library to obtain a second file descriptor of the physical interface driver in the driver corresponding to the blue protocol stack, and downloading the firmware.
Optionally, the step of monitoring the driver corresponding to the blue protocol stack includes: the step of monitoring the second file descriptor and/or sending the parsed data to the driver corresponding to the blue protocol stack comprises the following steps: and sending the parsed data to a second file descriptor.
Optionally, the first data comprises at least one of: the blue protocol stack sends command packets to the Bluetooth hardware module and data packets transmitted through ACL or SCO; and/or the second data comprises at least one of: and the Bluetooth hardware module receives an event packet returned after a command packet sent by the blue protocol stack and a data packet transmitted through ACL or SCO.
Optionally, the step of registering the virtual host control interface in the kernel comprises: compiling the virtual host control interface into the kernel, and registering as a node under the device directory.
Optionally, the step of parsing the monitored first data into drive-adapted data corresponding to the blue protocol stack includes: the first data packet is packaged into data in a format matched with a manufacturer Bluetooth library.
Optionally, the step of parsing the monitored second data into data adapted to the blue protocol stack comprises: unpacking the second data to remove the packet header matched with the manufacturer Bluetooth library.
According to a second aspect of the present invention, there is also provided a data processing method comprising: creating a daemon for: monitoring a virtual host control interface registered in a kernel, analyzing the monitored first data from the blue protocol stack into data which is matched with a driver corresponding to the blue protocol stack, and sending the analyzed data to the driver corresponding to the blue protocol stack; and/or monitor the driver corresponding to the blue-tooth protocol stack, parse the monitored second data from the blue-tooth hardware module into data adapted to the blue-tooth protocol stack, and send the parsed data to the virtual host control interface, so that the virtual host control interface sends the parsed data to the blue-tooth protocol stack.
Optionally, the daemon is further for: and calling a manufacturer Bluetooth library in the android environment by using the adaptation library so as to use a driver corresponding to the blue protocol stack.
According to a third aspect of the present invention, there is also provided a data processing method comprising: registering a virtual host control interface in the kernel, the virtual host control interface being for communicating with the first protocol stack; monitoring the virtual host control interface, analyzing the monitored first data from the first protocol stack into data adapted to a driver corresponding to the second protocol stack, and sending the analyzed data to the driver corresponding to the second protocol stack, and/or monitoring the driver corresponding to the second protocol stack, analyzing the monitored second data from the hardware module into data adapted to the first protocol stack, and sending the analyzed data to the virtual host control interface, so that the virtual host control interface sends the analyzed data to the first protocol stack.
According to a fourth aspect of the present invention, there is also provided a data processing apparatus comprising: the registration module is used for registering a virtual host control interface in the kernel, and the virtual host control interface is used for communicating with the blue protocol stack; the first monitoring module is used for monitoring the virtual host control interface, analyzing the monitored first data from the blue protocol stack into data which is matched with a driver corresponding to the blue protocol stack, and sending the analyzed data to the driver corresponding to the blue protocol stack, and/or the second monitoring module is used for monitoring the driver corresponding to the blue protocol stack, analyzing the monitored second data from the Bluetooth hardware module into data which is matched with the blue protocol stack, and sending the analyzed data to the virtual host control interface, so that the virtual host control interface can send the analyzed data to the blue protocol stack.
According to a fifth aspect of the present invention, there is also provided a data processing apparatus comprising: the creation module is used for creating a daemon process, and the daemon process is used for: monitoring a virtual host control interface registered in a kernel, analyzing the monitored first data from the blue protocol stack into data which is matched with a driver corresponding to the blue protocol stack, and sending the analyzed data to the driver corresponding to the blue protocol stack; and/or monitor the driver corresponding to the blue-tooth protocol stack, parse the monitored second data from the blue-tooth hardware module into data adapted to the blue-tooth protocol stack, and send the parsed data to the virtual host control interface, so that the virtual host control interface sends the parsed data to the blue-tooth protocol stack.
According to a sixth aspect of the present invention, there is also provided a data processing apparatus comprising: the registration module is used for registering a virtual host control interface in the kernel, and the virtual host control interface is used for communicating with the first protocol stack; the first monitoring module is used for monitoring the virtual host control interface, analyzing the monitored first data from the first protocol stack into data which is matched with the drive corresponding to the second protocol stack, and sending the analyzed data to the drive corresponding to the second protocol stack, and/or the second monitoring module is used for monitoring the drive corresponding to the second protocol stack, analyzing the monitored second data from the hardware module into data which is matched with the first protocol stack, and sending the analyzed data to the virtual host control interface, so that the virtual host control interface sends the analyzed data to the first protocol stack.
According to a seventh aspect of the present invention, there is also provided a computing device comprising: a processor; and a memory having executable code stored thereon which, when executed by the processor, causes the processor to perform the method as described in any one of the first to third aspects of the invention.
According to an eighth aspect of the present invention there is also provided a non-transitory machine-readable storage medium having stored thereon executable code which when executed by a processor of an electronic device causes the processor to perform a method as set out in any of the first to third aspects of the present invention.
Therefore, the upper protocol stack and the lower hardware module can be communicated without the drive carried by the upper protocol stack and the lower hardware module, and the dependence of hardware manufacturers is reduced.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following more particular descriptions of exemplary embodiments of the disclosure as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout exemplary embodiments of the disclosure.
Fig. 1 shows a schematic flow chart of a driver according to an embodiment of the invention, in which a first protocol stack is adapted to a second protocol stack.
Fig. 2 shows a schematic flow chart of a data processing method according to an embodiment of the invention.
FIG. 3 shows a schematic flow diagram of a driver for implementing a blue protocol stack adaptation blue protocol stack with a daemon.
Fig. 4 shows a schematic block diagram of the structure of a data processing apparatus according to an embodiment of the present invention.
Fig. 5 shows a schematic block diagram of a structure of a data processing apparatus according to another embodiment of the present invention.
FIG. 6 illustrates a schematic diagram of a computing device, according to an embodiment of the invention.
Detailed Description
Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[ PREPARATION ] A method for producing a polypeptide
HCI: the Host Control interface (Host Controller Interface), which is an important part of the bluetooth protocol stack, the HCI provides a unified interface to the controller for communicating Host and Control. The interface between software and hardware in the Bluetooth protocol provides a unified command for calling lower BB, LM, state and control registers and other hardware, and the transfer of information and data between the upper and lower module interfaces must be performed through the interpretation of HCI. Protocol software entities above the HCI layer run on the host, while functions below the HCI are performed by the bluetooth device, with interactions between the two through the transport layer.
VHCI: the virtual host controls the interface, the virtual interface between host computer and controller.
glibc: the libc library issued by the GNU, namely the c runtime library. glibc is the lowest api in the linux system and almost any other runtime will depend on glibc. glibc, in addition to encapsulating the system services provided by the linux operating system, itself provides many other implementations of the necessary functional services.
bionic: android Linux kernel library.
hybrid is: a library of methods for converting between glibc and bionic.
libbt-vendor: and compiling a manufacturer Bluetooth closed source library in an Android environment.
hciconfig hci0up: hcicon is a tool provided by blue, mainly to operate whether hci0 interface is normal, up means bluetooth on, down means bluetooth off.
Libhybrid: and the adaptation library is used for solving the compatibility problem between the GNU lib and the Android lib, and aims to enable the standard application program in Linux to call the Android lib.
fd: file descriptor, file descriptor. The kernel (kernel) uses the file descriptor to access the file. The file descriptor is a non-negative integer. When an existing file or a newly created file is opened, the kernel returns a file descriptor. Reading and writing files also requires the use of file descriptors to specify the file to be read and written.
UART: a universal asynchronous receiver Transmitter (Universal Asynchronous Receiver/Transmitter) is an asynchronous receiver Transmitter, which is part of computer hardware
SDIO: (Secure Digital Input and Output) secure digital input output card, defining a peripheral interface.
The Daemon program is a server program that runs all the time, also called Daemon.
Dlopen: the specified dynamic link library file is opened in a specified mode.
The communication between Host and Control is performed in the form of packets. DATA transmitted between the Host and the Control are classified into three types of COMMAND packet (COMMAND), EVENT packet (EVENT), and DATA packet (DATA). Wherein the data packets are bi-directional, command packets can only be sent from the host to the controller, while event packets are always sent from the controller to the host. Most command packets issued by the host trigger the controller to generate corresponding event packets in response. The data packets may be classified into ACL-based transmission data packets and SCO-based transmission data packets.
[ scheme overview ]
The invention provides a data processing scheme for realizing the adaptation of a first protocol stack to a corresponding drive of a second protocol stack. The data processing scheme is an adaptation scheme provided aiming at the scene that the drive carried by the bottom hardware module in the device corresponds to the second protocol stack, and the upper layer protocol in the device uses a first protocol stack different from the second protocol stack.
Fig. 1 is a schematic flow diagram of a driver corresponding to a first protocol stack adapting to a second protocol stack according to an embodiment of the present invention. The arrows shown in fig. 1 indicate the data flow direction.
As shown in fig. 1, a Virtual Host Control Interface (VHCI) may be registered for communication with the first protocol stack, e.g., the virtual host control interface may be registered in the kernel. The virtual host control interface is configured to communicate with the first protocol stack, and the driver corresponding to the second protocol stack is capable of communicating with the hardware module, such as may be provided by a physical interface driver (e.g., USB, UART, SDIO, etc.) provided by the driver corresponding to the second protocol stack.
In order to realize data transmission between the first protocol stack and the hardware module carrying the driver corresponding to the second protocol stack, the invention proposes that the virtual host control interface can be monitored, the monitored data from the first protocol stack (i.e. the first data mentioned below) is parsed into data adapted to the driver corresponding to the second protocol stack, and the parsed data is sent to the driver corresponding to the second protocol stack, so that the driver corresponding to the second protocol stack is sent to the hardware module, for example, the parsed data can be sent to the hardware module through a physical interface driver (such as USB, UART, SDIO) provided by the driver corresponding to the second protocol stack.
The driver corresponding to the second protocol stack may also be monitored, the monitored data from the hardware module (i.e., the second data described below) may be parsed into data adapted to the first protocol stack, and the parsed data may be sent to the virtual host control interface, so that the virtual host control interface may send the parsed data to the first protocol stack.
Therefore, the first protocol stack can be adapted to the corresponding drive of the second protocol stack. The first protocol stack and the second protocol stack mentioned in the present invention may be different types or versions of protocol stacks for the same communication mechanism. For example, the first protocol stack and the second protocol stack may be different bluetooth protocol stacks, e.g., the first protocol stack may be blue, and the second protocol stack may be blue, where the above-mentioned hardware modules may be bluetooth hardware modules.
The following description will take the example that the first protocol stack is a blue protocol stack, the second protocol stack is a blue protocol stack, and the driver corresponding to the second protocol stack is a driver corresponding to the blue protocol stack.
[ data processing method ]
Fig. 2 is a schematic flow chart diagram illustrating a data processing method according to an embodiment of the present invention. Step S220 is shown to be performed before step S230, and it should be understood that the present invention is not limited to the order of performing step S220 and step S230. After step S210 is performed, only one of step S220 and step S230 may be performed. The method shown in fig. 2 may be used to implement the blue protocol stack adaptation blue protocol stack corresponding driver.
Referring to fig. 2, a virtual host control interface is registered in a kernel at step S210.
A Virtual Host Control Interface (VHCI) is used to communicate with the blue protocol stack. The virtual host control interface may be compiled into the kernel and registered as a node under the device directory. For example, VHCI may be compiled into the kernel by configuring config_bt_hcivhci=y and ensuring successful registration as/dev/VHCI node. Therein, blue may be initiated and a successful registration of VHCI may be determined by verifying that hciconfig hci0up was successful.
The virtual host control interface may be regarded as a node registered under a device directory in the kernel, and a specific implementation procedure of registering the virtual host control interface in the kernel is not described herein. Different from the HCI, the invention is used for realizing the adaptation of the blue protocol stack to the driver corresponding to the blue protocol stack, and the blue tooth hardware module at the bottom layer uses the driver corresponding to the blue protocol stack, so that the VHCI cannot directly communicate with the blue tooth hardware module at the bottom layer (such as a baseband controller, a firmware link manager and the like).
In step S220, the virtual host control interface is monitored, the monitored first data from the blue protocol stack is parsed into data adapted to the driver corresponding to the blue protocol stack, and the parsed data is sent to the driver corresponding to the blue protocol stack.
bluez is commonly applied in linux environments. Under linux, all operations are performed on a file, and the operations on the file are implemented using file descriptors. Thus, as an example, a file descriptor of a virtual host control interface (which may be referred to as a "first file descriptor" for ease of distinction) may be opened and the first file descriptor is snooped to snoop the data sent by the blue protocol stack to the VHCI (which may be referred to as "first data" for ease of distinction). Wherein the first data may include, but is not limited to, at least one of: the blue protocol stack sends command packets to the Bluetooth hardware module and data packets transmitted through ACL or SCO.
The first data is data which needs to be sent to the Bluetooth hardware module at the bottom layer, and because the Bluetooth hardware module uses a driver corresponding to a blue-tooth protocol stack which is not matched with the blue-tooth protocol stack, the first data needs to be resolved into data which is matched with the driver corresponding to the blue-tooth protocol stack, the resolved data is sent to the driver corresponding to the blue-tooth protocol stack, and then the driver corresponding to the blue-tooth protocol stack is forwarded to the Bluetooth hardware module at the bottom layer, so that the Bluetooth hardware module can identify the received data and execute corresponding operation based on the received data.
As an example, a driver corresponding to the blue-wheel protocol stack may be used by loading a vendor bluetooth library (e.g., libbt-vendor) in the android environment, so that the first data may be packaged into data in a format matching the vendor bluetooth library (e.g., libbt-vendor), so that the packaged data may be identified by the underlying bluetooth hardware module.
In step S230, the driver corresponding to the blue-tooth protocol stack is monitored, the monitored second data from the bluetooth hardware module is parsed into data adapted to the blue-tooth protocol stack, and the parsed data is sent to the virtual host control interface, so that the virtual host control interface sends the parsed data to the blue-tooth protocol stack.
The driver corresponding to the blue-tooth protocol stack is monitored, mainly to monitor the data from the bluetooth hardware module (for convenience of distinction, may be referred to as "second data"). And the driver corresponding to the blue-tooth protocol stack can receive the data from the Bluetooth hardware module through a UART, USB, SDIO physical interface driver. Therefore, the file descriptor (for convenience of distinction, may be referred to as a second file descriptor) of the physical interface driver in the driver corresponding to the blue-tooth protocol stack may be acquired, and the second file descriptor is monitored, so as to monitor the second data from the bluetooth hardware module. The second data may include, but is not limited to, at least one of: and the Bluetooth hardware module receives an event packet returned after a command packet sent by the blue protocol stack and a data packet transmitted through ACL or SCO.
The second data is data to be sent to the upper blue protocol stack, and because the Bluetooth hardware module uses a driver corresponding to the blue protocol stack which is not matched with the blue protocol stack, the second data is required to be parsed into data which is matched with the blue protocol stack, and then the parsed data is sent to the VHCI, so that the parsed data is sent to the blue protocol stack by the VHCI.
As an example, a driver corresponding to the blue-tooth protocol stack may be used by loading a vendor bluetooth library (such as libbt-vendor) in the android environment, so that the second data may be unpacked to remove a packet header matched with the vendor bluetooth library, so that the unpacked data may be processed by an upper layer blue protocol stack.
In the invention, the adaptation library can be utilized to load the manufacturer Bluetooth library in the android environment so as to use the driver corresponding to the blue protocol stack. For example, libhybrid may be used to load libbt-vendor.so and ensure that dlopen may succeed, obtain a file descriptor driven by a physical interface such as UART/USB/SDIO (i.e., the second file descriptor mentioned above), and download firmware (download firmware). The data obtained by analyzing the first data can be sent to the second file descriptor.
In one embodiment of the present invention, step S220 and step S230 may be implemented by creating a daemon (daemon).
The daemon may monitor the drivers corresponding to the VHCI and the blue-tooth protocol stack, parse the monitored first data from the blue-tooth protocol stack into data adapted to the driver corresponding to the blue-tooth protocol stack, and send the parsed data to the driver corresponding to the blue-tooth protocol stack, and may parse the monitored second data from the bluetooth hardware module into data adapted to the blue-tooth protocol stack, and send the parsed data to the virtual host control interface, so that the virtual host control interface sends the parsed data to the blue-tooth protocol stack.
daemon may also be configured to invoke vendor bluetooth libraries in the android environment with the adaptation library to use the driver corresponding to the blue protocol stack. For example, the daemon may invoke libbt-vendor with libhybrid for initialization of the chip and downloading firmware.
As shown in fig. 3, after registering the VHCI into the kernel, the daemon may execute the following procedure to implement the blue protocol stack adaptation blue protocol stack corresponding driver.
a) And loading a manufacturer Bluetooth library (such as a manufacturer closed source Bluetooth library-vendor) under Android by utilizing Libhybrid, opening a file descriptor (the second file descriptor which is mentioned above and can be a file descriptor driven by a physical interface) of a standard Bluetooth driver (namely a driver corresponding to a blue character protocol stack), and initializing and downloading firmware.
b) After waiting for the firmware upgrade of the bluetooth hardware module to be completed, the VHCI node descriptor (i.e., the first file descriptor mentioned above) is opened.
c) And respectively monitoring the two file descriptors to realize data stream transfer.
For the monitored data sent by the blue protocol stack to the VHCI node, the daemon will perform data encapsulation into a libbt-vendor format and send the data to the Bluetooth driver provided by the android (i.e. the driver corresponding to the blue protocol stack), i.e. to the second file descriptor.
For the data received by the driver corresponding to the blue-tooth protocol stack from the Bluetooth hardware module at the bottom layer, the daemon can unpack and remove the libbt-vendor packet header, and the data is sent to the VHCI node and then is sent to the blue-tooth protocol stack.
Thus, a virtual HCI interface is created by registering a VHCI node in a kernel, and the daemon is developed in combination with the VHCI node to realize data stream transfer between a blue protocol stack and an underlying Bluetooth hardware module. For example, daemon can use libhybrid to load a closed source libbt-vendor library to smoothly use Bluetooth driving under an android system, so that driving corresponding to a blue protocol stack adaptation blue protocol stack can be realized.
Device for adapting first protocol stack to second protocol stack drive
Fig. 4 is a schematic block diagram showing the structure of a data processing apparatus according to an embodiment of the present invention. Wherein the functional modules of the apparatus may be implemented by hardware, software, or a combination of hardware and software that implements the principles of the invention. Those skilled in the art will appreciate that the functional modules depicted in fig. 4 may be combined or divided into sub-modules to implement the principles of the invention described above. Accordingly, the description herein may support any possible combination, or division, or even further definition of the functional modules described herein.
The functional modules that the apparatus may have and the operations that each functional module may perform are briefly described below, and details related thereto are referred to the above related description and are not repeated herein.
Referring to fig. 4, the data processing apparatus 400 includes a registration module 410, a first listening module 420, and/or a second listening module 430.
The registration module 410 is configured to register a virtual host control interface in the kernel, the virtual host control interface being configured to communicate with the first protocol stack. The first monitoring module 420 is configured to monitor the virtual host control interface, parse the monitored first data from the first protocol stack into data adapted to a driver corresponding to the second protocol stack, and send the parsed data to the driver corresponding to the second protocol stack. The second monitoring module 430 is configured to monitor a driver corresponding to the second protocol stack, parse the monitored second data from the hardware module into data adapted to the first protocol stack, and send the parsed data to the virtual host control interface, so that the virtual host control interface sends the parsed data to the first protocol stack.
As described above, the first protocol stack and the second protocol stack may be different types or versions of protocol stacks for the same communication mechanism. For example, the first protocol stack and the second protocol stack may be different bluetooth protocol stacks, e.g., the first protocol stack may be a blue protocol stack, the second protocol stack may be a blue protocol stack, and the hardware module may be a bluetooth hardware module.
The description will be made with respect to functional modules that the data processing apparatus 400 may have and operations that each functional module may execute, taking, as an example, that the first protocol stack is a blue protocol stack and the driver corresponding to the second protocol stack is a driver corresponding to a blue protocol stack.
In this embodiment, the data processing apparatus 400 is configured to implement a driver corresponding to the blue protocol stack adaptation blue protocol stack.
The registration module 410 is used to register a virtual host control interface in the kernel, which is used to communicate with the blue protocol stack. As an example, registration module 410 may compile a virtual host control interface into a kernel and register as a node under a device directory.
The first monitoring module 420 is configured to monitor the virtual host control interface, for example, the first file descriptor of the virtual host control interface may be opened, and monitor the first file descriptor, so as to monitor data sent by the blue protocol stack to the virtual host control interface. The first monitor module 420 is further configured to parse the monitored first data from the blue protocol stack into data adapted to a driver corresponding to the blue protocol stack, and send the parsed data to the driver corresponding to the blue protocol stack. As an example, the first listening module 420 may package the first data into data in a format that matches the vendor bluetooth library.
The second monitoring module 430 is configured to monitor a driver corresponding to the blue-tooth protocol stack, for example, may obtain a second file descriptor of a physical interface driver in the driver corresponding to the blue-tooth protocol stack, and monitor the second file descriptor, so as to monitor second data received by the physical interface driver from the bluetooth hardware module. The second monitor module 430 is further configured to parse the monitored second data from the bluetooth hardware module into data adapted to the blue protocol stack, and send the parsed data to the virtual host control interface, so that the virtual host control interface sends the parsed data to the blue protocol stack. For example, the second listening module 430 may unpack the second data, and remove a packet header matched with the vendor bluetooth library, so that the unpacked data can be identified by the blue protocol stack.
Optionally, the apparatus may further include a loading module (not shown in the figure) configured to load a vendor bluetooth library in the android environment with the adaptation library to use a driver corresponding to the blue protocol stack. Specifically, the vendor bluetooth library in the android environment can be loaded by using the adaptation library to obtain the second file descriptor of the physical interface driver in the driver corresponding to the blue-wheel protocol stack, and the firmware is downloaded. For example, the initialization and download firmware of the chip may be performed using libhybrid calls libbt-vendor.
Fig. 5 is a schematic block diagram showing the structure of a data processing apparatus according to another embodiment of the present invention. Wherein the functional blocks of the data processing apparatus may be implemented by hardware, software, or a combination of hardware and software that implements the principles of the invention. Those skilled in the art will appreciate that the functional modules depicted in fig. 5 may be combined or divided into sub-modules to implement the principles of the invention described above. Accordingly, the description herein may support any possible combination, or division, or even further definition of the functional modules described herein.
The functional modules that the apparatus may have and the operations that each functional module may perform are briefly described below, and details related thereto are referred to the above related description and are not repeated herein.
Referring to fig. 5, the data processing apparatus 500 includes a creation module 510. The creation module 510 is configured to create a daemon, where the daemon is configured to monitor a virtual host control interface registered in a kernel, parse the monitored first data from the blue protocol stack into data adapted to a driver corresponding to the blue protocol stack, and send the parsed data to the driver corresponding to the blue protocol stack; and/or monitor the driver corresponding to the blue-tooth protocol stack, parse the monitored second data from the blue-tooth hardware module into data adapted to the blue-tooth protocol stack, and send the parsed data to the virtual host control interface, so that the virtual host control interface sends the parsed data to the blue-tooth protocol stack.
The daemon may also be used to invoke a vendor bluetooth library in the android environment with an adaptation library to use the driver corresponding to the blue protocol stack. For example, the daemon may invoke libbt-vendor with libhybrid for chip initialization and download firmware.
Specific implementations of the above-described apparatus and functions of the modules or components thereof may be found in the above-mentioned related descriptions of fig. 1-3, and are not repeated here.
[ computing device ]
FIG. 6 illustrates a schematic diagram of a computing device that may be used to implement the data processing method described above according to one embodiment of the invention.
Referring to fig. 6, a computing device 600 includes a memory 610 and a processor 620.
Processor 620 may be a multi-core processor or may include multiple processors. In some embodiments, processor 620 may include a general-purpose host processor and one or more special coprocessors, such as a Graphics Processor (GPU), digital Signal Processor (DSP), etc. In some embodiments, the processor 620 may be implemented using custom circuitry, for example, an application specific integrated circuit (ASIC, application Specific Integrated Circuit) or a field programmable gate array (FPGA, field Programmable Gate Arrays).
Memory 610 may include various types of storage units, such as system memory, read Only Memory (ROM), and persistent storage. Where the ROM may store static data or instructions that are required by the processor 620 or other modules of the computer. The persistent storage may be a readable and writable storage. The persistent storage may be a non-volatile memory device that does not lose stored instructions and data even after the computer is powered down. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the persistent storage may be a removable storage device (e.g., diskette, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as dynamic random access memory. The system memory may store instructions and data that are required by some or all of the processors at runtime. Furthermore, memory 610 may include any combination of computer-readable storage media including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks, and/or optical disks may also be employed. In some implementations, memory 610 may include readable and/or writable removable storage devices such as Compact Discs (CDs), digital versatile discs (e.g., DVD-ROMs, dual-layer DVD-ROMs), blu-ray discs read only, super-density discs, flash memory cards (e.g., SD cards, min SD cards, micro-SD cards, etc.), magnetic floppy disks, and the like. The computer readable storage medium does not contain a carrier wave or an instantaneous electronic signal transmitted by wireless or wired transmission.
The memory 610 has stored thereon executable code that, when processed by the processor 620, causes the processor 620 to perform the data processing methods described above.
The data processing method, apparatus and device according to the present invention have been described in detail above with reference to the accompanying drawings.
Furthermore, the method according to the invention may also be implemented as a computer program or computer program product comprising computer program code instructions for performing the steps defined in the above-mentioned method of the invention.
Alternatively, the invention may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) which, when executed by a processor of an electronic device (or computing device, server, etc.), causes the processor to perform the steps of the above-described method according to the invention.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (17)

1. A method of data processing, comprising:
registering a virtual host control interface in the kernel, wherein the virtual host control interface is used for communicating with a blue protocol stack;
monitoring the virtual host control interface, analyzing the monitored first data from the blue protocol stack into data adapted to a driver corresponding to the blue protocol stack, sending the analyzed data to the driver corresponding to the blue protocol stack, and,
and monitoring the driver corresponding to the blue-tooth protocol stack, analyzing the monitored second data from the Bluetooth hardware module into data matched with the blue-tooth protocol stack, and sending the analyzed data to the virtual host control interface so that the virtual host control interface can send the analyzed data to the blue-tooth protocol stack.
2. The method of claim 1, wherein said listening for said virtual host control interface comprises:
opening a first file descriptor of the virtual host control interface and monitoring the first file descriptor.
3. The method as recited in claim 1, further comprising:
and loading a manufacturer Bluetooth library in the android environment by using the adaptation library so as to use the driver corresponding to the blue protocol stack.
4. The method of claim 3, wherein the step of loading a vendor bluetooth library in an android environment with an adaptation library to use a driver corresponding to the blue protocol stack comprises:
and loading a manufacturer Bluetooth library in the android environment by using the adaptation library to obtain a second file descriptor of a physical interface driver in the driver corresponding to the blue protocol stack, and downloading firmware.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
the step of monitoring the driver corresponding to the blue protocol stack comprises the following steps: listening for the second file descriptor, and/or,
the step of sending the parsed data to the driver corresponding to the blue protocol stack comprises the following steps: and sending the parsed data to the second file descriptor.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the first data includes at least one of: the blue protocol stack sends a command packet to the Bluetooth hardware module and a data packet transmitted through ACL or SCO; and/or
The second data includes at least one of: and the Bluetooth hardware module receives an event packet returned after the command packet sent by the blue protocol stack and a data packet transmitted through ACL or SCO.
7. The method of claim 1, wherein the step of registering a virtual host control interface in a kernel comprises:
compiling the virtual host control interface into the kernel, and registering as a node under the device directory.
8. The method of claim 1, wherein the step of parsing the monitored first data into driver adapted data corresponding to the blue protocol stack comprises:
and packaging the first data into data with a format matched with a manufacturer Bluetooth library.
9. The method of claim 1, wherein the step of parsing the monitored second data into data adapted to the blue protocol stack comprises:
and unpacking the second data to remove the packet header matched with the manufacturer Bluetooth library.
10. A method of data processing, comprising: creating a daemon for:
monitoring a virtual host control interface registered in a kernel, analyzing the monitored first data from a blue protocol stack into data which is adapted to a driver corresponding to the blue protocol stack, and sending the analyzed data to the driver corresponding to the blue protocol stack; and is also provided with
And monitoring the driver corresponding to the blue-tooth protocol stack, analyzing the monitored second data from the Bluetooth hardware module into data matched with the blue-tooth protocol stack, and sending the analyzed data to the virtual host control interface so that the virtual host control interface can send the analyzed data to the blue-tooth protocol stack.
11. The method of claim 10, wherein the step of determining the position of the first electrode is performed,
the daemon is also for: and calling a manufacturer Bluetooth library in the android environment by using the adaptation library so as to use a driver corresponding to the blue protocol stack.
12. A method of data processing, comprising:
registering a virtual host control interface in the kernel, wherein the virtual host control interface is used for communicating with a first protocol stack;
monitoring the virtual host control interface, analyzing the monitored first data from the first protocol stack into data adapted to a drive corresponding to a second protocol stack, sending the analyzed data to the drive corresponding to the second protocol stack, and,
and monitoring the drive corresponding to the second protocol stack, analyzing the monitored second data from the hardware module into data matched with the first protocol stack, and sending the analyzed data to the virtual host control interface so that the virtual host control interface sends the analyzed data to the first protocol stack.
13. A data processing apparatus, comprising:
the registration module is used for registering a virtual host control interface in the kernel, and the virtual host control interface is used for communicating with a blue protocol stack;
a first monitoring module, configured to monitor the virtual host control interface, parse the monitored first data from the blue protocol stack into data adapted to a driver corresponding to the blue protocol stack, send the parsed data to the driver corresponding to the blue protocol stack, and,
the second monitoring module is used for monitoring the driver corresponding to the blue-tooth protocol stack, analyzing the monitored second data from the blue-tooth hardware module into data adapted to the blue-tooth protocol stack, and sending the analyzed data to the virtual host control interface so that the virtual host control interface can send the analyzed data to the blue-tooth protocol stack.
14. A data processing apparatus, comprising: the creation module is used for creating a daemon, and the daemon is used for:
monitoring a virtual host control interface registered in a kernel, analyzing the monitored first data from a blue protocol stack into data which is adapted to a driver corresponding to the blue protocol stack, and sending the analyzed data to the driver corresponding to the blue protocol stack; and is also provided with
And monitoring the driver corresponding to the blue-tooth protocol stack, analyzing the monitored second data from the Bluetooth hardware module into data matched with the blue-tooth protocol stack, and sending the analyzed data to the virtual host control interface so that the virtual host control interface can send the analyzed data to the blue-tooth protocol stack.
15. A data processing apparatus, comprising:
the registration module is used for registering a virtual host control interface in the kernel, and the virtual host control interface is used for communicating with the first protocol stack;
a first monitoring module, configured to monitor the virtual host control interface, parse the monitored first data from the first protocol stack into data adapted to a driver corresponding to a second protocol stack, and send the parsed data to the driver corresponding to the second protocol stack,
the second monitoring module is used for monitoring the drive corresponding to the second protocol stack, analyzing the monitored second data from the hardware module into data adapted to the first protocol stack, and sending the analyzed data to the virtual host control interface so that the virtual host control interface can send the analyzed data to the first protocol stack.
16. A computing device, comprising:
a processor; and
a memory having executable code stored thereon, which when executed by the processor causes the processor to perform the method of any of claims 1 to 12.
17. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the method of any of claims 1 to 12.
CN201910020581.8A 2019-01-09 2019-01-09 Data processing method, device and equipment Active CN111427617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910020581.8A CN111427617B (en) 2019-01-09 2019-01-09 Data processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910020581.8A CN111427617B (en) 2019-01-09 2019-01-09 Data processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN111427617A CN111427617A (en) 2020-07-17
CN111427617B true CN111427617B (en) 2023-05-30

Family

ID=71545892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910020581.8A Active CN111427617B (en) 2019-01-09 2019-01-09 Data processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN111427617B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113099433A (en) * 2021-04-14 2021-07-09 深圳泰科晶显科技有限公司 Android system-based dynamic method compatible with WIFI and Bluetooth modules of different manufacturers
CN113505007A (en) * 2021-07-12 2021-10-15 北京鲸鲮信息系统技术有限公司 Protocol stack data transmission method based on Linux system, computer equipment and storage medium
CN115086173B (en) * 2022-05-09 2023-10-31 阿里巴巴(中国)有限公司 Reliability guarantee method and device in network upgrading process

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944033A (en) * 2009-07-09 2011-01-12 中兴通讯股份有限公司 Device and method for dynamically supporting multiple protocols in embedded system
WO2011022965A1 (en) * 2009-08-27 2011-03-03 中兴通讯股份有限公司 Bluetooth function providing method and terminal for computer
CN103024042A (en) * 2012-12-13 2013-04-03 中国航空无线电电子研究所 Avionics full duplex switched Ethernet (AFDX) terminal protocol stack, and data receiving and sending method thereof
CN105893038A (en) * 2016-03-30 2016-08-24 大连理工大学 Method for porting android Bluetooth protocol stack to Mint17 system
CN108616855A (en) * 2018-04-02 2018-10-02 上海仪电数字技术股份有限公司 Bluetooth equipment tele-control system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944033A (en) * 2009-07-09 2011-01-12 中兴通讯股份有限公司 Device and method for dynamically supporting multiple protocols in embedded system
WO2011022965A1 (en) * 2009-08-27 2011-03-03 中兴通讯股份有限公司 Bluetooth function providing method and terminal for computer
CN103024042A (en) * 2012-12-13 2013-04-03 中国航空无线电电子研究所 Avionics full duplex switched Ethernet (AFDX) terminal protocol stack, and data receiving and sending method thereof
CN105893038A (en) * 2016-03-30 2016-08-24 大连理工大学 Method for porting android Bluetooth protocol stack to Mint17 system
CN108616855A (en) * 2018-04-02 2018-10-02 上海仪电数字技术股份有限公司 Bluetooth equipment tele-control system and method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
彭述清 ; 施心陵 ; 苗爱敏 ; 王恩永 ; 牛振阳 ; .嵌入式蓝牙协议的数据传输实现.通信技术.2009,(第09期),全文. *
赵作人 ; 刘廷龙 ; .RFID技术在Android系统上的应用实现.计算机科学.2016,(第S1期),全文. *
陈媛媛 ; .基于Android的蓝牙In-band ring功能的实现.中国新通信.2016,(第08期),全文. *

Also Published As

Publication number Publication date
CN111427617A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
US10824716B2 (en) Executing native-code applications in a browser
US10862982B2 (en) Cloud-scale heterogeneous datacenter management infrastructure
US7181610B2 (en) Method and system to encapsulate a driver written for an operating system (OS) runtime environment in an OS independent environment firmware extension
CN111427617B (en) Data processing method, device and equipment
CN109062617B (en) Application method of platform supporting multiple types of equipment and mobile terminal
US9864861B2 (en) Object oriented marshaling scheme for calls to a secure region
CN107273148B (en) Update driven migration of data
JP2007514238A (en) Virtual network interface
CN110007980B (en) Method and device for realizing multi-service server
CN114077462A (en) Method, device, equipment and medium for calling Android HIDL interface by software operating system
CN109656844B (en) AT24xx EEPROM driving method and device
US20230297348A1 (en) Method for operating second system application on first system, terminal device and storage medium
CN114077460A (en) Method, equipment and medium for calling Android dynamic library HAL interface by software operating system
CN106796521B (en) API version control independent of product release
WO2020077487A1 (en) Method and related apparatus for optimizing and running android application
KR102088690B1 (en) Integrated-circuit radio
CN110852139B (en) Biometric identification method, device, apparatus and storage medium
US10664418B2 (en) Peripheral device controlling device, operation method thereof, and operation method of peripheral device controlling device driver
KR101444070B1 (en) System and method for using memory of host terminal in storage device, host terminal and storage device, and recording medium thereof
KR102276696B1 (en) Integrated-circuit radio
CN115185634A (en) Subsystem implementation method and computing device
CN117608686A (en) Configuration and transmission method, device, equipment, medium and server of accelerator
CN115705251A (en) Systems, methods, and apparatus to identify functionality for a computing device
CN116737273A (en) Programming language extension method, system, computing device and storage medium
US20070258314A1 (en) Driving method based on a binary architecture

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
TA01 Transfer of patent application right

Effective date of registration: 20201119

Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China

Applicant after: Zebra smart travel network (Hong Kong) Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant