Data transmission method and device

CN119654611APending Publication Date: 2025-03-18HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380057191.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-08-04
Filing Date
2023-04-19
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the existing technology, the data transmission efficiency between the terminal device and the auxiliary device is low, resulting in increased costs and poor user experience. In addition, the device performance requirements are high and the inheritance is poor.

Method used

By establishing multiple transmission channels between terminal equipment and auxiliary equipment, including hardware channels and wireless channels, selecting appropriate channels according to data transmission requirements, realizing multiple transmissions of data to improve accuracy and reduce bit errors, and through system-level Chips replace microcontroller units to reduce costs.

Benefits of technology

It improves the efficiency and accuracy of data transmission between terminal equipment and auxiliary equipment, reduces equipment costs and performance requirements, and improves user experience and method inheritance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119654611A_ABST
    Figure CN119654611A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and device.The data transmission method is applied to terminal equipment, the terminal equipment is connected with auxiliary equipment through a first interface, a second interface and a third interface, and the method comprises the steps that after the terminal equipment detects that the auxiliary equipment is connected, the auxiliary equipment is connected; the terminal equipment supplies power to the auxiliary equipment through the first interface and the second interface; the terminal equipment establishes a first transmission channel between the receiving pin of the terminal equipment and the sending pin of the auxiliary equipment through the third interface, and the first transmission channel is a hardware channel from the auxiliary equipment to the terminal equipment; the terminal equipment receives first data sent by the auxiliary equipment through the first transmission channel; and the terminal equipment sends second data to the auxiliary equipment through a second transmission channel, wherein the second transmission channel is different from the first transmission channel.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method and device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on August 4, 2022, with application number 202210934446.6 and invention name “Data transmission method and device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a data transmission method and device. Background Art

[0003] The auxiliary device of the terminal device can establish a communication connection with the terminal device and provide some auxiliary functions for the terminal device through the auxiliary device. For example, the keyboard can be used as an external keyboard for a tablet computer (PAD). However, the data transmission between the auxiliary device and the terminal device needs to be improved.

[0004] Summary of the Invention

[0005] This application provides a data transmission method and apparatus, the purpose of which is to improve data transmission between auxiliary equipment and terminal equipment, reduce the cost of terminal equipment, and improve the inheritance of the method. To achieve the above objectives, this application provides the following technical solutions:

[0006] In the first aspect, the present application provides a data transmission method, which is applied to a terminal device, wherein the terminal device is connected to an auxiliary device through a first interface, a second interface and a third interface, and the method includes: after the terminal device detects that the auxiliary device is connected, the terminal device supplies power to the auxiliary device through the first interface and the second interface; the terminal device establishes a first transmission channel between a receiving pin of the terminal device and a sending pin of the auxiliary device through the third interface, and the first transmission channel is a hardware channel from the auxiliary device to the terminal device; the terminal device receives first data sent by the auxiliary device through the first transmission channel; the terminal device sends second data to the auxiliary device through the second transmission channel, and the second transmission channel is different from the first transmission channel.

[0007] In this embodiment, after the terminal device is connected to the auxiliary device via the first interface, the second interface, and the third interface, the terminal device can establish a first transmission channel between a receive pin of the terminal device and a transmit pin of the auxiliary device via the third interface. The first transmission channel is a hardware channel formed through pins in the terminal device and the auxiliary device and the third interface. Thus, the terminal device can establish the first transmission channel via the general-purpose input / output port of the system-on-chip (SoC). This allows the terminal device to replace the microcontroller unit (MCU) with the SoC, reducing the cost of the terminal device by, for example, approximately $2. The terminal device and the auxiliary device no longer need to switch between transmit and receive pins depending on their operating status, eliminating the need for status polling and state switching, reducing performance requirements for the terminal device and the auxiliary device, and thus improving the inheritability of the method.

[0008] In some examples, the terminal device may be a tablet computer, the auxiliary device may be a keyboard, the first interface, the second interface, and the third interface may be of the same interface type, and the first interface, the second interface, and the third interface may be POGO pin interfaces. The first interface, the second interface, and the third interface are provided on the tablet computer. As shown in FIG1 , three POGO pin interfaces are provided on the keyboard, and three POGO pin interfaces are also provided at corresponding positions on the tablet computer. These three interfaces are the first interface, the second interface, and the third interface. The keyboard may send at least one of key data and touch data to the tablet computer via a first transmission channel, and the tablet computer may send at least one of firmware upgrade data, key confirmation data (ACK), and touch ACK to the keyboard via a second transmission channel. In this example, the transmission rate of the first transmission channel is greater than the transmission rate of the second transmission channel, so that the key data and touch data can be sent to the tablet computer in a timely manner, thereby improving the user experience.

[0009] In one possible implementation, the terminal device sending the second data to the auxiliary device via the second transmission channel includes: the terminal device sending the second data to the auxiliary device via a short-range wireless transmission channel. In this embodiment, the first data is transmitted via a hardware channel serving as the first transmission channel, and the second data is transmitted via a short-range wireless transmission channel. Different types of data are transmitted via different transmission channels, thereby achieving simplex transmission of the first data from the auxiliary device to the terminal device and simplex transmission of the second data from the terminal device to the auxiliary device. Wherein the data transmission requirements for the first data are higher than those for the second data, e.g., the first data requires a lower latency, while the second data requires a higher latency. Using the hardware channel allows the first data to be sent to the terminal device in a timely manner, and the terminal device to respond to the first data in a timely manner, thereby improving the user experience. In other words, the data transmission requirements for the first and second data are different. The terminal device and the auxiliary device can pre-negotiate, based on the data transmission requirements of the first and second data, to determine that the first data will be transmitted via the first transmission channel and the second data will be transmitted via the second transmission channel, thereby satisfying the data transmission requirements of the first and second data.

[0010] In one possible implementation, the terminal device receiving first data sent by the auxiliary device via a first transmission channel includes: the terminal device receiving the first data sent by the auxiliary device via the first transmission channel N times, the terminal device responding to the first data once, where N is a natural number greater than 1; and the terminal device sending second data to the auxiliary device via a second transmission channel includes: the terminal device sending reception confirmation data of the first data once to the auxiliary device via a short-range wireless transmission channel, where the reception confirmation data is the second data. Bit errors are minimized or eliminated by sending the same first data multiple times, and error correction is achieved by sending the same first data multiple times. Although the terminal device receives the same first data multiple times, the terminal device responds to the first data once and feeds back a single reception confirmation data to the auxiliary device, thereby improving the accuracy of the first data while not changing the terminal device's response to the first data.

[0011] For example, if the terminal device is a tablet and the auxiliary device is a keyboard, the user can perform a key press or touch once, and the keyboard can send the same key data or touch data to the tablet multiple times without the user noticing. This improves the accuracy of the key data or touch data received by the tablet, thereby improving the accuracy of the tablet's response and enhancing the user experience. For example, the keyboard can send the same key data or touch data to the tablet three or two times via the first transmission channel, with the number of transmissions limited by the pin transmission capabilities of the keyboard and tablet.

[0012] In one possible implementation, the short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel, so that the terminal device can send the second data to the auxiliary device through Bluetooth technology or Zifeng technology. Specifically, the terminal device can send the second data to the auxiliary device through the Bluetooth communication module or the Zifeng communication module. The power consumption of the Bluetooth communication module and the Zifeng communication module is low, and power consumption can be reduced while ensuring the transmission of the second data.

[0013] In one possible implementation, the method further includes: the terminal device establishing a second transmission channel between a transmit pin of the terminal device and a receive pin of the auxiliary device via a fourth interface, the second transmission channel being a hardware channel from the terminal device to the auxiliary device; the terminal device receiving first data sent by the auxiliary device via the first transmission channel comprising: the terminal device receiving the first data sent by the auxiliary device via the first transmission channel M times, and the terminal device receiving the first data sent by the auxiliary device via the short-range wireless transmission channel T times, the terminal device being configured to respond to the first data once, where M is a natural number greater than 1 and T is a natural number greater than or equal to 1; the terminal device sending second data to the auxiliary device via the second transmission channel comprising: the terminal device sending a receipt confirmation of the first data once to the auxiliary device via the second transmission channel, the receipt confirmation data being the second data. The first data can be transmitted simultaneously via the first transmission channel and the short-range wireless transmission channel, thereby reducing transmission time while eliminating bit errors and preventing malfunctions.

[0014] In one possible implementation, the method further includes: the terminal device detecting a level generated by a Hall sensor, the Hall sensor being disposed in the terminal device, and the distance between the Hall sensor and the first interface or the second interface being less than a preset distance; the auxiliary device being disposed with a magnet, the distance between the magnet and the first interface or the second interface being less than a preset distance, the magnet being configured to generate a magnetic force, the magnetic force being configured to control the level generated by the Hall sensor; if the level generated by the Hall sensor changes from a first level to a second level, the terminal device determining that the auxiliary device is connected, the first level being greater than the second level; and if the level generated by the Hall sensor changes from the second level to the first level, the terminal device determining that the auxiliary device is not connected. In this embodiment, the Hall sensor and the magnet are disposed at a preset distance such that the Hall sensor is disposed near the first interface or the second interface, and the Hall sensor and the magnet are used to detect whether the terminal device is connected to the auxiliary device. The value of the preset distance is not limited.

[0015] In the second aspect, the present application provides a data transmission method, which is applied to an auxiliary device, and the auxiliary device is connected to the terminal device through a fifth interface, a sixth interface and a seventh interface. The method includes: after the auxiliary device is connected to the terminal device, the auxiliary device receives the power supply voltage output by the terminal device through the fifth interface and the sixth interface; the auxiliary device establishes a first transmission channel between the receiving pin of the terminal device and the sending pin of the auxiliary device through the seventh interface, and the first transmission channel is a hardware channel from the auxiliary device to the terminal device; the auxiliary device sends first data to the terminal device through the first transmission channel; the auxiliary device receives second data sent by the terminal device through the second transmission channel, and the second transmission channel is different from the first transmission channel.

[0016] The first transmission channel is a hardware channel formed through pins in the terminal device and the auxiliary device, and the seventh interface. The terminal device can thus establish the first transmission channel using the universal input / output port of the system-on-chip (SoC), allowing the terminal device to replace the microcontroller unit with the SoC, reducing the cost of the terminal device, for example, by approximately $2. The terminal device and the auxiliary device no longer need to switch between transmit and receive pins based on their operating states, eliminating the need for state polling and state switching, reducing performance requirements for the terminal device and the auxiliary device, and thus improving the inheritability of the method. The fifth, sixth, and seventh interfaces are of the same interface type and can be POGO pin interfaces. For example, in FIG1 , the terminal device is a tablet computer, the auxiliary device is a keyboard, and the fifth, sixth, and seventh interfaces are the three POGO pin interfaces in FIG1 .

[0017] In one possible implementation, the auxiliary device receives the second data sent by the terminal device through the second transmission channel, including: the auxiliary device receives the second data sent by the terminal device through the short-range wireless transmission channel, and realizes simplex transmission of the first data from the auxiliary device to the terminal device, and simplex transmission of the second data from the terminal device to the auxiliary device.

[0018] In one possible implementation, the auxiliary device sending first data to the terminal device via a first transmission channel includes: the auxiliary device sending the first data to the terminal device via the first transmission channel N times, and the terminal device responding to the first data once, where N is a natural number greater than 1; and the auxiliary device receiving second data sent by the terminal device via a second transmission channel includes: the auxiliary device receiving, via a short-range wireless transmission channel, reception confirmation data of the first data sent by the terminal device, where the reception confirmation data is the second data, and the reception confirmation data is sent once. Bit errors are minimized or eliminated by sending the same first data multiple times, and error correction is achieved by sending the same first data multiple times. Although the terminal device receives the same first data multiple times, the terminal device responds to the first data once and feeds back a single reception confirmation data to the auxiliary device, thereby improving the accuracy of the first data while not changing the terminal device's response to the first data.

[0019] In a possible implementation, the short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel, which can reduce power consumption while ensuring the transmission of the second data.

[0020] In one possible implementation, the method further includes: the auxiliary device establishing, via an eighth interface, a second transmission channel between a transmit pin of the terminal device and a receive pin of the auxiliary device, the second transmission channel being a hardware channel from the terminal device to the auxiliary device; the auxiliary device sending first data to the terminal device via the first transmission channel comprising: the auxiliary device sending the first data to the terminal device M times via the first transmission channel, and the auxiliary device sending the first data to the auxiliary device T times via the short-range wireless transmission channel, the terminal device responding to the first data once, where M is a natural number greater than 1 and T is a natural number greater than or equal to 1; and the auxiliary device receiving second data sent by the terminal device via the second transmission channel comprising: the auxiliary device receiving, via the second transmission channel, receipt confirmation data of the first data sent by the terminal device, the receipt confirmation data being the second data. The first data can be transmitted simultaneously via the first transmission channel and the short-range wireless transmission channel, thereby reducing transmission time while eliminating bit errors and preventing malfunctions.

[0021] In a third aspect, the present application provides a terminal device, which has a first interface, a second interface, and a third interface, and the terminal device is connected to an auxiliary device through the first interface, the second interface, and the third interface; the terminal device includes a memory and a processor, the memory is used to store instructions executable by the processor, and the processor executes the instructions so that the terminal device executes the data transmission method of the first aspect.

[0022] In a fourth aspect, the present application provides an auxiliary device, which has a fifth interface, a sixth interface and a seventh interface, and the auxiliary device is connected to the terminal device through the fifth interface, the sixth interface and the seventh interface; the auxiliary device includes a memory and a processor, the memory is used to store instructions executable by the processor, and the processor executes the instructions so that the auxiliary device executes the data transmission method of the second aspect.

[0023] In a fifth aspect, the present application provides a data transmission system, which includes a terminal device and an auxiliary device, the terminal device having a first interface, a second interface, and a third interface, and the auxiliary device having a fifth interface, a sixth interface, and a seventh interface; the first interface is used to connect to the fifth interface, the second interface is used to connect to the sixth interface, and the third interface is used to connect to the seventh interface; the terminal device includes a first memory and a first processor, the first memory is used to store instructions executable by the first processor, and the first processor executes the instructions so that the terminal device executes the data transmission method of the first aspect; the auxiliary device includes a second memory and a second processor, the second memory is used to store instructions executable by the second processor, and the second processor executes the instructions so that the auxiliary device executes the data transmission method of the second aspect.

[0024] The first, second, and third interfaces are of the same interface type, and the fifth, sixth, and seventh interfaces are of the same interface type. In one possible implementation, the first, second, third, fifth, sixth, and seventh interfaces are POGO pin interfaces; the terminal device is a tablet computer, and the auxiliary device is a keyboard. As shown in the dashed lines in FIG5 below, VCC corresponds to the first and fifth interfaces, GND corresponds to the second and sixth interfaces, and DATA corresponds to the third and seventh interfaces. The power supply voltage is input to the fifth and sixth interfaces through the first and second interfaces, and then power is supplied through the fifth and sixth interfaces. A first transmission channel is formed between the receiving pin of the terminal device and the transmitting pin of the auxiliary device through the third and seventh interfaces.

[0025] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor executes the above-mentioned data transmission method.

[0026] In the seventh aspect, the present application provides a data transmission device, which is applied to a terminal device, and the terminal device is connected to an auxiliary device through a first interface, a second interface and a third interface. The device includes: a detection module, a power supply module, a channel establishment module and a transceiver module; the detection module is used to detect that the terminal device is connected to the auxiliary device, and trigger the power supply module to supply power to the auxiliary device through the first interface and the second interface; the channel establishment module is used to establish a first transmission channel between the receiving pin of the terminal device and the sending pin of the auxiliary device through the third interface, and the first transmission channel is a hardware channel from the auxiliary device to the terminal device; the transceiver module is used to receive first data sent by the auxiliary device through the first transmission channel, and send second data to the auxiliary device through the second transmission channel, and the second transmission channel is different from the first transmission channel.

[0027] In a possible implementation, the transceiver module is configured to send the second data to the auxiliary device through a short-range wireless transmission channel.

[0028] In one possible implementation, the transceiver module is used to receive the first data sent by the auxiliary device through the first transmission channel N times, and the terminal device is used to respond to the first data once, where N is a natural number greater than 1; the transceiver module is used to send reception confirmation data of the first data to the auxiliary device once through the short-range wireless transmission channel, and the reception confirmation data is the second data.

[0029] In a possible implementation, the short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel.

[0030] In one possible implementation, the channel establishment module is also used to establish a second transmission channel between the sending pin of the terminal device and the receiving pin of the auxiliary device through the fourth interface of the terminal device, and the second transmission channel is a hardware channel from the terminal device to the auxiliary device; the transceiver module is used to receive the first data sent by the auxiliary device through the first transmission channel M times, and to receive the first data sent by the auxiliary device through the short-range wireless transmission channel T times, and the terminal device is used to respond to the first data once, M is a natural number greater than 1, and T is a natural number greater than or equal to 1; the transceiver module is used to send reception confirmation data of the first data to the auxiliary device once through the second transmission channel, and the reception confirmation data is the second data.

[0031] In one possible implementation, a detection module is used to detect the level generated by a Hall sensor, the Hall sensor is set in a terminal device, and the distance between the Hall sensor and the first interface or the second interface is less than a preset distance, a magnet is set in the auxiliary device, and the distance between the magnet and the first interface or the second interface is less than the preset distance, the magnet is used to generate magnetic force, and the magnetic force is used to control the level generated by the Hall sensor; if the level generated by the Hall sensor changes from a first level to a second level, it is determined that the auxiliary device is connected, and the first level is greater than the second level; if the level generated by the Hall sensor changes from the second level to the first level, it is determined that the auxiliary device is not connected.

[0032] In an eighth aspect, the present application provides a data transmission device, which is applied to an auxiliary device, and the auxiliary device is connected to the terminal device through a fifth interface, a sixth interface and a seventh interface. The device includes: a power supply module, an establishment module and a data transceiver module. The power supply module is used to receive the power supply voltage output by the terminal device through the fifth interface and the sixth interface after the auxiliary device is connected to the terminal device; the establishment module is used to establish a first transmission channel between the receiving pin of the terminal device and the transmitting pin of the auxiliary device through the seventh interface, and the first transmission channel is a hardware channel from the auxiliary device to the terminal device; the data transceiver module is used to send first data to the terminal device through the first transmission channel, and receive second data sent by the terminal device through the second transmission channel, and the second transmission channel is different from the first transmission channel.

[0033] In a possible implementation, the data transceiver module is configured to receive second data sent by the terminal device through a short-range wireless transmission channel.

[0034] In one possible implementation, the data transceiver module is used to send first data N times to the terminal device through a first transmission channel, and the terminal device is used to respond to the first data once, where N is a natural number greater than 1, and is used to receive reception confirmation data of the first data sent by the terminal device through a short-range wireless transmission channel, where the reception confirmation data is second data, and the reception confirmation data is sent once.

[0035] In a possible implementation, the short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel.

[0036] In one possible implementation, the establishment module is also used to establish a second transmission channel between the sending pin of the terminal device and the receiving pin of the auxiliary device through the eighth interface of the auxiliary device, and the second transmission channel is a hardware channel from the terminal device to the auxiliary device; the data transceiver module is used to send the first data M times to the terminal device through the first transmission channel, and the auxiliary device sends the first data T times to the auxiliary device through the short-range wireless transmission channel, and the terminal device is used to respond to the first data once, M is a natural number greater than 1, and T is a natural number greater than or equal to 1; the data transceiver module is used to receive reception confirmation data of the first data sent by the terminal device through the second transmission channel, and the reception confirmation data is the second data.

[0037] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical methods of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments.

[0039] FIG1 is a schematic diagram showing the connection between the terminal device and the auxiliary device provided by the present application;

[0040] FIG2 is a schematic diagram of communication between a terminal device and an auxiliary device provided by the present application;

[0041] FIG3 is a schematic diagram of the hardware architecture of a terminal device provided in this application;

[0042] FIG4 is a schematic diagram of the hardware architecture of the auxiliary device provided in this application;

[0043] FIG5 is another schematic diagram of communication between a terminal device and an auxiliary device provided by the present application;

[0044] FIG6 is another schematic diagram of communication between a terminal device and an auxiliary device provided in this application. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0046] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0047] The "multiple" involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first" and "second" are only used for the purpose of distinguishing the description and cannot be understood as indicating or implying relative importance or order.

[0048] The auxiliary device of the terminal device can provide auxiliary functions for the terminal device, such as the keyboard can be used as an external keyboard of the PAD to provide input function for the PAD. Figure 1 shows a connection diagram of the PAD and the keyboard, where PAD1 is the terminal device and the keyboard 2 is the auxiliary device of PAD1. (1) in Figure 1 shows that the keyboard 2 is connected to the PAD1, and (2) in Figure 1 shows that the keyboard 2 is separated from the PAD1, such as when the user removes the keyboard 2 from the PAD1. A POGO pin interface (also called POGO pin pin) 20 is provided on the keyboard 2, as shown in (2) in Figure 1. A POGO pin interface (not shown in Figure 1) is also provided on the PAD1. The PAD1 and the keyboard 2 can be connected through three POGO pin interfaces, two of which are used to supply power to the keyboard, and one interface is used for communication between the PAD and the keyboard. The keyboard in Figure 1 can also include a touch area, which is not shown in Figure 1.

[0049] When PAD1 and keyboard 2 are connected via an interface, the PAD and keyboard can communicate via a single-line POGO pin interface (which may be referred to as POGO pin data transmission). In some examples, after the keyboard is connected to the PAD, the Universal Asynchronous Receiver / Transmitter (UART) pins between the PAD and the keyboard are connected via the POGO pin interface, allowing data to be transmitted between the PAD and the keyboard via the UART pins and the POGO pin interface. As shown in Figure 2, the UART TX (transmit) pin, UART RX pin, and ADC pin of the PAD reuse the first connection line, and the UART TX (transmit) pin and UART RX pin of the keyboard reuse the second connection line. After the POGO pin interface of the PAD and the keyboard is connected, the first connecting line and the second connecting line are connected, the TX pin of the PAD and the RX pin of the keyboard are connected through the first connecting line and the second connecting line, and the RX pin of the PAD and the TX pin of the keyboard are connected through the first connecting line and the second connecting line. A wired transmission channel is formed through the UART pin, the first connecting line, the second connecting line and the POGO pin interface. The PAD and the keyboard can communicate single-line through the wired transmission channel. In Figure 2, the VCC pin of the PAD is connected to the ground pin of the keyboard through the first connecting line and the second connecting line.

[0050] When the PAD is connected to the keyboard, the resistor R2 connected between the VCC pin and the ground pin divides the voltage, making the voltage of the resistor R1 less than the voltage connected to the VCC pin (VCC); when the PAD is disconnected from the keyboard (the keyboard is detached from the PAD), the VCC pin of the PAD is left floating, and the voltage of the resistor R1 is equal to VCC. The ADC can obtain the voltage of the resistor R1 connected to the VCC pin. The ADC pin sends the voltage of the resistor R1 to the microcontroller unit (MCU) of the PAD. The MUC detects whether the keyboard is connected to the PAD through the voltage of the resistor R1.

[0051] The PAD's MCU and the keyboard's MCU control their respective operating states. By default, the PAD and keyboard are in the receiving state. If data is sent, they switch from the receiving state to the transmitting state. Data sent by the keyboard to the PAD includes keystroke data and touch data, while data sent by the PAD to the keyboard includes firmware upgrade data, key acknowledgement data (ACK), and touch acknowledgement data (ACK). The single-wire communication process can be as follows: If the keyboard's MCU detects a user tapping a key or touching the keyboard, the keyboard's MCU controls the keyboard to the transmitting state, sending the keystroke data or touch data via the keyboard's TX pin to the PAD's RX pin. After the data transmission is complete, the keyboard's MCU controls the keyboard to the receiving state. When the keyboard sends data to the PAD, the PAD is in the receiving state. When the PAD sends upgrade data, a key acknowledgement data (ACK), or a touch acknowledgement data (ACK) to the keyboard, it switches from the receiving state to the transmitting state, sending data via the PAD's TX pin to the keyboard's RX pin. For example, after the PAD completes its response based on the keystroke data, it sends a key acknowledgement data (ACK) via the PAD's TX pin to the keyboard's RX pin.

[0052] When using a single-wire communication line between a PAD and keyboard, there are problems: Incorporating an MCU into the PAD increases costs. Furthermore, the PAD and keyboard switch between receiving and transmitting states. When the PAD is receiving, the PAD uses the RX pin, and the keyboard uses the TX pin. When the PAD is transmitting, the PAD uses the TX pin, and the keyboard uses the RX pin. This means that during single-wire communication, the PAD and keyboard can switch between using the TX and RX pins depending on the operating state. This increases performance requirements for the PAD and keyboard, while reducing the inherent complexity of single-wire communication.

[0053] In addition to communicating as shown in FIG2 , the PAD and the keyboard can also communicate wirelessly, such as using short-range wireless communication to transmit data between the PAD and the keyboard. In some examples, data can be transmitted between the PAD and the keyboard via Bluetooth. When transmitting data via wireless communication, the PAD can reduce costs. For example, the PAD can be equipped with a processor that costs less than the MCU. For example, the PAD uses a system-on-chip (SOC) instead of the MCU to reduce the cost of the PAD. When the PAD and the keyboard use wireless communication, there is a certain delay in the wireless communication. The delay requirements for key data and touch data are relatively high. After obtaining the key data or touch data, the keyboard requires sending it to the PAD as soon as possible. Therefore, it is difficult to meet the high delay requirements of these data by transmitting key data or touch data via wireless communication, which reduces the user experience.

[0054] The present application provides a data transmission method, which can comprehensively consider the advantages and disadvantages of single-line communication and wireless communication (such as Bluetooth) using a POGO pin interface, and set at least one wired transmission channel between a terminal device and an auxiliary device of the terminal device, and the terminal device supports wireless communication with the auxiliary device. The terminal device and the auxiliary device can choose to transmit through a wired transmission channel or through wireless communication according to the data transmission requirements to meet the data transmission requirements of the terminal device and the auxiliary device and improve the user experience.

[0055] A wired transmission channel can be formed by the pins of the terminal device, the pins of the auxiliary device, the connecting wires of the pins, and the interface used when connecting the terminal device and the auxiliary device. It is a hardware circuit (also called a hardware channel, similar to the wiring on a printed circuit board) formed by the pins and connecting wires in the terminal device and the auxiliary device. The terminal device can thus use the general purpose input / output (GPIO) of the SOC to build a wired transmission channel, allowing the terminal device to replace the MCU with the SOC, reducing the cost of the terminal device, such as reducing the cost by approximately US$2. The terminal device and the auxiliary device no longer need to switch the use of the TX pin and the RX pin according to the working state, eliminating the state polling and state switching process for the terminal device and the auxiliary device, reducing the performance requirements for the terminal device and the auxiliary device, and thus improving the inheritance of the method.

[0056] In some examples, the transmission methods used by the terminal device and the auxiliary device are fixed but different, such as the terminal device transmits data to the auxiliary device through wireless communication, and the auxiliary device transmits data to the terminal device through a wired transmission channel; in some examples, the terminal device and / or the auxiliary device can adjust the transmission method according to the data transmission requirements of the current transmitted data, for example, the terminal device switches from transmitting data with low latency requirements to transmitting data with high latency requirements, then the terminal device adjusts from transmitting through wireless communication to transmitting through a wired transmission channel.

[0057] The following is an explanation of the structure of the terminal device and the auxiliary device. Figure 3 shows a schematic diagram of the hardware architecture of the terminal device, where the terminal device can be a mobile phone, a smart screen, a tablet computer, a wearable terminal device (such as a watch, a bracelet, a headset, etc.), a vehicle-mounted terminal device, an augmented reality (AR) device, a virtual reality (VR) device, a personal digital assistant (PDA), a projector, etc.

[0058] The terminal device may include: a processor, memory, peripheral interfaces, a charging management module, a power management module, a battery, antenna 1, antenna 2, a mobile communication module, a wireless communication module, a sensor module, buttons, a motor, an indicator, an audio module, a camera, a display, and a Subscriber Identification Module (SIM) card interface, etc. The audio module may include a speaker, a receiver, a microphone, and a headphone jack, etc. The sensor module may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, a gravity sensor, etc.

[0059] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the terminal device. In other embodiments, the terminal device may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0060] The processor may include one or more processing units, for example: the processor may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. For example, the processor can be an integrated control chip, such as a SOC. The processor is the nerve center and command center of the terminal device. The controller can generate operation control signals based on the instruction opcode and timing signal to complete the control of instruction fetching and execution.

[0061] The memory can be used to store computer executable program code and data, among other things. The executable program code includes instructions. The processor executes the instructions stored in the memory to perform various functional applications and data processing of the terminal device. For example, the processor executes the instructions stored in the memory to cause the terminal device to execute the data communication method provided in this application.

[0062] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0063] The mobile communication module can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to terminal devices. The wireless communication module can provide solutions for wireless communications including Wireless Local Area Networks (WLAN (such as wireless fidelity (Wi-Fi) network)), Bluetooth (BlueTooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), ZigBee technology, etc. applied to terminal devices. In some embodiments, the antenna 1 of the terminal device is coupled to the mobile communication module, and the antenna 2 is coupled to the wireless communication module, so that the terminal device can communicate with the network and other devices through wireless communication technology.

[0064] The peripheral interface is used to connect auxiliary devices of the external terminal device. Auxiliary devices can also be called expansion devices. For example, external devices include: Universal Serial Bus (USB) interface, POGO pin interface, etc. An external keyboard, etc. can be connected through the USB interface or POGO pin interface.

[0065] Please refer to Figure 4, which is a schematic diagram of the hardware architecture of an auxiliary device provided in this application. The auxiliary device may include a processor, a memory, a charging interface, a charging management module, a battery, a wireless communication module and an auxiliary function module. The auxiliary function module is used to assist the terminal device and provide some functions to the terminal device, such as providing input functions, etc. For example, the auxiliary device shown in Figure 4, the auxiliary function module includes a touchpad and a keyboard, etc., and the auxiliary device can be used as an external keyboard for the terminal device. The structure illustrated in this embodiment does not constitute a specific limitation on the auxiliary device. In other embodiments, the auxiliary device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0066] The memory may store a Bluetooth address used to uniquely identify the auxiliary device. The memory may also store connection data for a terminal device that has previously successfully paired with the auxiliary device. For example, the connection data for the terminal device may be the Bluetooth address of the terminal device. Based on this connection data, the auxiliary device can automatically pair with the terminal device without having to configure the connection between them, such as performing legitimacy verification. The Bluetooth address may be a Media Access Control (MAC) address.

