WO2023284699A1 - 基于Linux***的协议栈数据传输方法、计算机设备和存储介质 - Google Patents

基于Linux***的协议栈数据传输方法、计算机设备和存储介质 Download PDF

Info

Publication number
WO2023284699A1
WO2023284699A1 PCT/CN2022/105026 CN2022105026W WO2023284699A1 WO 2023284699 A1 WO2023284699 A1 WO 2023284699A1 CN 2022105026 W CN2022105026 W CN 2022105026W WO 2023284699 A1 WO2023284699 A1 WO 2023284699A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
protocol stack
service module
intermediate service
chip controller
Prior art date
Application number
PCT/CN2022/105026
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 WO2023284699A1 publication Critical patent/WO2023284699A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present disclosure relates to the field of computer technology, for example, to a Linux system-based protocol stack data transmission method, computer equipment and storage media.
  • the protocol stack (Protocol stack) is the communication method between the upper application program and the underlying hardware.
  • the protocol stack performs data encapsulation, analysis, reading and other operations and sends the data to the corresponding hardware driver, so that the corresponding Hardware performs its functions, which requires hardware manufacturers to provide source code or drivers for specific scenarios according to the protocol stack used by the system. Different systems often use different protocol stacks.
  • the disclosure provides a protocol stack data transmission method based on a Linux system, a computer device and a storage medium.
  • a protocol stack data transmission method based on a Linux system including:
  • the kernel In response to the kernel listening to the protocol stack sending the first data to the driver chip controller, the kernel sends a first notification to the intermediate service module;
  • the first notification is used to instruct the intermediate service module to receive the first data and forward the first data to the driver chip controller.
  • the intermediate service module receives the first data and forwards the first data to the driver chip controller, including:
  • the intermediate service module calls a first interface function corresponding to the protocol stack to receive the first data
  • the intermediate service module calls the second interface function corresponding to the driver chip controller to send the first data to the driver chip controller.
  • the kernel sends the first notification to the intermediate service module in response to the fact that the kernel monitors that the protocol stack sends the first data to the driver chip controller, including:
  • the protocol stack sends the first data to a virtual host control interface (Virtual Host Controller Interface, VHCI) node;
  • VHCI Virtual Host Controller Interface
  • the kernel monitors that the VHCI node receives the first data, and sends the first notification to the intermediate service module.
  • the first interface function includes a g_io_channel_read_chars interface function
  • the second interface function includes a gbinder_client_transact interface function
  • the intermediate service module calls the second interface function corresponding to the driver chip controller to send the first data to the driver chip controller, including:
  • the intermediate service module calls the second interface function to send the data to the hwbinder node, so that the hwbinder node sends the first data to the driver through an interface description language (HAL Interface Definition Language, HIDL) interface chip controller.
  • HAL Interface Definition Language HAL Interface Definition Language
  • the method before the protocol stack sends data to the driver chip controller, the method further includes: pre-registering the VHCI node and the hwbinder node in the kernel.
  • the method also includes:
  • the driver chip controller sends the second data to the protocol stack
  • the kernel In response to the kernel detecting that the driver chip controller sends the second data to the protocol stack, the kernel sends a second notification to the intermediate service module;
  • the second notification is used to instruct the intermediate service module to receive the second data and forward the second data to the protocol stack.
  • the intermediate service module receives the second data and forwards the second data to the protocol stack, including:
  • the intermediate service module calls a third interface function corresponding to the driver chip controller to receive the second data
  • the intermediate service module calls a fourth interface function corresponding to the protocol stack to send the second data to the protocol stack.
  • the kernel in response to the kernel monitoring that the driver chip controller sends the second data to the protocol stack, the kernel sends the second notification to the intermediate service module, including:
  • the chip controller sends second data to the hwbinder node
  • the kernel In response to the kernel detecting that the hwbinder node receives the second data, the kernel sends the second notification to the intermediate service module.
  • the third interface function includes the gbinder_reader_read_hidl_vec interface function
  • the fourth interface function includes the g_io_channel_write_chars interface function.
  • the intermediate service module calls a fourth interface function corresponding to the protocol stack to send the second data to the protocol stack, including:
  • the intermediate service module calls the fourth interface function to send the second data to the VHCI node, so that the VHCI node sends the data to a protocol stack.
  • the protocol stack is the BlueZ Bluetooth protocol stack under Linux; the driver chip controller is a Bluetooth chip controller.
  • a computer device including: a memory and a processor, the memory stores a computer program, and the processor is configured to implement the aforementioned protocol stack data transmission method based on a Linux system when executing the computer program.
  • a computer-readable storage medium is also provided, and the computer-readable storage medium contains one or more program instructions, and the one or more program instructions are used to execute the above-mentioned protocol stack data transmission method based on the Linux system.
  • Fig. 1 is the flow chart of a kind of protocol stack data transmission method based on Linux system provided by the embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of bidirectional data transmission between a protocol stack and a driver chip controller provided by an embodiment of the present disclosure
  • Fig. 3 is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
  • HCI Host Controller Interface
  • the interface which provides a unified command to call the lower baseband (BaseBand, BB), link manager (Link Manager, LM), status and control registers and other hardware, the message and data between the upper and lower module interfaces
  • the transfer must be interpreted by HCI.
  • the protocol software entities above the HCI layer run on the host, while the functions below the HCI are completed by the Bluetooth device, and the two interact through the transport layer.
  • VHCI Virtual host control interface, a virtual interface between the host and the controller.
  • the communication between the host (Host) and the controller (Controller) is carried out in the form of packets.
  • the data transmitted between the host (Host) and the controller (Controller) is divided into three types: command packet (COMMAND), event packet (EVENT) and data packet (DATA).
  • the data packet is bidirectional, the command packet can only be sent from the host to the controller, and the event packet is always sent from the controller to the host. Most command packets sent by the host will trigger the controller to generate corresponding event packets as a response.
  • data packets can be divided into data packets transmitted based on an asynchronous connection (Asynchronous Connectionless, ACL) and data packets transmitted based on a symmetric connection (Synchronous Connection Oriented, SCO).
  • Asynchronous Connectionless ACL
  • SCO Synchronous Connection Oriented
  • Bluetooth Hardware Abstract Layer (Hardware Abstract Layer, HAL): Bluetooth hardware adaptation layer
  • Binder Inter-Process Communication (IPC) between framework/application processes.
  • Hwbinder IPC between framework/vendor processes.
  • HIDL The interface between the Android Framework and the Android HAL implementation.
  • Controller Controller.
  • This disclosure proposes a protocol stack data transmission method based on a Linux system, including:
  • the kernel In response to the kernel detecting that the protocol stack sends the first data to the driver chip controller, the kernel sends a first notification to the intermediate service module, so that the intermediate service module receives the first data and forwards the first data to the driver chip controller .
  • an intermediate service module is provided, and the intermediate service module is interposed between the protocol stack and the driver chip controller.
  • the interface function is called by the intermediate service module to transmit data, and the IPC communication with the HIDL interface is realized.
  • the implementation process of the protocol stack data transmission method based on Linux system includes:
  • the protocol stack sends the first data to the VHCI node.
  • the kernel monitors that the VHCI node receives the first data, and sends a first notification to the intermediate service module.
  • the intermediate service module calls the first interface function corresponding to the protocol stack to receive the first data.
  • the intermediate service module calls a second interface function corresponding to the driver chip controller to send the first data to the driver chip controller.
  • an intermediate service module is provided, and the intermediate service module is interposed between the protocol stack and the driver chip controller.
  • the interface function is called by the intermediate service module to transmit data.
  • the two-way transmission of data between the two is realized.
  • FIG. 2 it shows the operation process of the intermediate service module of the present disclosure.
  • the kernel monitors that the protocol stack sends the first data to the driver chip controller, and sends the first notification to the intermediate service module; the intermediate service The module calls the first interface function corresponding to the protocol stack to receive the first data, and calls the second interface function corresponding to the driver chip controller to send the first data to the driver chip controller.
  • the protocol stack sends the first data to the VHCI node; the kernel monitors that the VHCI node receives the first data, and sends a notification message to the intermediate service module; after the intermediate service module receives the notification message, it calls the corresponding g_io_channel_read_chars interface function Receive the first data, and call the gbinder_client_transact interface function to send the first data to the hwbinder node, so that the hwbinder node sends the first data to the HIDL interface of the corresponding driver chip controller.
  • the HIDL interface exchanges HCI data with the driver chip controller through the HAL, thereby driving the underlying Bluetooth chip controller.
  • the first interface function and the second interface function are described by taking g_io_channel_read_chars and gbinder_client_transact as examples. This is only illustrative, and other functions can also be used, for example, use the ioctl function to cooperate with the read and write parameters to realize the first interface function and the second interface function respectively; or the standard socket interface write() and read() respectively realize the first interface function An interface function and a second interface function.
  • the driver chip controller After the driver chip controller receives the command packet and the data packet, it will generate the corresponding data packet and event packet.
  • the method of the present disclosure further includes the driver chip controller sending the second data to the protocol stack, and in response to the kernel monitoring that the driver chip controller sends the second data to the protocol stack, the kernel sends a second notification to the intermediate service module to Make the intermediate service module receive the second data and forward the second data to the protocol stack.
  • the kernel detects that the driver chip controller sends the second data to the protocol stack, for example, the second data includes data packets and event packets, and sends a second notification to the intermediate service module; the intermediate service module calls corresponding to the driver chip controller
  • the third interface function receives the second data, and calls the fourth interface function corresponding to the protocol stack to send the second data to the protocol stack.
  • the chip controller when the chip controller sends the second data to the protocol stack, the chip controller sends the second data to the hwbinder node, and the kernel monitors that the hwbinder node receives the second data, and sends a second notification to the intermediate service module; After receiving the second notification, the service module calls the corresponding gbinder_reader_read_hidl_vec interface function to receive the second data; calls the g_io_channel_write_chars interface function to send the second data to the VHCI node, so that the VHCI node sends the second data to the protocol stack, thereby completing the The interaction between the protocol stack and the Bluetooth hardware.
  • the intermediate service module and the driver chip controller use the Android standard interface service HIDL to realize device driver-free adaptation. Compared with other manufacturers who adapt the HAL layer driver, the decoupling degree is higher and the interface version compatibility is better.
  • the present disclosure also provides a computer device, including a processor 10, a memory 11, and an input device 12 and an output device 13 required for operating the computer device; the number of processors 10 in the computer device may be one or more, and the processing
  • the controller 10, the memory 11, the input device 12 and the output device 13 can be connected through a bus or other means.
  • the memory 11 can be configured to store software programs, computer-executable programs and functional modules, such as program instructions/modules corresponding to the methods of the embodiments of the present disclosure.
  • the processor 10 executes various functional applications and data processing of the computer device by running software programs, instructions and modules stored in the memory 11 , that is, implements the methods of the above-mentioned embodiments.
  • the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.
  • memory 11 may include memory located remotely from processor 10, and these remote memories may be connected to the computer device via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 12 can be configured to receive inputted numerical or character information, and generate key signal input related to user settings and function control of the computer device.
  • the output device 13 may include a display device such as a display screen.
  • Embodiments of the present disclosure also provide a storage medium containing computer-executable instructions for performing the aforementioned method when executed by a computer processor.
  • the present disclosure can be realized by software and necessary general-purpose hardware, and can also be realized by hardware.
  • the technical solution of the present disclosure can be embodied in the form of a software product in essence, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (Read-Only Memory, ROM), a random access Memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the instructions described in the embodiments of the present disclosure method.
  • a computer-readable storage medium such as a computer floppy disk, a read-only memory (Read-Only Memory, ROM), a random access Memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)
  • Communication Control (AREA)
  • Collating Specific Patterns (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Navigation (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Stereophonic System (AREA)

Abstract

本文公开了一种基于Linux***的协议栈数据传输方法、计算机设备和存储介质。基于Linux***的协议栈数据传输方法,包括:响应于内核监听到协议栈向驱动芯片控制器发送第一数据,所述内核向中间服务模块发送第一通知;其中,所述第一通知用于指示所述中间服务模块接收所述第一数据并转发所述第一数据到所述驱动芯片控制器。

Description

基于Linux***的协议栈数据传输方法、计算机设备和存储介质
本申请要求在2021年07月12日提交中国专利局、申请号为202110785532.0的中国专利申请的优先权,要求在2021年10月09日提交中国专利局、申请号为202111177649.7的中国专利申请的优先权,该两件申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机技术领域,例如涉及一种基于Linux***的协议栈数据传输方法、计算机设备和存储介质。
背景技术
协议栈(Protocol stack)是上层的应用程序与底层的硬件之间进行通讯的方式,协议栈进行数据的封装、解析、读取等操作并将数据发送给对应硬件的驱动程序,从而使对应的硬件执行其功能,这就需要硬件厂商根据***使用的协议栈,来提供源码或者针对特定场景下的驱动程序,不同的***往往使用不同的协议栈。
发明内容
本公开提供一种基于Linux***的协议栈数据传输方法、计算机设备和存储介质。
提供了一种基于Linux***的协议栈数据传输方法,包括:
响应于内核监听到协议栈向驱动芯片控制器发送第一数据,所述内核向中间服务模块发送第一通知;
其中,所述第一通知用于指示所述中间服务模块接收所述第一数据并转发所述第一数据到所述驱动芯片控制器。
在一种实施方式中,所述中间服务模块接收所述第一数据并转发所述第一数据到所述驱动芯片控制器,包括:
中间服务模块调用与所述协议栈对应的第一接口函数接收所述第一数据;
中间服务模块调用与所述驱动芯片控制器对应的第二接口函数发送所述第一数据给所述驱动芯片控制器。
在一种实施方式中,所述响应于内核监听到协议栈向驱动芯片控制器发送 第一数据,所述内核向中间服务模块发送第一通知,包括:
所述协议栈发送第一数据给虚拟主机控制接口(Virtual Host Controller Interface,VHCI)节点;
所述内核监听到所述VHCI节点收到所述第一数据,向所述中间服务模块发送所述第一通知。
在一种实施方式中,所述第一接口函数包括g_io_channel_read_chars接口函数,所述第二接口函数包括gbinder_client_transact接口函数。
在一种实施方式中,所述中间服务模块调用与所述驱动芯片控制器对应的第二接口函数发送所述第一数据给驱动所述芯片控制器,包括:
所述中间服务模块调用所述第二接口函数发送所述数据给hwbinder节点,以使得所述hwbinder节点将所述第一数据通过接口描述语言(HAL Interface Definition Language,HIDL)接口发送到所述驱动芯片控制器。
在一种实施方式中,在协议栈向驱动芯片控制器发送数据之前,所述方法还包括:在内核中预先注册登记VHCI节点和hwbinder节点。
在一种实施方式中,所述方法还包括:
驱动芯片控制器向协议栈发送第二数据;
响应于所述内核监听到所述驱动芯片控制器向所述协议栈发送所述第二数据,所述内核向所述中间服务模块发送第二通知;
其中,所述第二通知用于指示所述中间服务模块接收所述第二数据并转发所述第二数据到所述协议栈。
在一种实施方式中,所述中间服务模块接收所述第二数据并转发所述第二数据到所述协议栈,包括:
所述中间服务模块调用与所述驱动芯片控制器对应的第三接口函数接收所述第二数据;
所述中间服务模块调用与所述协议栈对应的第四接口函数发送所述第二数据给所述协议栈。
在一种实施方式中,所述响应于所述内核监听到所述驱动芯片控制器向所述协议栈发送第二数据,所述内核向所述中间服务模块发送第二通知,包括:
所述芯片控制器发送第二数据给所述hwbinder节点;
响应于所述内核监听到所述hwbinder节点收到所述第二数据,所述内核向所述中间服务模块发送所述第二通知。
在一种实施方式中,所述第三接口函数包括gbinder_reader_read_hidl_vec接口函数,所述第四接口函数包括g_io_channel_write_chars接口函数。
在一种实施方式中,所述中间服务模块调用与所述协议栈对应的第四接口函数发送所述第二数据给所述协议栈,包括:
所述中间服务模块调用所述第四接口函数发送所述第二数据给所述VHCI节点,以使得所述VHCI节点将所述数据发送给协议栈。
在一种实施方式中,所述协议栈为Linux下的BlueZ蓝牙协议栈;所述驱动芯片控制器为蓝牙芯片控制器。
还提供了一种计算机设备,包括:存储器和处理器,所述存储器存储有计算机程序,所述处理器配置成执行所述计算机程序时实现前述的基于Linux***的协议栈数据传输方法。
还提供了一种计算机可读存储介质,计算机可读存储介质中包含一个或多个程序指令,所述一个或多个程序指令用于执行如上所述的基于Linux***的协议栈数据传输方法。
附图说明
图1是本公开实施例提供的一种基于Linux***的协议栈数据传输方法的流程图;
图2是本公开实施例提供的一种协议栈和驱动芯片控制器双向数据传输的示意图;
图3是本公开实施例提供的一种计算机设备的结构示意图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行描述。所描述的实施例仅仅是本公开一部分的实施例。
本公开中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于列出的那些步骤或单元,而是可包括没有列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
下面将参考附图并结合实施例来说明本公开。
主机控制接口(Host Controller Interface,HCI):是蓝牙协议栈的重要部分,HCI提供了对控制器的统一接口,用来沟通主机(Host)和控制器(Controller),是蓝牙协议中软硬件之间的接口,它提供了一个调用下层基带(BaseBand,BB)、链路管理器(Link Manager,LM)、状态和控制寄存器等硬件的统一命令,上、下两个模块接口之间的消息和数据的传递必须通过HCI的解释才能进行。HCI层以上的协议软件实体运行在主机上,而HCI以下的功能由蓝牙设备来完成,二者之间通过传输层进行交互。
VHCI:虚拟主机控制接口,主机与控制器之间的虚拟接口。
主机(Host)和控制器(Controller)之间的通信都以包的形式进行。主机(Host)和控制器(Controller)之间传输的数据分为命令包(COMMAND)、事件包(EVENT)和数据包(DATA)三种。其中数据包是双向的,命令包只能从主机发往控制器,事件包始终是控制器发向主机。主机发出的大多数命令包都会触发控制器产生相应的事件包作为响应。
对于蓝牙协议栈而言,数据包可分为基于异步连接(Asynchronous Connectionless,ACL)传送的数据包和基于对称连接(Synchronous Connection Oriented,SCO)传送的数据包。
蓝牙硬件抽象层(Hardware Abstract Layer,HAL):蓝牙的硬件适配层
Binder:框架/应用进程间的进程间通信(Inter-Process Communication,IPC)。
Hwbinder:框架/供应商进程间的IPC。
HIDL:Android Framework与Android HAL实现之间的接口。
Controller:控制器。
对于Linux***而言,其蓝牙协议栈BlueZ需要适配蓝牙厂商提供的针对BlueZ的蓝牙驱动,并注册供BlueZ使用的HCI接口,也就是说,底层驱动更多地依赖厂商支持。
本公开提出了一种基于Linux***的协议栈数据传输方法,包括:
响应于内核监听到协议栈向驱动芯片控制器发送第一数据,内核向中间服务模块发送第一通知,以使中间服务模块接收所述第一数据并转发所述第一数据到驱动芯片控制器。
本公开通过设置中间服务模块,中间服务模块介于协议栈和驱动芯片控制器之间。由中间服务模块调用接口函数来传输数据,实现了与HIDL接口的IPC通信。采用本公开的方法,对于不同的驱动芯片控制器,依旧可以实现Linux下的协议栈和驱动芯片控制器之间正常双向传输数据,提高了***对于不同蓝 牙芯片的驱动兼容能力。
参考图1所示,该基于Linux***的协议栈数据传输方法的实现过程,包括:
S102,协议栈发送第一数据给VHCI节点。
S104,内核监听到所述VHCI节点收到第一数据,向中间服务模块发送第一通知。
S106,中间服务模块调用与所述协议栈对应的第一接口函数接收第一数据。
S108,中间服务模块调用与所述驱动芯片控制器对应的第二接口函数发送第一数据给驱动芯片控制器。
本公开通过设置中间服务模块,中间服务模块介于协议栈和驱动芯片控制器之间。由中间服务模块调用接口函数来传输数据。实现了两者之间的数据的双向的传输。采用本公开的方法,不会因为驱动芯片控制器更换就会造成协议栈与驱动芯片控制器之间数据交互的困难,提高了***对于不同蓝牙芯片的驱动兼容能力,包括能够兼容安卓的BlueDroid协议栈的蓝牙硬件的驱动。
参见附图2,显示了本公开的中间服务模块的操作过程。
首先在Linux***的内核中预先注册登记VHCI节点和hwbinder节点。
协议栈向驱动芯片控制器发送第一数据时,例如第一数据包括数据包、命令包,内核监听到协议栈向驱动芯片控制器发送第一数据,向中间服务模块发送第一通知;中间服务模块调用与协议栈对应的第一接口函数接收所述第一数据,调用与驱动芯片控制器对应的第二接口函数发送第一数据给驱动芯片控制器。
在一个实施例中,协议栈发送第一数据给VHCI节点;内核监听到VHCI节点接收到第一数据,向中间服务模块发送通知消息;中间服务模块接收到通知消息后,调用对应的g_io_channel_read_chars接口函数接收第一数据,并调用gbinder_client_transact接口函数发送第一数据给hwbinder节点,以使得hwbinder节点将第一数据发送给对应驱动芯片控制器的HIDL接口。
HIDL接口通过HAL与驱动芯片控制器交互HCI数据,从而驱动底层蓝牙芯片控制器。
在上述实施例中,以g_io_channel_read_chars与gbinder_client_transact为例说明了第一接口函数和第二接口函数。这仅是示意性的,还可以采用其它函数,例如使用ioctl函数配合读写参数分别实现第一接口函数和第二接口函数;或标准套接字接口write()与read()分别实现第一接口函数和第二接口函数。
在驱动芯片控制器接收到命令包和数据包后,会产生对应的数据包和事件 包。相应的,本公开的方法还包括驱动芯片控制器向协议栈发送第二数据,以及响应于内核监听到驱动芯片控制器向协议栈发送第二数据,内核向中间服务模块发送第二通知,以使中间服务模块接收第二数据并转发第二数据到所述协议栈。
继续参考图2,内核监听到驱动芯片控制器向协议栈发送第二数据,例如第二数据包括数据包和事件包,向中间服务模块发送第二通知;中间服务模块调用与驱动芯片控制器对应的第三接口函数接收第二数据,调用与协议栈对应的第四接口函数发送第二数据给协议栈。
在一个实施例中,芯片控制器向协议栈发送第二数据时,芯片控制器发送第二数据给hwbinder节点,内核监听到hwbinder节点收到第二数据,向中间服务模块发送第二通知;中间服务模块接收到第二通知后,调用对应的gbinder_reader_read_hidl_vec接口函数接收第二数据;调用g_io_channel_write_chars接口函数发送第二数据给VHCI节点,以使得VHCI节点将第二数据发送给协议栈,从而完成Linux下的协议栈与蓝牙硬件的交互。
中间服务模块和驱动芯片控制器采用Android标准接口服务HIDL实现设备驱动免适配,相比其他厂家适配HAL层驱动,解耦程度更高,接口版本化兼容性更佳。
本公开还提供了一种计算机设备,包括处理器10、存储器11,以及实现操作计算机设备所需的输入装置12和输出装置13;计算机设备中处理器10的数量可以是一个或多个,处理器10、存储器11、输入装置12和输出装置13可以通过总线或其他方式连接。
存储器11作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及功能模块,如与本公开实施例方法对应的程序指令/模块。处理器10通过运行存储在存储器11中的软件程序、指令以及模块,从而执行计算机设备的多种功能应用以及数据处理,即实现上述实施例的方法。
存储器11可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器11可包括相对于处理器10远程设置的存储器,这些远程存储器可以通过网络连接至计算机设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置12可设置为接收输入的数字或字符信息,以及产生与计算机设备的用户设置以及功能控制有关的键信号输入。输出装置13可包括显示屏等显示设备。
本公开的实施例还提供一种包含计算机可执行指令的存储介质,计算机可执行指令在由计算机处理器执行时用于执行前述方法。
通过以上关于实施方式的描述,本公开可借助软件及必需的通用硬件来实现,也可以通过硬件实现。本公开的技术方案本质上可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例所述的方法。

Claims (10)

  1. 一种基于Linux***的协议栈数据传输方法,包括:
    响应于内核监听到协议栈向驱动芯片控制器发送第一数据,所述内核向中间服务模块发送第一通知;
    其中,所述第一通知用于指示所述中间服务模块接收所述第一数据并转发所述第一数据到所述驱动芯片控制器。
  2. 如权利要求1所述的方法,其中,所述第一数据为所述协议栈向虚拟主机控制接口VHCI节点发送的数据;
    所述响应于内核监听到协议栈向驱动芯片控制器发送第一数据,所述内核向中间服务模块发送第一通知,包括:
    响应于所述内核监听到所述VHCI节点收到所述第一数据,所述内核向中间服务模块发送所述第一通知。
  3. 如权利要求1所述的方法,其中,所述中间服务模块接收所述第一数据并转发所述第一数据到所述驱动芯片控制器,包括:
    所述中间服务模块调用与所述协议栈对应的第一接口函数接收所述第一数据;
    所述中间服务模块调用与所述驱动芯片控制器对应的第二接口函数发送所述第一数据给所述驱动芯片控制器。
  4. 如权利要求3所述的方法,其中,所述中间服务模块调用与所述驱动芯片控制器对应的第二接口函数发送所述第一数据给所述驱动芯片控制器,包括:
    所述中间服务模块调用所述第二接口函数发送所述第一数据给hwbinder节点,以使得所述hwbinder节点将所述第一数据通过接口定义语言HIDL接口发送到所述驱动芯片控制器。
  5. 如权利要求1所述的方法,还包括:
    响应于所述内核监听到所述驱动芯片控制器向所述协议栈发送第二数据,所述内核向所述中间服务模块发送第二通知;
    其中,所述第二通知用于指示所述中间服务模块接收所述第二数据并转发所述第二数据到所述协议栈。
  6. 如权利要求5所述的方法,其中,所述第二数据为所述芯片控制器向所述hwbinder节点发送的数据;
    所述响应于所述内核监听到所述驱动芯片控制器向所述协议栈发送第二数据,所述内核向所述中间服务模块发送第二通知,包括:
    响应于所述内核监听到所述hwbinder节点收到所述第二数据,所述内核向所述中间服务模块发送所述第二通知。
  7. 如权利要求5所述的方法,其中,所述中间服务模块接收所述第二数据并转发所述第二数据到所述协议栈,包括:
    所述中间服务模块调用与所述驱动芯片控制器对应的第三接口函数接收所述第二数据;
    所述中间服务模块调用与所述协议栈对应的第四接口函数发送所述第二数据给所述协议栈。
  8. 如权利要求5所述的方法,其中,所述中间服务模块调用与所述协议栈对应的第四接口函数发送所述第二数据给协议栈,包括:
    所述中间服务模块调用所述第四接口函数发送所述第二数据给所述VHCI节点,以使得所述VHCI节点将所述第二数据发送给所述协议栈。
  9. 一种计算机设备,包括:存储器和处理器,所述存储器存储有计算机程序,所述处理器配置成执行所述计算机程序时实现如权利要求1-8中任一项所述的基于Linux***的协议栈数据传输方法。
  10. 一种计算机可读存储介质,包含至少一个程序指令,所述至少一个程序指令用于执行如权利要求1-8中任一项所述的基于Linux***的协议栈数据传输方法。
PCT/CN2022/105026 2021-07-12 2022-07-12 基于Linux***的协议栈数据传输方法、计算机设备和存储介质 WO2023284699A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110785532.0 2021-07-12
CN202110785532.0A CN113505007A (zh) 2021-07-12 2021-07-12 基于Linux***的协议栈数据传输方法、计算机设备和存储介质
CN202111177649.7 2021-10-09
CN202111177649.7A CN113806116A (zh) 2021-07-12 2021-10-09 基于Linux***的协议栈数据传输方法、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2023284699A1 true WO2023284699A1 (zh) 2023-01-19

Family

ID=78012793

Family Applications (6)

Application Number Title Priority Date Filing Date
PCT/CN2022/104739 WO2023284653A1 (zh) 2021-07-12 2022-07-08 音频驱动的***兼容的方法、装置和设备
PCT/CN2022/105002 WO2023284693A1 (zh) 2021-07-12 2022-07-11 定位信息的获取方法、装置、电子设备及存储介质
PCT/CN2022/104869 WO2023284672A1 (zh) 2021-07-12 2022-07-11 定位信息的获取方法、装置、电子设备及存储介质
PCT/CN2022/105026 WO2023284699A1 (zh) 2021-07-12 2022-07-12 基于Linux***的协议栈数据传输方法、计算机设备和存储介质
PCT/CN2022/105172 WO2023284732A1 (zh) 2021-07-12 2022-07-12 基于Linux内核的协议栈数据传输方法及装置
PCT/CN2022/105303 WO2023284759A1 (zh) 2021-07-12 2022-07-12 指纹访问方法、装置、设备及存储介质

Family Applications Before (3)

Application Number Title Priority Date Filing Date
PCT/CN2022/104739 WO2023284653A1 (zh) 2021-07-12 2022-07-08 音频驱动的***兼容的方法、装置和设备
PCT/CN2022/105002 WO2023284693A1 (zh) 2021-07-12 2022-07-11 定位信息的获取方法、装置、电子设备及存储介质
PCT/CN2022/104869 WO2023284672A1 (zh) 2021-07-12 2022-07-11 定位信息的获取方法、装置、电子设备及存储介质

Family Applications After (2)

Application Number Title Priority Date Filing Date
PCT/CN2022/105172 WO2023284732A1 (zh) 2021-07-12 2022-07-12 基于Linux内核的协议栈数据传输方法及装置
PCT/CN2022/105303 WO2023284759A1 (zh) 2021-07-12 2022-07-12 指纹访问方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (8) CN113505007A (zh)
WO (6) WO2023284653A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625246A (zh) * 2020-05-15 2020-09-04 武汉蓝星科技股份有限公司 一种Linux-Android终端双***的桌面管理方法
CN113505007A (zh) * 2021-07-12 2021-10-15 北京鲸鲮信息***技术有限公司 基于Linux***的协议栈数据传输方法、计算机设备和存储介质
CN114153564B (zh) * 2021-12-07 2024-04-26 北京字节跳动网络技术有限公司 多***中近场通信单元访问方法及装置、电子设备、存储介质
CN114356804B (zh) * 2021-12-28 2024-05-31 北京奕斯伟计算技术股份有限公司 通信方法、装置、设备、计算机可读存储介质及程序产品
CN113990354B (zh) * 2021-12-29 2022-06-17 北京鲸鲮信息***技术有限公司 基于Linux的音频控制方法、装置、设备和存储介质
CN114242105A (zh) * 2022-02-24 2022-03-25 麒麟软件有限公司 一种对Android应用实施录音降噪的方法和***
CN116782370A (zh) * 2022-03-07 2023-09-19 Oppo广东移动通信有限公司 定位方法、装置、可穿戴设备、存储介质及产品
CN115562765B (zh) * 2022-12-05 2023-04-07 北京小米移动软件有限公司 定位组件的控制方法、装置、电子设备及存储介质
CN117978210A (zh) * 2022-12-09 2024-05-03 北京小米移动软件有限公司 近场通信nfc业务的处理方法、装置、电子设备及存储介质
CN116737281B (zh) * 2023-01-12 2024-01-09 银河航天(北京)通信技术有限公司 文件上注的方法、装置及存储介质
CN116795452B (zh) * 2023-07-20 2024-04-02 龙芯中科(北京)信息技术有限公司 驱动程序兼容性的确定方法、装置及设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5265239A (en) * 1991-04-08 1993-11-23 Ardolino Anthony A Method for remotely accessing service programs of a local processing system supporting multiple protocol stacks and multiple device drivers
CN105893038A (zh) * 2016-03-30 2016-08-24 大连理工大学 一种安卓蓝牙协议栈向Mint17***移植的方法
CN111182063A (zh) * 2019-12-30 2020-05-19 奇安信科技集团股份有限公司 应用于电子设备的数据处理方法、电子设备及介质
CN111427617A (zh) * 2019-01-09 2020-07-17 阿里巴巴集团控股有限公司 数据处理方法、装置及设备
CN113505007A (zh) * 2021-07-12 2021-10-15 北京鲸鲮信息***技术有限公司 基于Linux***的协议栈数据传输方法、计算机设备和存储介质

Family Cites Families (44)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7734829B2 (en) * 2004-06-09 2010-06-08 Emc Corporation Methods, systems, and computer program products for transparently controlling communications between network applications and a plurality of network communications protocol stacks using deferred protocol stack association
TW200636631A (en) * 2005-04-15 2006-10-16 Mitac Int Corp Satellite navigation device for real-time route planning
US7577441B2 (en) * 2007-06-27 2009-08-18 Motorola, Inc. Method and device for determining a position of a portable electronic device
US20110161620A1 (en) * 2009-12-29 2011-06-30 Advanced Micro Devices, Inc. Systems and methods implementing shared page tables for sharing memory resources managed by a main operating system with accelerator devices
CN101866326B (zh) * 2010-05-24 2012-10-24 北京航空航天大学 一种消息传递接口支持总线通信框架
WO2012092706A1 (en) * 2011-01-04 2012-07-12 Motorola Mobility, Inc. Hybrid operating system media integration
CN102833080A (zh) * 2011-06-15 2012-12-19 康佳集团股份有限公司 一种应用软件的进程间通信方法和***
CN102339234B (zh) * 2011-07-12 2013-04-17 迈普通信技术股份有限公司 一种协议栈运行装置和方法
WO2013026461A1 (en) * 2011-08-19 2013-02-28 Abb Research Ltd Method, positioning unit and system for communication in a mine
CN102984823A (zh) * 2012-10-30 2013-03-20 上海孚恩电子科技有限公司 物联网移动终端的多功能管理***
US8893222B2 (en) * 2012-11-13 2014-11-18 Auckland Uniservices Ltd. Security system and method for the android operating system
US9378038B2 (en) * 2013-06-07 2016-06-28 American Megatrends, Inc. Methods, devices and computer readable storage devices for emulating a gyroscope in a guest operating system from a host operating system
JP6404911B2 (ja) * 2013-09-20 2018-10-17 オラクル・インターナショナル・コーポレイション ネットワーク通信環境における仲介主体のための信頼できるメッセージングのための手法
CN103761089B (zh) * 2014-01-14 2017-09-15 清华大学 基于寄存器传输语言确定动态函数调用关系的方法
CN109344112A (zh) * 2014-07-08 2019-02-15 北京航空航天大学 一种基于多核处理器架构的机器人混合***应用框架
US10265848B2 (en) * 2014-07-08 2019-04-23 Beihang University Robotic hybrid system application framework based on multi-core processor architecture
CN104267956B (zh) * 2014-09-28 2016-05-11 深圳光启智能光子技术有限公司 一种操作***中控制硬件设备的方法和装置
CN105657562A (zh) * 2014-11-10 2016-06-08 乐视致新电子科技(天津)有限公司 一种实现卡拉ok应用的***和方法
CN104567821A (zh) * 2015-01-27 2015-04-29 合肥华科信息科技有限公司 一种基于卫星定位的交通事故现场勘察测绘***
US10015120B2 (en) * 2015-03-25 2018-07-03 Oracle International Corporation Providing message delivery services between requestors and providers
US10467421B2 (en) * 2015-10-23 2019-11-05 Oracle International Corporation Establishing trust between containers
CN105491524B (zh) * 2015-12-11 2019-04-26 小米科技有限责任公司 一种确定目标便携设备位置的方法和装置
CN107515790A (zh) * 2016-06-16 2017-12-26 成都鼎桥通信技术有限公司 电子设备的***
CN109669782A (zh) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 硬件抽象层复用方法、装置、操作***和设备
CN109669723B (zh) * 2017-10-13 2023-06-13 斑马智行网络(香港)有限公司 硬件访问方法、装置、设备和机器可读介质
WO2019078917A1 (en) * 2017-10-20 2019-04-25 Galatea Technology LLC METHOD AND APPARATUS FOR VIRTUAL WRITING ON AN NFC CHIP
CN108304247A (zh) * 2017-12-19 2018-07-20 华为技术有限公司 访问摄像头的方法和装置、服务器、可读存储介质
CN108152839B (zh) * 2017-12-22 2021-11-19 西安烽火电子科技有限责任公司 基于Android操作***的北斗数据通信***及方法
CN109313566B (zh) * 2017-12-27 2022-06-07 深圳前海达闼云端智能科技有限公司 一种虚拟机的音频播放方法及其装置、移动终端
CN108319513B (zh) * 2018-01-23 2021-04-02 北京东土科技股份有限公司 一种多分区操作***中的消息传递方法及装置
CN109063434A (zh) * 2018-07-24 2018-12-21 广州朗国电子科技有限公司 同步解锁双***会议白板的方法及***
US20200218500A1 (en) * 2019-01-04 2020-07-09 Joseph Thomas Hanley System and method for audio information instruction
FR3094514A1 (fr) * 2019-03-25 2020-10-02 Proton World International N.V. Système électronique
CN110262874B (zh) * 2019-05-31 2023-08-22 东信和平科技股份有限公司 一种基于java虚拟机的新型物联网多任务操作***及方法
CN112073762B (zh) * 2019-06-10 2022-05-06 聚好看科技股份有限公司 基于多***显示设备的信息获取方法及多***显示设备
CN112073448B (zh) * 2019-06-11 2022-10-11 成都鼎桥通信技术有限公司 一种双***终端的服务隔离方法和装置
CN110515667B (zh) * 2019-08-26 2023-04-11 武汉蓝星科技股份有限公司 一种基于linux内核的终端双***显示切换方法及终端双***
CN112749017A (zh) * 2019-10-31 2021-05-04 中兴通讯股份有限公司 移动通信方法及装置、存储介质、电子装置
CN112751815B (zh) * 2019-10-31 2021-11-19 华为技术有限公司 报文处理方法、装置、设备及计算机可读存储介质
CN110944286A (zh) * 2019-11-28 2020-03-31 出门问问信息科技有限公司 提供定位信息的方法、装置、***及存储介质
CN111930340B (zh) * 2020-09-21 2021-06-01 北京技德***技术有限公司 一种基于Linux与Android兼容技术的虚拟音频装置与方法
CN112099923B (zh) * 2020-11-17 2021-02-05 江苏北弓智能科技有限公司 一种运行于Linux操作***上的Android虚拟化***
CN112882987A (zh) * 2021-03-12 2021-06-01 北京小米移动软件有限公司 多核通信方法、装置、电子设备及存储介质
CN113792280A (zh) * 2021-09-24 2021-12-14 北京鲸鲮信息***技术有限公司 指纹访问方法、装置、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5265239A (en) * 1991-04-08 1993-11-23 Ardolino Anthony A Method for remotely accessing service programs of a local processing system supporting multiple protocol stacks and multiple device drivers
CN105893038A (zh) * 2016-03-30 2016-08-24 大连理工大学 一种安卓蓝牙协议栈向Mint17***移植的方法
CN111427617A (zh) * 2019-01-09 2020-07-17 阿里巴巴集团控股有限公司 数据处理方法、装置及设备
CN111182063A (zh) * 2019-12-30 2020-05-19 奇安信科技集团股份有限公司 应用于电子设备的数据处理方法、电子设备及介质
CN113505007A (zh) * 2021-07-12 2021-10-15 北京鲸鲮信息***技术有限公司 基于Linux***的协议栈数据传输方法、计算机设备和存储介质
CN113806116A (zh) * 2021-07-12 2021-12-17 北京鲸鲮信息***技术有限公司 基于Linux***的协议栈数据传输方法、计算机设备和存储介质

Also Published As

Publication number Publication date
WO2023284732A1 (zh) 2023-01-19
CN113821359B (zh) 2024-04-26
CN113821360A (zh) 2021-12-21
CN113821359A (zh) 2021-12-21
WO2023284653A1 (zh) 2023-01-19
WO2023284672A1 (zh) 2023-01-19
CN113505007A (zh) 2021-10-15
CN113626224B (zh) 2024-03-19
CN113806116A (zh) 2021-12-17
CN113626224A (zh) 2021-11-09
WO2023284693A1 (zh) 2023-01-19
CN113608898A (zh) 2021-11-05
WO2023284759A1 (zh) 2023-01-19
CN114253740A (zh) 2022-03-29
CN113722128A (zh) 2021-11-30

Similar Documents

Publication Publication Date Title
WO2023284699A1 (zh) 基于Linux***的协议栈数据传输方法、计算机设备和存储介质
US10986171B2 (en) Method for unified communication of server, baseboard management controller, and server
US10698717B2 (en) Accelerator virtualization method and apparatus, and centralized resource manager
WO2019127476A1 (zh) 虚拟***蓝牙通信方法及装置、虚拟***、存储介质及电子设备
EP2911342A1 (en) Home gateway and intelligent terminal integrated system and communication method therefor
TW200522583A (en) IP-based method and apparatus for booting computers remotely in wide-area-network environment
WO2019057089A1 (zh) 网卡镜像抓包方法、终端以及可读存储介质
WO2022032990A1 (zh) 一种命令信息传输方法、***、装置及可读存储介质
JP6665190B2 (ja) ネットワーク共有実施方法及び装置
WO2024088268A1 (zh) Rdma事件管理方法、设备及存储介质
TWI418178B (zh) 利用代理伺服器控制內嵌裝置外部通訊之技術
US9087031B2 (en) Method and program for selective suspension of USB device
EP2685385A1 (en) Network system
CN116150054B (zh) 一种基于pcie的中断信息处理方法
CN109800202B (zh) 一种基于pcie的数据传输***、方法及装置
US9078282B2 (en) Method and apparatus for implementing network device function of wireless communication terminal
JP3880513B2 (ja) 中継処理装置、制御方法、プログラム、記録媒体、及び端末制御サーバ
CN111708568B (zh) 一种组件化开发解耦方法及终端
JP5870804B2 (ja) 通信制御システム、通信制御方法及び通信制御プログラム
WO2019127475A1 (zh) 虚拟sim卡的实现方法及装置、存储介质、电子设备
JP5848741B2 (ja) ホストと無線インターネットアクセスモジュールとの間の通信方法、及びホスト通信モジュール
CN117061270A (zh) 一种基于分布式软总线实现远程设备本地化虚拟与访问的方法
CN115604372A (zh) 热启动过程中保持协议报文不中断的方法及装置
CN118055084A (zh) 网络收包方法、装置、电子设备、存储介质及程序
JP2009032235A (ja) 単一の識別コードでインターネットおよび磁気記憶装置アクセスサービスを提供するハードディスクレス型コンピュータシステム、およびそのデータ送受信方法

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE