A data transmission method, device and system
By adopting a dual-stack structure and window allocation rules in user mode and kernel mode in Bluetooth devices, the performance overhead and adaptability issues in data transmission between Bluetooth networks and non-Bluetooth networks are solved, and efficient and low-power data transmission is achieved.
Patent Information
- Application Number
- CN202211444227.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-11-18
AI Technical Summary
In data transmission between Bluetooth networks and non-Bluetooth networks, existing technologies have the problem of excessive performance overhead caused by multiple traversals between user mode and kernel mode, or the problem of poor adaptability due to the need for major changes to upper-layer applications.
A dual-stack structure of user-state Bluetooth protocol stack and kernel-state Bluetooth protocol stack is adopted, and the message sending order is managed in combination with window allocation rules to avoid multiple traversals between user state and kernel state, reduce power consumption, and the upper-layer applications do not need to be modified.
It reduces performance overhead, lowers power consumption, and improves adaptability, ensuring efficient and flexible data transmission.
Smart Images

Figure CN118057880B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, in particular to a data transmission method, device and system. BACKGROUND
[0002] Currently, to realize data transmission between a device in a Bluetooth network and a device in a non-Bluetooth network (such as an Ethernet network), a forwarding device is needed to forward data. In the data transmission between a device in a Bluetooth network and a device in a non-Bluetooth network, the forwarding device usually needs to traverse the user mode and the kernel mode multiple times when processing Bluetooth data, which causes excessive performance overhead, or the upper-layer application of the forwarding device needs to be greatly changed, which causes poor adaptability. SUMMARY
[0003] Embodiments of the present application disclose a data transmission method, device and system. By implementing the embodiments of the present application, the forwarding device can process forwarding data and non-forwarding data based on a user-mode Bluetooth protocol stack and a kernel-mode Bluetooth protocol stack respectively, which can reduce power consumption and has high adaptability.
[0004] In a first aspect, the embodiments of the present application disclose a data transmission method, applied to a forwarding device, a first device and the forwarding device communicate through a first network, and the forwarding device and a second device communicate through Bluetooth, the method comprising:
[0005] The forwarding device receives a first message sent by the first device, the first message comprising first data and first indication information; the first indication information is used to indicate that the receiving device is the second device;
[0006] The forwarding device analyzes the first message through a first protocol stack corresponding to the first network to obtain the first data and the first indication information;
[0007] The forwarding device processes the first data and the first indication information through a first Bluetooth protocol stack in the kernel mode to obtain a second message;
[0008] The forwarding device sends the second message to the second device based on a window allocation rule; the window allocation rule is used to manage the sending order of messages from a second Bluetooth protocol stack in the user mode and messages from the first Bluetooth protocol stack.
[0009] By implementing the embodiments of the present application, the forwarding device can process forwarding data and non-forwarding data based on a second Bluetooth protocol stack in the user mode and a first Bluetooth protocol stack in the kernel mode respectively, the forwarding data is processed through the first Bluetooth protocol stack in the kernel mode, and the forwarding device does not need to traverse the user mode and the kernel mode multiple times, which can reduce performance overhead and power consumption; the second Bluetooth protocol stack in the user mode is used to process non-forwarding data, and the upper-layer application does not need to be changed, that is, the second Bluetooth protocol stack in the user mode can be used to process Bluetooth data, and the scheme has high adaptability.
[0010] The forwarding data refers to the forwarding data in the heterogeneous network, such as the first data in the foregoing description; the non-forwarding data refers to the data directly communicated between the forwarding device and other devices, and the data is not forwarded through a third party. For example, the third device establishes a Bluetooth communication connection with the forwarding device, the sending end is the third device, the receiving end is the forwarding device, and the data sent by the third device to the forwarding device through the Bluetooth communication connection is the non-forwarding data.
[0011] It should be noted that the "first" and "second" in the first Bluetooth protocol stack and the second Bluetooth protocol stack are only used to distinguish the two protocol stacks, and should not cause limitation to the embodiments of the present application. In some embodiments exemplarily shown in the following, the second Bluetooth protocol stack in the user mode is referred to as a "Bluetooth protocol stack", and the first Bluetooth protocol stack in the kernel mode is referred to as a "Bluetooth protocol sub-stack".
[0012] In combination with the first aspect, in a possible implementation, the window allocation rule includes that the message from the first Bluetooth protocol stack is preferentially sent, the message from the second Bluetooth protocol stack is preferentially sent, the message from the first Bluetooth protocol stack and the message from the second Bluetooth protocol stack are sent in proportion.
[0013] In a possible implementation, the window allocation rule of the forwarding device is flexible to change. For example, when the window allocation module simultaneously receives the message from the first Bluetooth protocol stack and the message from the second Bluetooth protocol stack, the forwarding device can select the message to be sent based on the window allocation rule of sending in proportion; when the window allocation module only receives the message from the first Bluetooth protocol stack or the message from the second Bluetooth protocol stack, the forwarding device can directly send the received message, without waiting for the message of the other protocol stack.
[0014] By implementing the embodiments of the present application, because the dual-stack structure of the second Bluetooth protocol stack in the user mode and the first Bluetooth protocol stack in the kernel mode is deployed in the forwarding device, in the process of receiving and sending Bluetooth data, the forwarding device can determine whether to send the second Bluetooth protocol stack or the first Bluetooth protocol stack at present through the window allocation rule, and can avoid the problem of data congestion, thereby improving the data transmission.
[0015] In combination with the first aspect, in a possible implementation, the forwarding device sends the second message to the second device based on the window allocation rule, including:
[0016] The forwarding device obtains the busy / idle situation of the window of the Bluetooth controller.
[0017] The forwarding device sends the second message through the idle window when the Bluetooth controller has the idle window.
[0018] In a possible implementation, the forwarding device can obtain the window busy state of the Bluetooth controller through the window allocation module; when there is an idle window of the Bluetooth controller, the window allocation module sends the second message to the idle window of the Bluetooth controller, and the Bluetooth controller sends the second message to the second device through the idle window.
[0019] With reference to the first aspect, in a possible implementation, the method further includes:
[0020] The forwarding device receives a third message sent by the second device, the third message including second data and second indication information; the second indication information is used to indicate that the receiving device is the first device;
[0021] When it is determined that the third message indicates forwarding, the forwarding device analyzes the third message through the first Bluetooth protocol stack to obtain the second data;
[0022] The forwarding device processes the second data and the second indication information through the first protocol stack to obtain a fourth message;
[0023] The forwarding device sends the fourth message to the first device based on the second indication information.
[0024] By implementing the embodiments of the present application, when the forwarding device receives a Bluetooth message that needs to be forwarded to another device, the first Bluetooth protocol stack located in the kernel state can be used for processing, and the performance overhead can be reduced and the power consumption can be lowered without multiple traversals of the user state and the kernel state.
[0025] With reference to the first aspect, in a possible implementation, the method further includes:
[0026] The forwarding device generates a Bluetooth message through the second Bluetooth protocol stack in response to a user operation;
[0027] The forwarding device sends the Bluetooth message to a third device based on a window allocation rule, and the third device communicates with the forwarding device through Bluetooth.
[0028] By implementing the embodiments of the present application, the forwarding device directly communicates with other devices through Bluetooth, and when the forwarding device does not act as a forwarding role, the forwarding device can generate a Bluetooth message through the second Bluetooth protocol stack in the user state in response to an upper-layer application, so that the upper-layer application can perform Bluetooth data processing through the second Bluetooth protocol stack in the user state without modification, and the scheme has high adaptability.
[0029] With reference to the first aspect, in a possible implementation, the method further includes:
[0030] The forwarding device receives a fifth message sent by the second device, the fifth message including third data and third indication information; the third indication information is used to indicate that the receiving device is the forwarding device;
[0031] The forwarding device parses the third message based on the first Bluetooth protocol stack to obtain fourth data and third indication information;
[0032] The forwarding device parses the fourth data based on the second indication information through the second Bluetooth protocol stack to obtain third data.
[0033] Implementing the embodiments of the present application, when the forwarding device receives a Bluetooth message sent to the forwarding device, the forwarding device can send the message to the second Bluetooth protocol stack for parsing when it is determined through the first Bluetooth protocol stack that the message is not forwarding data.
[0034] In a second aspect, the embodiments of the present application disclose a data transmission device, the device communicates with a first device through a first network, and communicates with a second device through Bluetooth, and the device comprises:
[0035] A network receiving unit is configured to receive a first message sent by the first device, the first message comprising first data and first indication information; the first indication information is used to indicate that the receiving device is the second device;
[0036] A first protocol stack corresponding to the first network is configured to parse the first message to obtain the first data and the first indication information;
[0037] A first Bluetooth protocol stack in a kernel state is configured to process the first data and the first indication information to obtain a second message;
[0038] A window allocation unit is configured to send the second message to the second device based on a window allocation rule; the window allocation rule is used to manage the sending order of messages from a second Bluetooth protocol stack in a user state and messages from the first Bluetooth protocol stack.
[0039] In a possible implementation, the network receiving unit is configured to receive messages of the first network; for example, when the first network is an Ethernet, the network receiving unit can comprise a network card driver or a WIFI driver; the window allocation unit can comprise a window allocation module in the first Bluetooth protocol stack and a Bluetooth sending unit, wherein the window allocation module is configured to determine the sending of content from the first Bluetooth protocol stack or from the second Bluetooth protocol stack based on the window allocation rule; and the Bluetooth sending unit is configured to send Bluetooth messages in a Bluetooth network, and can comprise a UART driver, a UART interface, and a Bluetooth controller.
[0040] In a possible implementation, the window allocation module can be a module in the first Bluetooth protocol stack, as shown in the following. Figure 6 It should be noted that, in the embodiments of the present application, the division of each functional module can be split into more functional modules, or combined into one functional module, and the embodiments of the present application do not limit this.
[0041] In a possible implementation, the first Bluetooth protocol stack includes part or all of the second Bluetooth protocol stack.
[0042] With reference to the second aspect, in a possible implementation, the window allocation rule includes priority sending of the message from the first Bluetooth protocol stack, priority sending of the message from the second Bluetooth protocol stack, proportional sending of the message from the first Bluetooth protocol stack and the message from the second Bluetooth protocol stack.
[0043] With reference to the second aspect, in a possible implementation, the window allocation unit is configured to acquire the busy state of the window of the Bluetooth controller.
[0044] When the Bluetooth controller has a free window, the second message is sent through the free window.
[0045] With reference to the second aspect, in a possible implementation, the apparatus further includes a Bluetooth receiving unit and a network sending unit.
[0046] The Bluetooth receiving unit is configured to receive a third message sent by the second device, the third message including second data and second indication information; and the second indication information is used to indicate that the receiving device is the first device.
[0047] The first Bluetooth protocol stack is configured to parse the third message to obtain the second data when it is determined that the third message indicates forwarding.
[0048] The first protocol stack is configured to process the second data and the second indication information to obtain a fourth message.
[0049] The network sending unit is configured to send the fourth message to the first device based on the second indication information.
[0050] In a possible implementation, the network sending unit is configured to send a message of the first network, for example, when the first network is an Ethernet network, the network sending unit can include a network card driver or a WIFI driver, etc.; and the Bluetooth receiving unit is configured to receive a Bluetooth message in a Bluetooth network, and can include a UART driver, a UART interface, and a Bluetooth controller, etc.
[0051] With reference to the second aspect, in a possible implementation, the second Bluetooth protocol stack is configured to generate a Bluetooth message in response to a user operation.
[0052] The window allocation unit is configured to send a Bluetooth message to a third device based on the window allocation rule, the third device communicating with the forwarding device through Bluetooth.
[0053] With reference to the second aspect, in a possible implementation, the apparatus further includes a Bluetooth receiving unit.
[0054] The Bluetooth receiving unit is configured to receive a fifth message sent by the second device, wherein the fifth message comprises third data and third indication information; and the third indication information is used to indicate that the receiving device is a forwarding device.
[0055] The first Bluetooth protocol stack is configured to parse the third message to obtain the fourth data and the third indication information.
[0056] The second Bluetooth protocol stack is configured to parse the fourth data to obtain the third data.
[0057] In a possible implementation, the first Bluetooth protocol stack and the second Bluetooth protocol stack communicate through a virtual serial port UART. When the first Bluetooth protocol stack determines that the receiving device of the third message is a forwarding device based on the third indication information, the first Bluetooth protocol stack can send the fourth data to the second Bluetooth protocol stack through the virtual serial port UART. Then, the second Bluetooth protocol stack can parse the fourth data to obtain the third data.
[0058] In a third aspect, an embodiment of the present application discloses a data transmission apparatus, comprising a processor and a communication interface, wherein the processor is configured to invoke a computer program stored in a memory to implement the method described in the first aspect or any possible implementation of the first aspect.
[0059] In a fourth aspect, an embodiment of the present application further provides a chip system, comprising at least one processor and a communication interface, wherein the communication interface is configured to send and / or receive data, and the at least one processor is configured to invoke a computer program stored in at least one memory to enable the apparatus where the chip system is located to implement the method described in the first aspect or any possible implementation of the first aspect.
[0060] In a fifth aspect, an embodiment of the present application discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and when the computer program runs on one or more processors, the method described in the first aspect or any possible implementation of the first aspect is executed.
[0061] In a sixth aspect, an embodiment of the present application discloses a computer program product, and when the computer program product runs on one or more processors, the method described in the first aspect or any possible implementation of the first aspect is executed. BRIEF DESCRIPTION OF DRAWINGS
[0062] The following describes the drawings used in the embodiments of the present application.
[0063] Figure 1 FIG. 1 is a schematic diagram of a Bluetooth deployment provided by an embodiment of the present application;
[0064] Figure 2is a schematic diagram of a heterogeneous network provided by an embodiment of the present application;
[0065] Figure 3 is a schematic diagram of another Bluetooth deployment provided by an embodiment of the present application;
[0066] Figure 4 is a schematic diagram of yet another Bluetooth deployment provided by an embodiment of the present application;
[0067] Figure 5 is a schematic diagram of a possible data transmission system provided by an embodiment of the present application;
[0068] Figure 6 is a schematic diagram of a Bluetooth deployment of a current device provided by an embodiment of the present application;
[0069] Figure 7 is a schematic diagram of a transmission window provided by an embodiment of the present application;
[0070] Figure 8A is a schematic diagram of a data transmission method provided by an embodiment of the present application;
[0071] Figure 8B is a flowchart of a data transmission method provided by an embodiment of the present application;
[0072] Figure 9 is a schematic diagram of a data transmission apparatus provided by an embodiment of the present application;
[0073] Figure 10 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application;
[0074] Figure 11 is a software structure block diagram of an electronic device 100 provided by an embodiment of the present application. DETAILED DESCRIPTION
[0075] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. It should be noted that in the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or advantageous than other embodiments or design schemes. In fact, the use of the words "exemplary" or "for example" is intended to present the relevant concept in a specific way.
[0076] The "at least one" mentioned in the embodiments of the present application refers to one or more, and "multiple" refers to two or more. "At least one of the following" or the like refers to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, and c can be single or multiple. "And / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent three cases of A alone, A and B together, and B alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0077] In addition, unless otherwise stated, the ordinal numbers "first", "second", etc. used in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, time sequence, priority or importance of the multiple objects. For example, the first information and the second information are only used to distinguish different information, and do not mean that the contents, priority, sending order or importance of the two kinds of information are different.
[0078] Before introducing the embodiments of the present application, the technical terms appearing in the embodiments of the present application are introduced.
[0079] 1、Bluetooth
[0080] Bluetooth is a common communication protocol. Bluetooth devices usually need to deploy two parts, Bluetooth Host and Bluetooth Controller. Among them, the Bluetooth Host is usually run in the System on Chip (SOC) of the Bluetooth device, mainly responsible for the processing of protocol logic; the Bluetooth Controller is usually a separate chip hanging outside the SOC, and the Bluetooth Cont is more responsible for the processing of the Bluetooth physical layer, and a few SOC will integrate the Bluetooth Controller. It should be noted that the above Bluetooth device refers to a device supporting Bluetooth communication.
[0081] Please refer to Figure 1 , Figure 1 is a schematic diagram of a Bluetooth deployment provided by an embodiment of the present application.
[0082] As Figure 1As shown, the Bluetooth Host can include a Bluetooth application, a Bluetooth protocol stack, and a Universal Asynchronous Receiver / Transmitter (UART) interface; the Bluetooth Controller includes a UART interface. Among them, the UART interface of the Bluetooth Host and the UART interface of the Bluetooth Controller can be connected through a cable or a Printed Circuit Board (PCB) line to transmit data, such as for transmitting Host Controller Interface (HCI) commands; the Bluetooth Controller is connected with a Bluetooth antenna, and receives or sends Bluetooth data through the Bluetooth antenna.
[0083] 2. Heterogeneous network
[0084] Among them, heterogeneous means that two or more wireless data transmission systems adopt different access technologies, or adopt the same wireless access technology but belong to different wireless operators.
[0085] A product can have multiple communication devices, which can include Bluetooth devices, WIFI devices, Ethernet (ETH) devices, etc. These communication devices can form a network, for example, the Bluetooth devices of multiple products can form a Bluetooth network; for another example, the WIFI / ETH devices of multiple products can form an ETH network. The devices in the same network can freely communicate with each other.
[0086] However, the communication devices between different networks usually cannot directly communicate, and need to pass through a heterogeneous network solution to realize cross-network type communication, for example, forwarding data of an ETH network to a Bluetooth network or forwarding data of a Bluetooth network to an ETH network.
[0087] Please refer to Figure 2 , Figure 2 is a schematic diagram of a heterogeneous network provided by an embodiment of the present application. Among them, the heterogeneous network includes a router, device A, device B, device D, and device H. Among them, device A and device B both include Bluetooth devices and WIFI devices; device D and device H both include Bluetooth devices.
[0088] Figure 2 In the figure, a solid line represents a WiFi connection, and a dashed line represents a Bluetooth connection. As shown in Figure 2 , device A and device B respectively connect the WiFi of the router through their respective WiFi devices, which can form a WiFi network 1; device B and device H are connected through their respective Bluetooth devices, which form a Bluetooth network 1; device A and device D are connected through their respective Bluetooth devices, which form a Bluetooth network 2.
[0089] Two methods of data transmission in heterogeneous networks in the prior art are introduced as follows.
[0090] Method one: please refer to Figure 3 , Figure 3 is another schematic diagram of Bluetooth deployment provided by the embodiment of the present application. As shown in Figure 3 , the user state includes a Bluetooth protocol stack and a forwarding application, and the Bluetooth protocol stack and the forwarding application can perform data transmission through Inter-Process Communication (IPC); the kernel state includes an IP stack, a UART driver, a network card driver and a WiFi driver, wherein the Bluetooth protocol stack includes a Bluetooth chip driver program, such as vendorlib.
[0091] As shown in Figure 3 , the Bluetooth protocol stack is located in the user state, and the forwarding APP in the user state forwards the network from the IP to the Bluetooth network or forwards the data from the Bluetooth network to the ETH network. The Bluetooth chip driver program is generally provided by the chip manufacturer and is used to complete the initialization configuration, management and data transmission of the chip, and is usually not open source.
[0092] As shown in Figure 3 , since the commonly used IP protocol stack on the ETH network is generally implemented in the kernel state, when the data of the IP protocol and the data of the Bluetooth network are mutually forwarded, they need to cross between the user state and the kernel state multiple times, resulting in excessive performance overhead.
[0093] Method two: please refer to Figure 4 , Figure 4 is another schematic diagram of Bluetooth deployment provided by the embodiment of the present application. As shown in Figure 4 , the user state includes an application, and the kernel state includes a forwarding module, a Bluetooth protocol stack, an IP stack, a UART driver, a network card driver and a WiFi driver, wherein the Bluetooth protocol stack includes a Bluetooth chip driver.
[0094] As shown in Figure 4 , the Bluetooth protocol stack is located in the kernel state, and the kernel state includes a forwarding module, which is used to forward the network from the IP to the Bluetooth network or to forward the data from the Bluetooth network to the ETH network.
[0095] In this method, the Bluetooth protocol stack is directly moved to the kernel state, which solves the problem of multiple crossings between the user state and the kernel state, but has a great impact on the upper layer application and needs to be matched with the change of the upper layer application design. In addition, this method needs the chip manufacturer to provide the Bluetooth chip driver program, but is limited by the open source protocol of the kernel, and the driver needs to be open source, while the chip driver usually contains the core value assets of the Bluetooth chip manufacturer, and the manufacturer generally does not want to open source.
[0096] The system architecture and business scenarios of the embodiments of the present application are described below. It should be noted that the system architecture and business scenarios described in the present application are for more clearly illustrating the technical solutions of the present application, and do not constitute a limitation on the technical solutions provided by the present application. Those skilled in the art can know that, with the evolution of system architecture and the appearance of new business scenarios, the technical solutions provided by the present application are also applicable to similar technical problems.
[0097] Please refer to Figure 5 , Figure 5 is a possible data transmission system provided by the embodiments of the present application. The data transmission system 10 includes a first device 101, a forwarding device 102 and a second device 103. Wherein:
[0098] As shown in Figure 5 , the first device 101 and the forwarding device 102 establish a Bluetooth connection, and the forwarding device 102 and the second device 103 establish a non-Bluetooth communication connection. For example, the first device 101 and the forwarding device 102 communicate through a Bluetooth network, and the forwarding device 102 and the second device 103 communicate through a WiFi network.
[0099] In some embodiments, when the first device 101 sends data to the second device 103, since the first device 101 and the second device 103 are not in the same network, the first device 101 can first forward the data to the second device 103 through the forwarding device 102.
[0100] It can be understood that the first device 101 can be the sending end and the second device 103 can be the receiving end, or the second device 103 can be the sending end and the first device 101 can be the receiving end, which can be determined according to the specific scene, and is not limited here.
[0101] Wherein, the first device 101, the forwarding device 102 and the second device 103 can all be electronic devices. The electronic device can include but not limited to mobile phones, wearable devices (such as watches, etc.), tablets, displays, televisions, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers, netbooks, augmented reality devices, virtual reality devices, artificial intelligence devices, vehicle-mounted devices, smart home devices, etc.
[0102] Here is only an example, and should not cause a limitation on the first device 101 and the second device 103. In different application scenarios, the first device 101, the forwarding device 102 and the second device 103 can be the same or different devices, which are not limited here.
[0103] It should be noted that the above data transmission system can further include other network elements or devices (such as a router), which are not limited here.
[0104] Next, the devices in the above data transmission system are introduced.
[0105] Please refer to Figure 6 , Figure 6 is a schematic diagram of a Bluetooth deployment of a current device provided by an embodiment of the present application. The current device can be any one of the first device 101, the forwarding device 102 and the second device 103 in the above data transmission system.
[0106] As shown in Figure 6 , the Bluetooth deployment of the current device includes a Bluetooth Host and a Bluetooth Controller, wherein the Bluetooth Host includes a user state and a kernel state, the user state can include a Bluetooth protocol stack and a Bluetooth application, the Bluetooth protocol stack and the Bluetooth application can communicate through IPC, wherein the Bluetooth protocol stack includes a Bluetooth driver, such as vendorlib; the kernel state includes a virtual UART, a forwarding module, a Bluetooth protocol sub-stack, a UART driver, a UART interface, other protocol stacks (such as an IP stack) and network card drivers, WiFi drivers, etc., wherein the Bluetooth protocol sub-stack includes a window allocation module. Wherein:
[0107] The Bluetooth protocol stack in the user state is responsible for the initialization of the Bluetooth Controller and the like; the kernel state can be used only to send standard HCI commands.
[0108] The Bluetooth protocol sub-stack in the kernel state is responsible for forwarding data in a heterogeneous network.
[0109] The virtual UART is used for data transmission between the Bluetooth protocol stack and the Bluetooth protocol sub-stack, and can specifically include sending data of the Bluetooth protocol stack to the Bluetooth protocol sub-stack, or sending data of the Bluetooth protocol sub-stack to the Bluetooth protocol stack. For example, when the Bluetooth protocol stack in the user state sends data to the Bluetooth Controller, the virtual UART can intercept the Bluetooth data and hand it over to the Bluetooth protocol sub-stack for scheduling transmission, which can be scheduled by the window allocation module in the Bluetooth protocol sub-stack. For another example, when the current device is a device receiving data, the Bluetooth protocol sub-stack transmits the data to the Bluetooth protocol stack through the virtual UART, which can be data sent to the Bluetooth protocol sub-stack by other protocol stacks, or data sent to the Bluetooth protocol sub-stack by the Bluetooth controller.
[0110] The forwarding module is used for data transmission between the Bluetooth protocol sub-stack and other protocol stacks. For example, the forwarding module can forward data from other network types to the Bluetooth protocol sub-stack. For another example, the forwarding module can forward data of the Bluetooth protocol sub-stack to other corresponding protocol stacks.
[0111] The Bluetooth protocol sub-stack contains part / whole of the Bluetooth protocol stack, and the window allocation module.
[0112] The window allocation module is used to manage data sent by the Bluetooth protocol stack and the Bluetooth protocol sub-stack to the Bluetooth Controller. For example, the window allocation module can send data from the Bluetooth protocol stack or the forwarding module to the UART interface when the Bluetooth Controller has a free sending window based on a configuration rule.
[0113] The configuration rule includes but is not limited to forwarding priority, Bluetooth protocol stack priority, and proportional allocation. The configuration rule is used for the window allocation module of the current device to determine whether to send the message to be sent by the Bluetooth protocol stack or the message to be sent by the Bluetooth protocol sub-stack when receiving the message to be sent by the Bluetooth protocol stack and the Bluetooth protocol sub-stack. The forwarding priority means that the window allocation module of the current device sends the message of the Bluetooth protocol sub-stack first when receiving the message to be sent by the Bluetooth protocol stack and the Bluetooth protocol sub-stack. The Bluetooth protocol stack priority means that the message of the Bluetooth protocol stack is sent first. The proportional allocation means that the contents of the Bluetooth protocol stack and the Bluetooth protocol sub-stack are sent in a certain proportion and order. For example, the proportion of the Bluetooth protocol stack: the Bluetooth protocol sub-stack is 2:1, then the window allocation module sends 2 messages from the Bluetooth protocol stack to the UART interface first, and then sends 1 message from the forwarding module to the UART interface, and so on.
[0114] The Bluetooth Controller can establish several sending windows inside. The message to be sent can be first transmitted to the idle sending window, and then sent to other devices from the sending window. After the Bluetooth Controller completes the message sending in one / multiple sending windows, a command is reported to the Bluetooth Host (specifically, the window allocation module in the Bluetooth Host), which is used to indicate that the message sending is completed. The command can be an HCI command indicating that the message sending is completed, and then the Bluetooth protocol sub-stack can know the busy / idle condition of the current sending window of the Bluetooth Controller through the command (such as the HCI command).
[0115] Please refer to Figure 7 , Figure 7 is a sending window schematic diagram provided by an embodiment of the present application.
[0116] As Figure 7 indicated, the window allocation module can receive data sent by the Bluetooth Controller through the UART, analyze and obtain the reported command therein. For example, the command can include a first HCI command and a second HCI command.
[0117] The first HCI command is used to indicate that the packet (or referred to as a package) is sent completely. For example, the first HCI command includes indication information used to indicate the busy state of the sending window. Specifically, the window allocation module can determine the busy state of the sending window based on the first HCI command. Then, based on the busy state of the sending window and the configuration rule, it is determined whether the packet of the Bluetooth protocol stack or the packet of the Bluetooth protocol sub-stack is sent next. When it is determined that the packet of the Bluetooth protocol stack is sent, the first HCI command is transparently transmitted to the virtual UART. When it is determined that the packet of the Bluetooth protocol sub-stack is sent, the HCI command is deducted, and the packet of the Bluetooth protocol sub-stack is sent to the Bluetooth Controller.
[0118] The second HCI command can include data sent by other devices to the current device and the data type of the data. The data type can include forwarding data or received data. The forwarding data is data that needs to be forwarded to a device of a non-Bluetooth network, and the received data is data sent to the current device. Then, the window allocation module can determine the data type of the data based on the second HCI command, and then send the forwarding data to the Bluetooth protocol sub-stack through the first channel and send the received data to the Bluetooth protocol stack through the second channel. The first channel and the second channel are different channels.
[0119] Please refer to Figure 8A , Figure 8A is a flowchart of a data transmission method provided by an embodiment of the present application.
[0120] First, in combination with Figure 8A , the data transmission process of sending the packet by the first device to the second device through the forwarding device is introduced.
[0121] On the first device side: the first device can generate a first packet including indication information and data through the Bluetooth protocol sub-stack in response to the user operation for the first application. The indication information can be generated by the heterogeneous transport protocol in the Bluetooth protocol sub-stack, and the indication information is used to indicate that the receiving device is the second device. The indication information can be the identifier (such as the address) of the second device. Then, the window allocation module in the Bluetooth protocol sub-stack sends the first packet to the UART interface of the first device through the UART driver of the first device. Then, the UART interface sends the first packet to the Bluetooth Controller of the first device through the cable or PBC line. The Bluetooth Controller sends the first packet to the Bluetooth Controller of the forwarding device.
[0122] On the forwarding device side: the Controller of the forwarding device can send the first message to the UART interface of the forwarding device through a cable or a PBC line after receiving the first message; the UART interface sends the first message to the Bluetooth protocol sub-stack of the forwarding device through the UART driver of the forwarding device; the Bluetooth protocol sub-stack parses the first message to obtain data and indication information, and then sends the data and the indication information to the forwarding module; the forwarding module determines the next protocol stack (such as the IP protocol stack) based on the indication information, and then forwards the data and the indication information to the next protocol stack; the next protocol stack performs protocol processing on the data and the indication information to obtain a second message, the second message including protocol-processed data and protocol-processed indication information; and then the second message is sent to the second device through a network card driver or a WiFi driver.
[0123] On the second device side: the second device sends the second message to other protocol stacks (such as the IP protocol stack) through a network card driver or a WiFi driver, and obtains the data in the second message by the other protocol stacks; and then the heterogeneous transmission protocol can report the data to the second application for display and other operations.
[0124] It should be noted that the above "first" and "second" are only used for distinction and do not limit the embodiments of the present application. For the convenience of understanding, the message sent by the sending device is referred to as the first message, and the message received by the receiving device is referred to as the second message; the "first" and "second" in the first message and the second message are only used for distinction, and the first message and the second message are the results of different protocol processing on the same data by different protocol stacks based on their respective protocol rules.
[0125] Next, the data transmission process of sending a message from the second device to the first device through the forwarding device is introduced in combination with Figure 8A
[0126] On the second device side: the second device can generate indication information indicating that the receiving device is the second device in response to a user operation on the second application, and then generate a first message including the indication information and data through other protocol stacks (such as the IP protocol stack); and the second device sends the first message to the forwarding device through a network card driver or a WiFi driver.
[0127] On the forwarding device side: the forwarding device receives the first message sent by the second device through the network card driver or WiFi driver; then, other protocol stacks (such as IP protocol stacks) parse the first message to obtain data and indication information; then, other protocol stacks send the data and indication information to the forwarding module; the forwarding module determines that the first message is a message forwarded to the first device based on the indication information, so the forwarding module sends the data and the indication information to the Bluetooth protocol substack, and the Bluetooth protocol substack performs protocol processing on the data and the indication information to obtain a second message, which includes the data after protocol processing and the indication information after protocol processing; then, the window allocation module sends the second message to the UART interface of the forwarding device through the UART driver of the forwarding device; then, the UART interface sends the second message to the Bluetooth controller Controller of the forwarding device through a cable or PBC line; the Bluetooth Controller of the forwarding device sends the first message to the Bluetooth Controller of the first device.
[0128] On the first device side: after receiving the second message, the Bluetooth controller of the first device sends the second message to the UART interface of the first device through a cable or PBC line; the UART interface sends the first message to the Bluetooth protocol substack of the forwarding device through the UART driver of the forwarding device; the Bluetooth protocol substack parses the second message to obtain the data and indication information in the second message; the Bluetooth protocol substack can report the parsed data to the first application, and the first application will perform display and other operations.
[0129] See Figure 8B , Figure 8B This is a flow chart of a data transmission method provided by an embodiment of the present application. Figure 8B As shown, the method includes some or all of the following steps:
[0130] S801: A first device establishes a first network connection with a forwarding device.
[0131] The first network is a network type other than a Bluetooth network, such as an Ethernet network, a WiFi network, etc., which is not limited here.
[0132] S802: The second device establishes a Bluetooth connection with the forwarding device.
[0133] Among them, the second device and the forwarding device are devices with Bluetooth function.
[0134] In some embodiments, the Bluetooth deployment of the second device and the forwarding device can be as follows Figure 6 shown.
[0135] S803: The first device sends, to the forwarding device through the first network connection, a first message including first data and first indication information; the first indication information is used to indicate that the receiving device is the second device.
[0136] In some embodiments, the first device, in response to a user operation of sending the first data to the second device, queries a device that can forward data for the first device and the second device when it is determined that the second device is not a device of the same network as the first device; when the forwarding device is determined, the first device sends, to the forwarding device through the first network connection, a first message including the first data and the first indication information; the first indication information is used to indicate that the receiving device is the second device.
[0137] S804: The forwarding device parses the first message through a first protocol stack corresponding to the first network to obtain the first data and the first indication information.
[0138] In some embodiments, the forwarding device, when receiving the first message sent from the second device, can parse the first message through a first protocol stack corresponding to the first network to obtain the first data and the first indication information.
[0139] For example, the first network is an IP protocol stack.
[0140] S805: The forwarding device processes the first data and the first indication information through a first Bluetooth protocol stack in a kernel state to obtain a second message.
[0141] In some embodiments, after the forwarding device parses the first message through the first protocol stack corresponding to the first network to obtain the first indication information, the forwarding device determines, based on the first indication information, that the protocol stack for processing the first data and the first indication information is the first Bluetooth protocol stack in the kernel state; and then the forwarding device processes the first data and the first indication information through the first Bluetooth protocol stack to obtain the second message.
[0142] The first Bluetooth protocol stack can be a Bluetooth protocol substack in the kernel state in the forwarding device, or can be the Bluetooth protocol substack in the kernel state as shown in FIG. 2. Figure 8A The first Bluetooth protocol stack can be a Bluetooth protocol substack in the kernel state in the forwarding device, or can be the Bluetooth protocol substack in the kernel state as shown in FIG. 2. Figure 6 The first Bluetooth protocol stack can be a Bluetooth protocol substack in the kernel state in the forwarding device, or can be the Bluetooth protocol substack in the kernel state as shown in FIG. 2.
[0143] S806: The forwarding device sends the second message to the second device based on a window allocation rule; the window allocation rule is used to manage the sending order of messages from a second Bluetooth protocol stack in a user state and messages from the first Bluetooth protocol stack.
[0144] In some embodiments, after obtaining the second message through the first Bluetooth protocol stack, the forwarding device can determine, through the window allocation module, whether to send the message from the second Bluetooth protocol stack in the user mode or the message from the first Bluetooth protocol stack; after determining to send the message from the first Bluetooth protocol stack, the second message is sent to the Bluetooth controller, and the second message is sent to the second device through the Bluetooth controller and the Bluetooth antenna.
[0145] The first Bluetooth protocol stack can be a Bluetooth protocol stack in the user mode as shown in Figure 6 The window allocation module can be a window allocation module in Figure 6 .
[0146] Please refer to Figure 9 , Figure 9 is a structural schematic diagram of a data transmission device provided by the embodiments of the present application. The device can be the forwarding device in the above. Of course, the device can also be a device in the forwarding device, such as a chip or an integrated circuit, etc. The device can include a network receiving unit 901, a first protocol stack 902 corresponding to the first network, a first Bluetooth protocol stack 903 in the kernel mode, and a window allocation unit 904. The data transmission device is used to implement the data transmission method described above, such as the data transmission method shown in any one of the embodiments of Figure 8A or Figure 8B .
[0147] In a possible implementation, the data transmission device communicates with a first device through a first network, and communicates with a second device through Bluetooth. The device includes:
[0148] The network receiving unit 901 is configured to receive a first message sent by the first device, the first message including first data and first indication information; the first indication information is used to indicate that the receiving device is the second device.
[0149] The first protocol stack 902 corresponding to the first network is configured to parse the first message to obtain the first data and the first indication information.
[0150] The first Bluetooth protocol stack 903 in the kernel mode is configured to process the first data and the first indication information to obtain a second message.
[0151] The window allocation unit 904 is configured to send the second message to the second device based on a window allocation rule; the window allocation rule is used to manage the sending order of a message from a second Bluetooth protocol stack 905 in the user mode and a message from the first Bluetooth protocol stack 903.
[0152] Implementing the embodiments of the present application, the forwarding device can process the forwarding data and the non-forwarding data based on the second Bluetooth protocol stack 905 in the user mode and the first Bluetooth protocol stack 903 in the kernel mode respectively, and the forwarding data is processed by the first Bluetooth protocol stack 903 in the kernel mode, without multiple traversals of the user mode and the kernel mode, so that the performance overhead can be reduced and the power consumption can be lowered; the second Bluetooth protocol stack 905 in the user mode is used to process the non-forwarding data, and the upper-layer application does not need to be changed, that is, the second Bluetooth protocol stack 905 in the user mode can be used for Bluetooth data processing, and the scheme has high adaptability.
[0153] In a possible implementation, the window allocation rule includes priority sending of the packet from the first Bluetooth protocol stack 903, priority sending of the packet from the second Bluetooth protocol stack 905, and proportional sending of the packet from the first Bluetooth protocol stack 903 and the packet from the second Bluetooth protocol stack 905.
[0154] Implementing the embodiments of the present application, because the dual-stack structure of the second Bluetooth protocol stack 905 in the user mode and the first Bluetooth protocol stack 903 in the kernel mode is deployed in the forwarding device, in the process of Bluetooth data receiving and Bluetooth data sending, the forwarding device can determine whether to send the second Bluetooth protocol stack 905 or the first Bluetooth protocol stack 903 by using the window allocation rule, so that the problem of data congestion can be avoided and the speed of data transmission can be improved.
[0155] In a possible implementation, the window allocation unit 904 is configured to acquire the busy / idle condition of the window of the Bluetooth controller.
[0156] When the idle window exists in the Bluetooth controller, the second packet is sent through the idle window.
[0157] In a possible implementation, the apparatus further includes a Bluetooth receiving unit 906 and a network sending unit 907.
[0158] The Bluetooth receiving unit 906 is configured to receive a third packet sent by the second device, where the third packet includes second data and second indication information; and the second indication information is used to indicate that the receiving device is the first device.
[0159] The first Bluetooth protocol stack 903 is configured to parse the third packet to obtain the second data when it is determined that the third packet indicates forwarding.
[0160] The first protocol stack 902 corresponding to the first network is configured to process the second data and the second indication information to obtain a fourth packet.
[0161] The network sending unit 907 is configured to send the fourth packet to the first device based on the second indication information.
[0162] Implementing the embodiments of the present application, when the forwarding device receives a Bluetooth message that needs to be forwarded to other devices, the first Bluetooth protocol stack 903 in the kernel mode can be used for processing, without multiple traversals of the user mode and the kernel mode, so that the performance overhead can be reduced and the power consumption can be lowered.
[0163] In a possible implementation, the second Bluetooth protocol stack 905 is configured to generate a Bluetooth message in response to a user operation.
[0164] The window allocation unit 904 is configured to send the Bluetooth message to a third device based on the window allocation rule, where the third device communicates with the forwarding device through Bluetooth.
[0165] In a possible implementation, the apparatus further includes a Bluetooth receiving unit 906.
[0166] The Bluetooth receiving unit 906 is configured to receive a fifth message sent by the second device, where the fifth message includes third data and third indication information, and the third indication information is used to indicate that the receiving device is the forwarding device.
[0167] The first Bluetooth protocol stack 903 is configured to parse the third message to obtain the fourth data and the third indication information.
[0168] The second Bluetooth protocol stack 905 is configured to parse the fourth data to obtain the third data.
[0169] Implementing the embodiments of the present application, when the forwarding device receives a Bluetooth message sent to the forwarding device, the forwarding device can send the message to the second Bluetooth protocol stack 905 for parsing when it is determined by the first Bluetooth protocol stack 903 that the message is not forwarding data.
[0170] In a possible implementation, the first Bluetooth protocol stack 903 and the second Bluetooth protocol stack 905 communicate through a virtual UART, so that the first Bluetooth protocol stack 903 can send the fourth data to the second Bluetooth protocol stack 905 based on the third indication information, and then the second Bluetooth protocol stack 905 can parse the fourth data to obtain the third data. The data transmission among the first Bluetooth protocol stack 903, the second Bluetooth protocol stack 905, and the virtual UART can be referred to the related description in the foregoing.
[0171] It should be noted that the implementation of each unit can also correspond to the related description of the corresponding embodiments shown in Figure 6 、 Figure 8A or Figure 8B . The data transmission apparatus can be Figure 6 ,Figure 8A or Figure 8B the forwarding device in the embodiments shown.
[0172] The electronic device 100 is taken as an example to specifically describe the device in the above, and the first device, the forwarding device and the second device in the above can all be the electronic device 100.
[0173] Figure 10 An exemplary hardware structure schematic diagram of the electronic device 100 is shown.
[0174] It should be understood that the electronic device 100 can have more or fewer components than those shown, can combine two or more components, or can have a different configuration of components. Figure 10 The various components shown in the above can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0175] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0176] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0177] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0178] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0179] The memory in the processor 110 can also be configured to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. Avoiding repeated access reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0180] In some embodiments, the processor 110 can include one or more interfaces. The interface can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0181] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can contain multiple sets of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces respectively. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, and the touch function of the electronic device 100 is realized.
[0182] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can contain multiple sets of I2S buses. The processor 110 can be coupled to the audio module 170 through the I2S bus, and communication between the processor 110 and the audio module 170 is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface, and the function of answering a phone through a Bluetooth headset is realized.
[0183] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface, and the function of answering a phone through a Bluetooth headset is realized. Both the I2S interface and the PCM interface can be used for audio communication.
[0184] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
[0185] In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, and the Bluetooth function is realized.
[0186] In the embodiments of the present application, the UART interface can be used to communicate between the Bluetooth host and the Bluetooth controller.
[0187] In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface, and the function of playing music through a Bluetooth headset is realized.
[0188] The MIPI interface can be used to connect the processor 110 and the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the photographing function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
[0189] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal.
[0190] In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
[0191] The SIM interface can be used to communicate with the SIM card interface 195 to implement the function of transmitting data to the SIM card or reading data in the SIM card.
[0192] The USB interface 130 is an interface that meets the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices and the like.
[0193] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.
[0194] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger.
[0195] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0196] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
[0197] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network.
[0198] In some other embodiments, the antennas can be used in combination with tuning switches.
[0199] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify signals modulated by the modem processor, and convert the amplified signals into electromagnetic waves to be radiated through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110.
[0200] In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.
[0201] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A and the microphone 170B, etc.), or displays an image or a video through the display screen 194.
[0202] In some embodiments, the modem processing unit can be a separate device. In other embodiments, the modem processing unit can be separate from the processor 110 and provided in the same device as the mobile communication module 150 or other functional modules.
[0203] The wireless communication module 160 can provide solutions for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0204] In embodiments of the present application, the forwarding device communicates with the first device and the second device through the wireless communication module 160.
[0205] For example, the wireless communication module 160 in the forwarding device can provide solutions for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT); while the wireless communication module in the first device has WiFi function but does not have Bluetooth function, the wireless communication module in the second device has Bluetooth function but does not have WiFi function, then the forwarding device can establish WiFi connection with the first device, the forwarding device establishes Bluetooth connection with the second device, and then the forwarding device can realize data transmission between the first device and the second device.
[0206] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc.
[0207] The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).
[0208] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0209] The display screen 194 is used to display images, videos, etc.
[0210] The display screen 194 comprises a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like.
[0211] In some embodiments, the electronic device 100 can comprise one or N display screens 194, where N is a positive integer greater than 1.
[0212] The electronic device 100 can realize the photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor, etc.
[0213] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the algorithm of the noise and brightness of the image. The ISP can also optimize the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be arranged in the camera 193.
[0214] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
[0215] The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, or the like format image signal. In some embodiments, the electronic device 100 can comprise one or N cameras 193, where N is a positive integer greater than 1.
[0216] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0217] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0218] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition applications such as image recognition, face recognition, voice recognition, text understanding, etc.
[0219] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video, etc. Files are saved in the external memory card.
[0220] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.
[0221] The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required by a function (such as a face recognition function, a fingerprint recognition function, a mobile payment function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.).
[0222] In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0223] The electronic device 100 can implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.
[0224] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode an audio signal. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0225] The speaker 170A, also referred to as a “loudspeaker”, is configured to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0226] The receiver 170B, also referred to as a “earpiece”, is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.
[0227] The microphone 170C, also referred to as a “microphone”, “sound transducer”, is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound by holding the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, the noise reduction function can also be realized.
[0228] In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, to realize the collection of sound signals, noise reduction, and also to identify the source of the sound, to realize the directional recording function, etc.
[0229] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0230] The pressure sensor 180A is used to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A.
[0231] In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0232] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake photography.
[0233] For example, when a shutter is pressed, the gyroscope sensor 180B detects the angle of shaking of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and lets the lens offset the shaking of the electronic device 100 by reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and motion sensing game scenarios.
[0234] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude, assists positioning and navigation by the air pressure value measured by the barometric pressure sensor 180C.
[0235] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of a flip cover by using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the cover or the opening and closing state of the flip cover, the electronic device 100 can set a feature such as automatic unlocking of the flip cover.
[0236] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in each direction (typically, three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the electronic device posture, applied to the landscape / portrait screen switching, pedometer, etc.
[0237] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, the electronic device 100 can measure distance by using the distance sensor 180F to achieve fast focusing when shooting a scene.
[0238] The proximity light sensor 180G can include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode can be an infrared light-emitting diode. The electronic device 100 emits infrared light outwardly through the light-emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using the photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the screen in the case of a holster mode and a pocket mode.
[0239] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the display screen 194 brightness according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when shooting. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent false touch.
[0240] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application lock, fingerprint shooting, fingerprint answering calls, etc.
[0241] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to perform temperature processing strategies. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold value, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold value, the electronic device 100 performs voltage boosting on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0242] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch panel". The touch sensor 180K is configured to detect a touch operation applied to or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0243] The keys 190 include a power key, a volume key, and the like. The keys 190 can be mechanical keys. Alternatively, the keys 190 can be touch keys. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0244] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts and touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, and the like) can correspond to different vibration feedback effects. Touch operations applied to different regions of the display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminders, received messages, alarms, games, and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0245] The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, and the like.
[0246] The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. The same SIM card interface 195 can simultaneously insert multiple cards. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication.
[0247] In the embodiments of the present application, the electronic device 100 can execute the data transmission method through the processor 110.
[0248] Figure 11Figure 1 is a software structure block diagram of an electronic device 100 according to an embodiment of the present disclosure.
[0249] The layered architecture divides software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0250] The application layer can include a series of application packages.
[0251] As shown in Figure 11 , the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, and voice assistant.
[0252] In some embodiments, a user can communicate with other devices through Bluetooth, for example, the user uses a first device to send first data to a second device, wherein the first device and the second device are located in different networks; accordingly, when the first device receives a user operation of the user on the Bluetooth application, the first device sends a Bluetooth message to a forwarding device, the Bluetooth message including the first data and first indication information; the first indication information is used to indicate that the receiving device is the second device, then the forwarding device can process the first message through the first Bluetooth protocol stack in the kernel state to obtain the first data and the first indication information; since the forwarding device and the second device communicate through the first network, the forwarding device can process the first data and the first indication information through the first protocol stack corresponding to the first network to obtain a second message; and the second message is sent to the second device.
[0253] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0254] As shown in Figure 11 , the application framework layer can include a display manager, a sensor manager, a cross-device connection manager, an event manager, an activity manager, a window manager, a content provider, a view system, a resource manager, and a notification manager.
[0255] The display manager is used for display management of the system, and is responsible for management of all display-related transactions, including creation, destruction, direction switching, size and state changes, etc. Generally, there will only be one default display module on a single device, i.e., the main display module.
[0256] The sensor manager is responsible for the state management of sensors, and manages the application to which the sensor event is listened, and reports the event to the application in real time.
[0257] The cross-device connection manager is used to establish a communication connection with the terminal device 200, and transmit a voice signal to the terminal device 200 based on the communication connection.
[0258] The event manager is used for the event management service of the system, and is responsible for receiving the events uploaded by the bottom layer and distributing to each window, and completes the reception and distribution of events.
[0259] The task manager is used for the management of the task (Activity) component, including start management, life cycle management, task direction management, etc.
[0260] The window manager is used for managing the window program. The window manager can obtain the size of the display screen, judge whether there is a status bar, lock the screen, and intercept the screen. The window manager is also used for being responsible for the window display management, including the management of the window display mode, display size, display coordinate position, display level, etc.
[0261] The content provider is used to store and obtain data, and make the data accessible by the application program. The data can include video, image, audio, dialed and answered telephone, browsing history and bookmark, phone book, etc.
[0262] The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build an application program. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0263] The resource manager provides various resources for the application program, such as localized strings, icons, pictures, layout files, video files, etc.
[0264] The notification manager enables the application program to display notification information in the status bar, which can be used to convey the message of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloading, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application program running in the background, and can also be a notification in the form of a dialogue window appearing on the screen. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
[0265] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0266] The core library includes two parts: one part is a function function that needs to be called by the java language, and the other part is the core library of Android.
[0267] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.
[0268] The system library (also referred to as a data management layer) can include multiple functional modules. For example: a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL), and event data.
[0269] The surface manager is used to manage the display subsystem, and provides fusion of 2D and 3D layers for multiple applications.
[0270] The media library supports playback and recording of multiple commonly used audio, video formats, and static image files. The media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like.
[0271] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing.
[0272] The 2D graphics engine is a drawing engine for 2D drawing.
[0273] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0274] The embodiment of the application further provides an electronic device, which includes one or more processors and one or more memories; wherein the one or more memories are coupled with the one or more processors, and the one or more memories are used to store computer program codes, the computer program codes including computer instructions, when the one or more processors execute the computer instructions, causing the electronic device to perform the method described in the above embodiment.
[0275] The embodiment of the application further provides a computer program product including instructions, when the computer program product runs on the electronic device, causing the electronic device to perform the method described in the above embodiment.
[0276] The embodiment of the application further provides a computer readable storage medium, including instructions, when the instructions run on the electronic device, causing the electronic device to perform the method described in the above embodiment.
[0277] It can be understood that the embodiments of the present application can be combined in any manner to achieve different technical effects.
[0278] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk) and the like.
[0279] Those of ordinary skill in the art can understand that all or part of the processes in the above embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The storage medium mentioned above includes ROM or random access memory (RAM), magnetic disk or optical disk, and various media that can store program codes.
[0280] In summary, the above only describes the embodiments of the technical solutions of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present application shall be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: The method is applied to a forwarding device, wherein a first device communicates with the forwarding device via a first network, and the forwarding device communicates with a second device via Bluetooth, and the method includes: The forwarding device receives a first message sent by the first device, where the first message includes first data and first indication information; the first indication information is used to indicate that the receiving device is the second device; The forwarding device parses the first message through a first protocol stack corresponding to the first network to obtain the first data and the first indication information; The forwarding device processes the first data and the first indication information through a first Bluetooth protocol stack in kernel state to obtain a second message; The forwarding device sends the second message to the second device based on a window allocation rule; the window allocation rule is used to manage the sending order of messages from the second Bluetooth protocol stack in user mode and messages from the first Bluetooth protocol stack.
2. The method according to claim 1, characterized in that The window allocation rule includes giving priority to sending messages from the first Bluetooth protocol stack, giving priority to sending messages from the second Bluetooth protocol stack, and sending messages from the first Bluetooth protocol stack and messages from the second Bluetooth protocol stack in proportion.
3. The method according to claim 1 or 2, characterized in that The forwarding device sending the second message to the second device based on the window allocation rule includes: The forwarding device obtains the busy / idle status of the window of the Bluetooth controller; When an idle window exists in the Bluetooth controller, the forwarding device sends the second message through the idle window.
4. The method according to claim 1, wherein The method further comprises: The forwarding device receives a third message sent by the second device, where the third message includes second data and second indication information; the second indication information is used to indicate that the receiving device is the first device; When determining that the third message indicates forwarding, the forwarding device parses the third message through the first Bluetooth protocol stack to obtain the second data; The forwarding device processes the second data and the second indication information through the first protocol stack to obtain a fourth message; The forwarding device sends the fourth message to the first device based on the second indication information.
5. The method according to claim 1, wherein The method further comprises: The forwarding device generates a Bluetooth message through the second Bluetooth protocol stack in response to a user operation; The forwarding device sends the Bluetooth message to the third device based on the window allocation rule, and the third device communicates with the forwarding device via Bluetooth.
6. The method according to claim 4, characterized in that The method further comprises: The forwarding device receives a fifth message sent by the second device, where the fifth message includes third data and third indication information; the third indication information is used to indicate that the receiving device is the forwarding device; The forwarding device parses the third message based on the first Bluetooth protocol stack to obtain fourth data and the third indication information; The forwarding device parses the fourth data through the second Bluetooth protocol stack based on the second indication information to obtain the third data.
7. A data transmission device, characterized in that: The apparatus communicates with a first device via a first network, and communicates with a second device via Bluetooth, and the apparatus includes: a network receiving unit, configured to receive a first message sent by the first device, where the first message includes first data and first indication information; the first indication information is used to indicate that the receiving device is the second device; a first protocol stack corresponding to the first network, configured to parse the first message to obtain the first data and the first indication information; a first Bluetooth protocol stack in kernel state, configured to process the first data and the first indication information to obtain a second message; A window allocation unit is used to send the second message to the second device based on a window allocation rule; the window allocation rule is used to manage the sending order of messages from the second Bluetooth protocol stack in user mode and messages from the first Bluetooth protocol stack.
8. The device according to claim 7, characterized in that The window allocation rule includes giving priority to sending messages from the first Bluetooth protocol stack, giving priority to sending messages from the second Bluetooth protocol stack, and sending messages from the first Bluetooth protocol stack and messages from the second Bluetooth protocol stack in proportion.
9. The device according to claim 7 or 8, characterized in that The window allocation unit is used to obtain the busy and idle status of the window of the Bluetooth controller; When an idle window exists in the Bluetooth controller, the second message is sent through the idle window.
10. The device according to claim 7, characterized in that The device also includes a Bluetooth receiving unit and a network sending unit: The Bluetooth receiving unit is configured to receive a third message sent by the second device, where the third message includes second data and second indication information; the second indication information is used to indicate that the receiving device is the first device; The first Bluetooth protocol stack is configured to parse the third message to obtain the second data when determining that the third message indicates forwarding; The first protocol stack is used to process the second data and the second indication information to obtain a fourth message; The network sending unit is configured to send the fourth message to the first device based on the second indication information.
11. The device according to claim 7, characterized in that The second Bluetooth protocol stack is configured to generate a Bluetooth message in response to a user operation; The window allocation unit is configured to send the Bluetooth message to a third device based on the window allocation rule, and the third device communicates with the forwarding device via Bluetooth.
12. The device according to claim 10, characterized in that The device also includes a Bluetooth receiving unit; The Bluetooth receiving unit is configured to receive a fifth message sent by the second device, wherein the fifth message includes third data and third indication information; the third indication information is used to indicate that the receiving device is a forwarding device; The first Bluetooth protocol stack is configured to parse the third message to obtain fourth data and the third indication information; The second Bluetooth protocol stack is used to parse the fourth data to obtain the third data.
13. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-6.
14. A computer program product comprising instructions, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 6.
15. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Bluetooth router, networking system and communication method
CN112788535A
Bluetooth reconnection method and terminal equipment
CN114173315A