[0067] The memory can also be used to store program code, and the processor can execute the above application code and call related modules to implement the functions of the auxiliary device in this application. For example, realize charging function, wireless communication function, etc. The processor may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors. The processor may specifically be an integrated control chip, or it may be composed of a circuit including various active and / or passive components, and the circuit is configured to perform the functions belonging to the processor described in this embodiment. In some examples, the processor of the auxiliary device may be a microprocessor.

[0068] The wireless communication module can be used to support data exchange between the auxiliary device and the terminal device, including wireless local area networks (WLAN (such as wireless fidelity (Wi-Fi) network)), Bluetooth (BlueTooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), infrared technology (IR), ZigBee technology, and other wireless communications. In some embodiments, the wireless communication module can be at least one of a Bluetooth communication module and a ZigBee communication module, specifically a Bluetooth chip or a ZigBee chip. The auxiliary device can pair with the Bluetooth chip of the terminal device through the Bluetooth chip and establish a wireless connection to achieve wireless communication between the auxiliary device and the terminal device through the wireless connection.

[0069] In some embodiments, the auxiliary device may support wired charging. Specifically, the charging management module may receive charging input from a wired charger via a charging interface. While charging the battery, the charging management module may also power the auxiliary device. The charging interface may be used to provide a wired connection for charging or communication with the auxiliary device.

[0070] The touch panel can be integrated with a touch sensor. The auxiliary device can be connected to the terminal device via a USB interface or a POGO pin interface. After the connection, the terminal device can receive user control commands and input operations on the terminal device through the touch panel and keyboard.

[0071] After the terminal device is connected to the auxiliary device through a peripheral interface (such as a USB interface or a POGO pin interface), a wired transmission channel is formed between the terminal device and the auxiliary device. The wired transmission channel can be connected between the pins of the terminal device and the auxiliary device. For example, the wired transmission channel is connected between the RX pin of the terminal device and the TX pin of the auxiliary device. For another example, the wired transmission channel is connected between the TX pin of the terminal device and the RX pin of the auxiliary device. The terminal device and the auxiliary device can achieve simplex communication through the wired transmission channel. That is, when the terminal device and the auxiliary device transmit data, one of the terminal device and the auxiliary device sends data to the other through the wired transmission channel.

[0072] The terminal device and the auxiliary device can also be connected through a wireless communication module, which forms a wireless transmission channel (also called a wireless communication channel, etc.) between the terminal device and the auxiliary device. The terminal device and the auxiliary device can exchange data through the wireless transmission channel.

[0073] In this embodiment, the terminal device and the auxiliary device have different data transmission requirements. Based on their respective data transmission requirements, the terminal device and the auxiliary device can determine a transmission channel from a wired transmission channel and a wireless transmission channel, and use the determined transmission channel to send / transmit data to each other. The terminal device and the auxiliary device each use a different transmission channel. For example, the terminal device transmits via a wireless transmission channel, while the auxiliary device transmits via a wired transmission channel. Typically, after the terminal device and the auxiliary device determine the transmission channel, the transmission channel used by the terminal device and the auxiliary device can be fixed.

[0074] For example, the terminal device and the auxiliary device require different delays. The terminal device requires a higher delay, while the auxiliary device requires a lower delay. If the transmission rate of the wired transmission channel is greater than the transmission rate of the wireless transmission channel, then when the terminal device and the auxiliary device are connected, the RX pin of the terminal device can be connected to the TX pin of the auxiliary device. The transmission direction of the wired transmission channel is from the TX pin of the auxiliary device to the RX pin of the terminal device. The auxiliary device can send data to the terminal device through the wired transmission channel. Because the TX pin of the terminal device is not connected to the wired transmission channel, there is no wired transmission channel between the TX pin of the terminal device and the RX pin of the auxiliary device. The terminal device cannot send data to the auxiliary device through the wired transmission channel, so the terminal device can send data to the auxiliary device through the wireless transmission channel. The terminal device and the auxiliary device can also determine the transmission channel based on the bit error rate, reliability, etc., which will not be repeated here.

[0075] For example, the terminal device and the auxiliary device have different security requirements. The terminal device has a lower security requirement, while the auxiliary device has a higher security requirement. In this case, the transmission direction of the wired transmission channel is from the TX pin of the auxiliary device to the RX pin of the terminal device. The auxiliary device can send data to the terminal device through the wired transmission channel; the terminal device can send data to the auxiliary device through the wireless transmission channel, such as the terminal device can send data to the auxiliary device through Bluetooth or Zifeng.

[0076] Take the terminal device as PAD and the auxiliary device as keyboard for explanation. The data sent by the keyboard to the PAD includes key data and touch data, etc., and the data sent by the PAD to the keyboard includes firmware upgrade data, key confirmation data (ACK) and touch ACK, etc. When the user inputs data to the PAD through the keyboard and sends some control commands to the PAD through the keyboard, the keyboard sends key data or touch data to the PAD, requiring the key data or touch data to be sent to the PAD as soon as possible so that the PAD can respond in time. Therefore, the key data and touch data have higher requirements for latency, and the firmware upgrade data, key ACK and touch ACK have lower requirements for latency. Therefore, in the data transmission method provided in this application, the keyboard can realize simplex transmission from the keyboard to the PAD through a wired transmission channel, and the PAD can realize simplex transmission from the PAD to the keyboard through a wireless transmission channel, which meets the low-latency transmission requirements required by the keyboard and improves the user experience. In this example, the wired transmission channel is recorded as the first transmission channel, and the wireless transmission channel is recorded as the second transmission channel.

[0077] The keyboard can send the same key data or touch data multiple times to the PAD through a wired transmission channel. By sending the same key data or touch data multiple times, the error can be minimized or eliminated, and error correction can be achieved through multiple transmissions. Although the PAD receives the same key data or touch data multiple times, the PAD responds once and feeds back an ACK to the keyboard. For the user, when the user performs a key press or touch, the keyboard can send the same key data or touch data to the PAD multiple times for the user's key press or touch without the user feeling it, thereby improving the accuracy of the key data or touch data received by the PAD, thereby improving the accuracy of the PAD response and improving the user experience. For example, the keyboard can send the same key data or touch data three or two times to the PAD through a wired transmission channel. The number of transmissions is limited by the pin transmission capabilities of the keyboard and PAD, which is not limited in this embodiment.

[0078] After the PAD responds to the key data or touch data, it sends a key ACK or touch ACK to the keyboard via Bluetooth (a form of wireless transmission channel). In addition, the PAD can also send firmware upgrade data to the keyboard via Bluetooth, and the firmware upgrade data can be sent when the PAD is idle. In some examples, the PAD idle can be when the user is not using the PAD, and the PAD sends the firmware upgrade data when the user is not using the PAD, for example, the PAD sends the firmware upgrade data after completing the response based on the key data, etc. In some examples, the PAD sends the firmware upgrade data when it is relatively idle, and the relative idleness can be determined based on the processor resources of the PAD, etc., which will not be repeated here.

[0079] The forms of the wired transmission channel and the wireless transmission channel between the PAD and the keyboard are shown in Figure 5. The PAD and the keyboard are connected through three POGO pin interfaces. One POGO pin interface (VCC at the dotted line in the figure) is used to connect the power output pin of the PAD (such as GPIO2) and the power input pin of the keyboard (such as 3.3V). One POGO pin interface (GND at the dotted line in the figure) is used to connect the ground pin (such as GND) of the PAD and the keyboard. The PAD supplies power to the keyboard through these two POGO pin interfaces.

[0080] A POGO pin interface (DATA at the dotted line in the figure) is used to connect the TX pin of the keyboard and the RX pin of the PAD, connecting the TX pin of the keyboard and the RX pin of the PAD, and forming a hardware circuit through the RX pin of the PAD, the first connecting line connected to the RX pin of the PAD, the POGO pin interface, the second connecting line connected to the TX pin of the keyboard, and the TX pin of the keyboard. This hardware circuit serves as a wired transmission channel from the keyboard to the PAD. After the user presses a key or touches the Touch (the touchpad of the keyboard), the MCU of the keyboard generates keyboard data or touch data, and the keyboard data or touch data is sent from the TX pin of the keyboard to the RX pin of the PAD through the wired transmission channel. The keyboard can send the same keyboard data or touch data to the PAD twice or three times. Through multiple transmissions, the keyboard data or touch data is error-corrected and bit errors are minimized or eliminated.

[0081] After receiving key data or touch data through the RX pin, the PAD responds to the key data or touch data. For example, a user can input characters into the PAD through the keyboard. The user can click the key on the keyboard that points to the character. The keyboard responds to the user's key click and sends the key data pointing to the character to the PAD through a wired transmission channel. After receiving the key data, the PAD can restore the character and display the character pointed to by the key data. For example, if a user refreshes the page displayed on the PAD through touch, the user can use the keyboard's touch to control the mouse on the PAD to slide to the refresh control of the page. The user then clicks on the touch, and the touch refresh control refreshes the page. The keyboard can monitor the user's touch operations, generate touch data, and send the touch data to the PAD through a wired transmission channel. The PAD can respond to the touch data and complete the page refresh based on the touch data.

[0082] Although the keyboard can send the same keystroke data or touch data to the PAD multiple times, the PAD can respond only once. For example, when a user enters a character on the PAD using the keyboard, even though the user taps the key corresponding to that character once, the keyboard can send keystroke data corresponding to that character multiple times to the PAD. The PAD can receive keystroke data corresponding to the same character multiple times, but it can respond only once and display the data on the PAD once. For example, if the user taps the character "a" and the keyboard sends keystroke data to the PAD three times, the PAD can display "a" once instead of "aaa."

[0083] When the PAD sends key ACKs, touch ACKs, and firmware upgrade data to the keyboard, it can do so via Bluetooth. The PAD can wirelessly communicate with the keyboard through its Bluetooth chip (Bluetooth IC) and the keyboard's Bluetooth IC. After the PAD is connected to the keyboard via the POGO pin interface, the two Bluetooth ICs can be paired. After successful pairing, the PAD and keyboard can communicate via Bluetooth. The PAD can also send the same data to the keyboard multiple times via Bluetooth, such as sending multiple key ACKs.

[0084] In some examples, key ACK and touch ACK indicate that the PAD has responded based on key and touch data. The keyboard is less concerned with whether the PAD responds, so the PAD may not send key ACK and touch ACK to the keyboard, or may send key ACK and touch ACK to the keyboard only once. Firmware upgrade data is used to upgrade the keyboard, and its accuracy affects whether the keyboard can be successfully upgraded. Therefore, firmware upgrade data is relatively important, and the PAD can send firmware upgrade data to the keyboard multiple times to achieve error correction and minimize bit errors.

[0085] In one possible embodiment, two wired transmission channels and one wireless transmission channel are provided between the terminal device and the auxiliary device. The two wired transmission channels are respectively formed by a POGP pin between the TX pin of the terminal device and the RX pin of the auxiliary device, and a wired transmission channel is formed by a POGP pin between the RX pin of the terminal device and the TX pin of the auxiliary device. That is, the terminal device and the auxiliary device do not reuse wired transmission channels. In this scenario, the auxiliary device can transmit the same data through a wired transmission channel and a wireless transmission channel, and the terminal device can transmit data through another wired transmission channel. In this scenario, the wired transmission channel between the TX pin of the terminal device and the RX pin of the auxiliary device is the second transmission channel, and the wired transmission channel between the RX pin of the terminal device and the TX pin of the auxiliary device is the first transmission channel.

[0086] Still taking the PAD and keyboard as an example, the same key data or the same touch data can be sent to the PAD through a wired transmission channel and a wireless transmission channel at the same time, so that the key data or touch data can be sent to the PAD multiple times through different transmission channels to eliminate bit errors, and sending them simultaneously through different transmission channels can shorten the time. In some examples, the number of times the same key data or the same touch data is sent through different transmission channels can be different, for example, twice through a wired transmission channel and once through a wireless transmission channel, and the number of times it is sent is based on the transmission rate of the wired transmission channel and the wireless transmission channel, so as to shorten the transmission time while eliminating bit errors and avoiding misoperation. The wireless transmission channel can be a short-range wireless transmission channel, such as a Bluetooth channel or a Zifeng channel.

[0087] Figure 5 shows a keyboard sending data to a PAD via a wired transmission channel, and a PAD sending data to the keyboard via Bluetooth. In one possible embodiment, the PAD can send data to the keyboard via Zigbee. Zigbee communication modules are provided in the PAD and keyboard, allowing the PAD to wirelessly communicate with the keyboard via the Zigbee module. This allows the PAD to send key ACKs, touch ACKs, and firmware upgrade data, among other messages, via the Zigbee module.

[0088] In a possible embodiment, the keyboard and PAD both have high data transmission requirements, and both need to send data through a wired transmission channel. In order to replace the MCU with a lower-cost SOC, two wired transmission channels can be established between the keyboard and the PAD. For example, the keyboard and the PAD are connected through four POGO pin interfaces, two of which are used for the PAD to supply power to the keyboard, and one of the other two interfaces is used to connect the PAD's RX pin and the keyboard's TX pin, and the other is used to connect the PAD's TX pin and the keyboard's RX pin, thereby forming two wired transmission channels between the PAD and the keyboard. When the PAD sends data to the keyboard, the PAD sends the data to the PAD's TX pin, and then transmits the data to the keyboard's RX pin through the wired transmission channel where the PAD's TX pin is located, completing the data transmission from the PAD to the keyboard; when the keyboard sends data to the PAD, the keyboard sends the data to the keyboard's TX pin, and then transmits the data to the PAD's RX pin through the wired transmission channel where the keyboard's TX pin is located, completing the data transmission from the keyboard to the PAD. Figure 6 shows a schematic diagram. Compared to Figure 5, a wired transmission channel is formed between the PAD's TX pin and the keyboard's RX pin, through which the PAD can send data to the keyboard. The Bluetooth IC in both the PAD and keyboard can be omitted. Alternatively, the PAD and keyboard can retain the Bluetooth IC to interact with other devices, or the Bluetooth IC can serve as a backup for PAD-keyboard interaction, transmitting data via the Bluetooth IC if either wired transmission channel fails.

[0089] The pad and keyboard shown in Figures 5 and 6 above have a Hall sensor (Hall sensor) in the pad and a magnet in the keyboard. The Hall and magnet are placed near the three POGO pins connecting the pad and keyboard, and are equidistant from the connection line, which represents the contact line between the pad and keyboard when connected. As shown in Figures 5 and 6, the connection line is represented by a dotted line, and the Hall and magnet are equidistant or approximately the same distance from the dotted line. The Hall and magnet are placed near the GND pin of the three POGO pins.

[0090] HALL and magnets are used for disconnection detection. HALL is connected to the INT (interrupt) pin of the PAD. The PAD sets the default level of HALL to a high level, so the level connected to the INT pin is a high level. When the keyboard is connected to the PAD, the magnetic force detected by HALL is greater than the threshold, HALL can generate a low level, and the level of the INT pin changes from a high level to a low level. The change from high level to low level determines that the keyboard is connected to the PAD. When the keyboard is detached from the PAD, the magnetic force detected by HALL is less than or equal to the threshold, HALL can generate a high level, and the level of the INT pin remains at a high level, thereby determining that the PAD is not connected to the keyboard. Because the PAD previously determined that the keyboard was connected, and the level of the INT pin determined that the PAD was not connected to the keyboard, the PAD can determine that the keyboard is detached from the PAD. Thus, keyboard disconnection detection is achieved through changes in the HALL level.

[0091] When a connection between the keyboard and the pad is detected through a Hall level change, the pad supplies power to the keyboard, specifically through the pad's GPIO2 pin. When a Hall level change detects that the keyboard is disconnected from the pad, the pad stops supplying power to the keyboard, preventing the VCC and GND interfaces (VCC and GND indicated by the dotted line) from accidentally connecting. For example, if the VCC and GND interfaces are connected through a conductive object but the Hall level change fails to detect a connection between the keyboard and the pad, the pad will not supply power to the keyboard.

[0092] The above mainly uses the PAD as the terminal device and the keyboard as the auxiliary device as an example. The data transmission method provided in the embodiment of the present application can also be applied to other devices. For example, the detection device is used as the terminal device and the printing device is used as the auxiliary device. After the detection device is connected through a hardware interface (such as a POGO pin), a wired transmission channel is formed between the detection device and the printing device through the hardware interface. The transmission direction of the wired transmission channel is from the TX pin of the detection device to the RX pin of the printing device. After the detection device obtains the detection result, the detection result can be transmitted to the printing device through the wired transmission channel and printed by the printing device. The response (ACK) of the printing device can be sent to the detection device through the wireless transmission channel, which can also reduce the performance requirements of the detection device and the printing device.

[0093] In addition, the present application provides a terminal device, which has a first interface, a second interface and a third interface, and the terminal device is connected to an auxiliary device through the first interface, the second interface and the third interface; the terminal device includes a memory and a processor, the memory is used to store instructions executable by the processor, and the processor executes the instructions so that the terminal device executes the data transmission method of the first aspect.

[0094] The present application provides an auxiliary device, which has a fifth interface, a sixth interface and a seventh interface, and is connected to a terminal device through the fifth interface, the sixth interface and the seventh interface; the auxiliary device includes a memory and a processor, the memory is used to store instructions executable by the processor, and the processor executes the instructions so that the auxiliary device executes the data transmission method of the second aspect.

[0095] The present application provides a data transmission system, which includes a terminal device and an auxiliary device, the terminal device having a first interface, a second interface, and a third interface, and the auxiliary device having a fifth interface, a sixth interface, and a seventh interface; the first interface is used to connect to the fifth interface, the second interface is used to connect to the sixth interface, and the third interface is used to connect to the seventh interface; the terminal device includes a first memory and a first processor, the first memory is used to store instructions executable by the first processor, and the first processor executes the instructions so that the terminal device executes the data transmission method of the first aspect; the auxiliary device includes a second memory and a second processor, the second memory is used to store instructions executable by the second processor, and the second processor executes the instructions so that the auxiliary device executes the data transmission method of the second aspect.

[0096] The first, second, and third interfaces are of the same interface type, and the fifth, sixth, and seventh interfaces are of the same interface type. In one possible implementation, the first, second, third, fifth, sixth, and seventh interfaces are POGO pin interfaces; the terminal device is a tablet computer, and the auxiliary device is a keyboard. As shown in the dashed lines in FIG5 below, VCC corresponds to the first and fifth interfaces, GND corresponds to the second and sixth interfaces, and DATA corresponds to the third and seventh interfaces. The power supply voltage is input to the fifth and sixth interfaces through the first and second interfaces, and then power is supplied through the fifth and sixth interfaces. A first transmission channel is formed between the receiving pin of the terminal device and the transmitting pin of the auxiliary device through the third and seventh interfaces.

[0097] The present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor is enabled to execute the above-mentioned data transmission method.

[0098] The present application provides a data transmission device, which is applied to a terminal device, wherein the terminal device is connected to an auxiliary device through a first interface, a second interface and a third interface, and the device includes: a detection module, a power supply module, a channel establishment module and a transceiver module; the detection module is used to detect that the terminal device is connected to the auxiliary device, and trigger the power supply module to supply power to the auxiliary device through the first interface and the second interface; the channel establishment module is used to establish a first transmission channel between a receiving pin of the terminal device and a transmitting pin of the auxiliary device through the third interface, and the first transmission channel is a hardware channel from the auxiliary device to the terminal device; the transceiver module is used to receive first data sent by the auxiliary device through the first transmission channel, and to send second data to the auxiliary device through the second transmission channel, and the second transmission channel is different from the first transmission channel.

[0099] In a possible implementation, the transceiver module is configured to send the second data to the auxiliary device through a short-range wireless transmission channel.

[0100] In one possible implementation, the transceiver module is used to receive the first data sent by the auxiliary device through the first transmission channel N times, and the terminal device is used to respond to the first data once, where N is a natural number greater than 1; the transceiver module is used to send reception confirmation data of the first data to the auxiliary device once through the short-range wireless transmission channel, and the reception confirmation data is the second data.

[0101] In a possible implementation, the short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel.

[0102] In one possible implementation, the channel establishment module is also used to establish a second transmission channel between the sending pin of the terminal device and the receiving pin of the auxiliary device through the fourth interface of the terminal device, and the second transmission channel is a hardware channel from the terminal device to the auxiliary device; the transceiver module is used to receive the first data sent by the auxiliary device through the first transmission channel M times, and to receive the first data sent by the auxiliary device through the short-range wireless transmission channel T times, and the terminal device is used to respond to the first data once, M is a natural number greater than 1, and T is a natural number greater than or equal to 1; the transceiver module is used to send reception confirmation data of the first data to the auxiliary device once through the second transmission channel, and the reception confirmation data is the second data.

[0103] In one possible implementation, a detection module is used to detect the level generated by a Hall sensor, the Hall sensor is set in a terminal device, and the distance between the Hall sensor and the first interface or the second interface is less than a preset distance, a magnet is set in the auxiliary device, and the distance between the magnet and the first interface or the second interface is less than the preset distance, the magnet is used to generate magnetic force, and the magnetic force is used to control the level generated by the Hall sensor; if the level generated by the Hall sensor changes from a first level to a second level, it is determined that the auxiliary device is connected, and the first level is greater than the second level; if the level generated by the Hall sensor changes from the second level to the first level, it is determined that the auxiliary device is not connected.

[0104] The present application provides a data transmission device, which is applied to an auxiliary device, and the auxiliary device is connected to the terminal device through a fifth interface, a sixth interface and a seventh interface. The device includes: a power supply module, an establishment module and a data transceiver module. The power supply module is used to receive the power supply voltage output by the terminal device through the fifth interface and the sixth interface after the auxiliary device is connected to the terminal device; the establishment module is used to establish a first transmission channel between the receiving pin of the terminal device and the sending pin of the auxiliary device through the seventh interface, and the first transmission channel is a hardware channel from the auxiliary device to the terminal device; the data transceiver module is used to send first data to the terminal device through the first transmission channel, and receive second data sent by the terminal device through the second transmission channel, and the second transmission channel is different from the first transmission channel.

[0105] In a possible implementation, the data transceiver module is configured to receive second data sent by the terminal device through a short-range wireless transmission channel.

[0106] In one possible implementation, the data transceiver module is used to send first data N times to the terminal device through a first transmission channel, and the terminal device is used to respond to the first data once, where N is a natural number greater than 1, and is used to receive reception confirmation data of the first data sent by the terminal device through a short-range wireless transmission channel, where the reception confirmation data is second data, and the reception confirmation data is sent once.

[0107] In a possible implementation, the short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel.

[0108] In one possible implementation, the establishment module is also used to establish a second transmission channel between the sending pin of the terminal device and the receiving pin of the auxiliary device through the eighth interface of the auxiliary device, and the second transmission channel is a hardware channel from the terminal device to the auxiliary device; the data transceiver module is used to send the first data M times to the terminal device through the first transmission channel, and the auxiliary device sends the first data T times to the auxiliary device through the short-range wireless transmission channel, and the terminal device is used to respond to the first data once, M is a natural number greater than 1, and T is a natural number greater than or equal to 1; the data transceiver module is used to receive reception confirmation data of the first data sent by the terminal device through the second transmission channel, and the reception confirmation data is the second data.

Claims

1. A data transmission method, characterized in that: Applied to a terminal device, the terminal device is connected to an auxiliary device via a first interface, a second interface, and a third interface, and the method includes: After the terminal device detects that the auxiliary device is connected, the terminal device supplies power to the auxiliary device through the first interface and the second interface; The terminal device establishes a first transmission channel between a receiving pin of the terminal device and a transmitting pin of the auxiliary device through the third interface, where the first transmission channel is a hardware channel from the auxiliary device to the terminal device; The terminal device receives the first data sent by the auxiliary device through the first transmission channel; The terminal device sends second data to the auxiliary device through a second transmission channel, where the second transmission channel is different from the first transmission channel.

2. The method according to claim 1, characterized in that The terminal device sending the second data to the auxiliary device through the second transmission channel includes: the terminal device sending the second data to the auxiliary device through a short-range wireless transmission channel.

3. The method according to claim 1 or 2, characterized in that The terminal device receiving the first data sent by the auxiliary device through the first transmission channel includes: the terminal device receiving the first data sent by the auxiliary device through the first transmission channel N times, the terminal device being configured to respond to the first data once, where N is a natural number greater than 1; The terminal device sending the second data to the auxiliary device through the second transmission channel includes: the terminal device sending reception confirmation data of the first data to the auxiliary device once through the short-range wireless transmission channel, and the reception confirmation data is the second data.

4. The method according to claim 3, characterized in that The short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel.

5. The method according to claim 1, wherein The method further includes: the terminal device establishing, via a fourth interface, a second transmission channel between a transmit pin of the terminal device and a receive pin of the auxiliary device, the second transmission channel being a hardware channel from the terminal device to the auxiliary device; The receiving, by the terminal device, the first data sent by the auxiliary device through the first transmission channel includes: the terminal device receiving the first data sent by the auxiliary device through the first transmission channel M times, and the terminal device receiving the first data sent by the auxiliary device through the short-range wireless transmission channel T times, the terminal device being configured to respond to the first data once, where M is a natural number greater than 1, and T is a natural number greater than or equal to 1; The terminal device sending the second data to the auxiliary device through the second transmission channel includes: the terminal device sending reception confirmation data of the first data to the auxiliary device once through the second transmission channel, where the reception confirmation data is the second data.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The terminal device detects the electrical level generated by a Hall sensor, the Hall sensor being provided in the terminal device, and the distance between the Hall sensor and the first interface or the second interface being less than a preset distance, the auxiliary device being provided with a magnet, the distance between the magnet and the first interface or the second interface being less than a preset distance, the magnet being used to generate a magnetic force, and the magnetic force being used to control the electrical level generated by the Hall sensor; If the level generated by the Hall sensor changes from a first level to a second level, the terminal device determines that the auxiliary device is connected, and the first level is greater than the second level; If the level generated by the Hall sensor changes from the second level to the first level, the terminal device determines that the auxiliary device is not connected.

7. A data transmission method, characterized in that: Applied to an auxiliary device, the auxiliary device is connected to a terminal device via a fifth interface, a sixth interface, and a seventh interface, and the method includes: After the auxiliary device is connected to the terminal device, the auxiliary device receives the power supply voltage output by the terminal device through the fifth interface and the sixth interface; The auxiliary device establishes a first transmission channel between a receiving pin of the terminal device and a transmitting pin of the auxiliary device through the seventh interface, where the first transmission channel is a hardware channel from the auxiliary device to the terminal device; The auxiliary device sends first data to the terminal device through the first transmission channel; The auxiliary device receives second data sent by the terminal device through a second transmission channel, where the second transmission channel is different from the first transmission channel.

8. The method according to claim 7, characterized in that The auxiliary device receiving the second data sent by the terminal device through the second transmission channel includes: the auxiliary device receiving the second data sent by the terminal device through a short-range wireless transmission channel.

9. The method according to claim 7 or 8, characterized in that The auxiliary device sending the first data to the terminal device through the first transmission channel includes: the auxiliary device sending the first data to the terminal device through the first transmission channel N times, and the terminal device responding to the first data once, where N is a natural number greater than 1; The auxiliary device receives the second data sent by the terminal device through the second transmission channel, including: the auxiliary device receives the reception confirmation data of the first data sent by the terminal device through the short-range wireless transmission channel, the reception confirmation data is the second data, and the reception confirmation data is sent once.

10. The method according to claim 9, characterized in that The short-range wireless transmission channel is a Bluetooth channel or a Zifeng channel.

11. The method according to claim 7, characterized in that The method further includes: the auxiliary device establishing, via an eighth interface, a second transmission channel between a transmit pin of the terminal device and a receive pin of the auxiliary device, the second transmission channel being a hardware channel from the terminal device to the auxiliary device; The auxiliary device sending the first data to the terminal device through the first transmission channel includes: the auxiliary device sending the first data to the terminal device through the first transmission channel M times, and the auxiliary device sending the first data to the auxiliary device through the short-range wireless transmission channel T times, and the terminal device is configured to respond to the first data once, where M is a natural number greater than 1, and T is a natural number greater than or equal to 1; The auxiliary device receiving the second data sent by the terminal device through the second transmission channel includes: the auxiliary device receiving reception confirmation data of the first data sent by the terminal device through the second transmission channel, the reception confirmation data being the second data.

12. A terminal device, characterized in that: The terminal device has a first interface, a second interface and a third interface, and the terminal device is connected to the auxiliary device through the first interface, the second interface and the third interface; The terminal device includes a memory and a processor, the memory is used to store instructions executable by the processor, and the processor executes the instructions so that the terminal device executes the data transmission method according to any one of claims 1 to 6.

13. An auxiliary device, characterized in that: The auxiliary device has a fifth interface, a sixth interface and a seventh interface, and the auxiliary device is connected to the terminal device through the fifth interface, the sixth interface and the seventh interface; The auxiliary device includes a memory and a processor, the memory is used to store instructions executable by the processor, and the processor executes the instructions so that the auxiliary device performs the data transmission method according to any one of claims 7 to 11.

14. A data transmission system, characterized in that: The data transmission system includes a terminal device and an auxiliary device, the terminal device has a first interface, a second interface and a third interface, and the auxiliary device has a fifth interface, a sixth interface and a seventh interface; The first interface is used to connect to the fifth interface, the second interface is used to connect to the sixth interface, and the third interface is used to connect to the seventh interface; The terminal device includes a first memory and a first processor, the first memory is used to store instructions executable by the first processor, and the first processor executes the instructions so that the terminal device performs the data transmission method according to any one of claims 1 to 6; The auxiliary device includes a second memory and a second processor, the second memory is used to store instructions executable by the second processor, and the second processor executes the instructions to enable the auxiliary device to perform the data transmission method according to any one of claims 7 to 11.

15. The data transmission system according to claim 14, characterized in that: The first interface, the second interface, the third interface, the fifth interface, the sixth interface and the seventh interface are POGO pin interfaces; the terminal device is a tablet computer, and the auxiliary device is a keyboard.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the data transmission method according to any one of claims 1 to 11.