Data transmission method, terminal and system
By switching the near-field and far-field communication connections between terminal devices, the problem that wearable devices cannot transmit data when they are not within the near-field communication range is solved, and the continuity of data transmission and the improvement of user experience is achieved.
Patent Information
- Application Number
- CN202310732944.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2043-06-20
AI Technical Summary
Existing wearable devices cannot transmit data when they are not within the near field communication range, resulting in a degradation of user experience.
By establishing a pairing of near-field communication connections between terminal devices, data transmission is used when it is within the near-field communication range, and when it is out of range, it switches to a far-field communication connection to ensure the continuity of data transmission.
The data transmission continuity between terminal devices is realized, improving the user experience, especially the data synchronization function when the device is close to or away.
Smart Images

Figure CN119172735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology of intelligent terminals, and in particular to a method, terminal and system for data transmission between terminal devices. Background Art
[0002] With the increasing prevalence of electronic devices, more and more smart devices, such as smartphones and wearables, have emerged. Smartwatches, smart bracelets, and other smart wearable devices have become widely used. These wearable devices often connect to smartphones via Bluetooth to achieve multifunctionality, allowing users to synchronize calls, text messages, emails, photos, music, and more on the phone. However, the application ecosystem for wearable devices is not yet mature. Compared to the comprehensive functionality of mobile phone apps, many apps on wearable devices are simple, requiring users to use their phones to fully utilize the apps.
[0003] Currently, some applications on wearable devices require close-range communication with mobile phones via Bluetooth. Once the wearable device is farther away from the phone than the Bluetooth communication range, these applications on the wearable device become unavailable, thus reducing the user experience of wearable devices. Summary of the Invention
[0004] The embodiments of the present application provide a data transmission method, a terminal, a readable storage medium and a chip, which are used to solve the problem in the prior art that data transmission cannot be performed when the first terminal and the second terminal are not within the near field communication range.
[0005] In a first aspect, an embodiment of the present application provides a method for data transmission, the method comprising: pairing a first terminal and a second terminal using near-field communication, wherein the first terminal has a first application installed, the second terminal has a second application installed, and the first application and the second application belong to the same application; when the first terminal and the second terminal are within a near-field communication range, the first terminal and the second terminal establish a near-field communication connection, and the first application of the first terminal uses the near-field communication connection to transmit data to the second application of the second terminal; when the first terminal and the second terminal are not within the near-field communication range, the first terminal and the second terminal establish a far-field communication connection, and the first application of the first terminal uses the far-field communication connection to transmit data to the second application of the second terminal.
[0006] Through the data transmission method provided in the embodiment of the present application, when the near-field communication connection between the first terminal and the second terminal is disconnected, the first terminal and the second terminal can promptly establish a far-field communication connection, and complete the data transmission between the first application in the first terminal and the second application in the second terminal through the far-field communication connection, thereby ensuring the continuity of data transmission.
[0007] In one possible implementation, the first application and the second application are different versions of the same application. In this embodiment, the first terminal may be a mobile phone, the second terminal may be a smartwatch, the first application may be an instant messaging application on the mobile phone, and the second application may be an application on the smartwatch. This enables data transmission between the instant messaging applications on the mobile phone and the smartwatch in scenarios where the mobile phone is close to the smartwatch and the mobile phone is far away from the smartwatch.
[0008] In one possible implementation, the method further includes: the first terminal receiving a first user operation, and in response to the first operation, enabling a function that supports data transmission between a first application on the first terminal and a second application on the second terminal using a far-field communication connection. In this way, the user can selectively enable the far-field data transmission function based on their needs.
[0009] In one possible implementation, the method further includes: the first terminal displaying a first interface, the first interface including a selectable list of far-field data transmission applications, the list including the first application. In this way, the user can selectively enable the far-field data transmission function of some applications according to their needs.
[0010] In one possible implementation, after the first terminal and the second terminal establish a far-field communication connection, the method further includes: the first terminal displaying a third prompt message, where the third prompt message is used to notify the user that the far-field data transmission function on the first terminal has been activated. In this way, after the far-field data transmission function is activated, the first terminal can promptly notify the user that the function has been activated, thereby improving the user experience.
[0011] In one possible implementation, the method further includes: in response to the first operation, the first terminal sending a first message to the second terminal, where the first message is used to instruct the second terminal to start a function that supports the second application of the second terminal to use a far field communication connection to transmit far field data.
[0012] In a possible implementation, the first message further includes an application list, where the application list includes the first application of the first terminal.
[0013] In a possible implementation manner, the first terminal sends the first message through a near field communication connection.
[0014] In one possible implementation, the first terminal includes a first near-field communication module, the second terminal includes a second near-field communication module, and the first terminal and the second terminal establish a near-field communication connection, including: the first near-field communication module of the first terminal establishes a near-field communication connection with the second near-field communication module of the second terminal according to the near-field communication address of the second terminal.
[0015] In one possible implementation, the method further includes: the first terminal and the second terminal disconnecting the near-field communication connection, in response to disconnecting the near-field communication connection, wherein the first terminal further includes a first switching module and a first far-field communication module, and the first switching module instructs the first far-field communication module and the second far-field communication module of the second terminal to establish a far-field communication connection.
[0016] In one possible implementation, the first switching module instructs the first far-field communication module and the second far-field communication module of the second terminal to establish a far-field communication connection, including: the first switching module sends the first communication address to the first far-field communication module, and the first far-field communication module establishes a far-field communication connection with the second far-field communication module of the second terminal based on the first communication address, wherein the first communication address is the far-field communication address of the second terminal.
[0017] In one possible implementation, the method further includes: in response to disconnecting the near-field communication connection, the first switching module notifying the first application that the near-field communication connection has been disconnected; and in response to the first terminal and the second terminal establishing a far-field communication connection, the first switching module notifying the first application that the near-field communication connection has been established. In this way, the first switching module blocks the near-field communication connection from being unavailable to the first application.
[0018] In one possible implementation, the method further includes: in response to the disconnection of the near-field communication connection, within a preset time period, when the first terminal and the second terminal successfully establish a far-field communication connection, the first switching module does not notify the first application of the disconnection of the near-field communication connection; when the first terminal and the second terminal fail to successfully establish a far-field communication connection, the first switching module notifies the first application of the disconnection of the near-field communication connection. In this way, when the first terminal and the second terminal successfully establish a far-field communication connection within the preset time period, the first switching module masks the unavailability of the near-field communication connection from the first application.
[0019] In one possible implementation, the first terminal includes a first near-field communication application program interface, and the first application of the first terminal uses a far-field communication connection to transmit data to the second application of the second terminal, including: the first application of the first terminal calls the first near-field communication application program interface, and uses the far-field communication connection to transmit data to the second application of the second terminal.
[0020] In one possible implementation, the near-field communication connection includes a Bluetooth communication connection or a Wi-Fi Direct communication connection, and the far-field communication connection includes a Wi-Fi communication connection or a cellular communication connection.
[0021] In one possible implementation, when a first terminal and a second terminal are within near-field communication range, the first terminal and the second terminal also establish a far-field communication connection, and a first application on the first terminal uses both the near-field communication connection and the far-field communication connection to transmit data with a second application on the second terminal. Thus, when the first and second terminals are within near-field communication range, the first application on the first terminal can use both the near-field communication connection and the far-field communication connection to complete data transmission with the second application on the second terminal, thereby improving the efficiency and reliability of data transmission.
[0022] In one possible implementation, the first terminal includes a mobile phone or a tablet, and the second terminal includes a smart watch, smart glasses, or a smart car machine.
[0023] In one possible implementation, the first terminal includes a smart watch, smart glasses, or a smart car machine, and the second terminal includes a mobile phone or a tablet.
[0024] In a second aspect, an embodiment of the present application provides a method for data transmission, the method comprising: pairing a second terminal and a first terminal using near-field communication, wherein the first terminal is installed with a first application, the second terminal is installed with a second application, and the first application and the second application belong to the same application; when the second terminal and the first terminal are within a near-field communication range, the second terminal and the first terminal establish a near-field communication connection, and the second application of the second terminal uses the near-field communication connection to transmit data with the first application of the first terminal; when the second terminal and the first terminal are not within the near-field communication range, the second terminal and the first terminal establish a far-field communication connection, and the second application of the second terminal uses the far-field communication connection to transmit data with the first application of the first terminal.
[0025] Through the data transmission method provided in the embodiment of the present application, when the near-field communication connection between the second terminal and the first terminal is disconnected, the second terminal and the first terminal can promptly establish a far-field communication connection, and complete the data transmission between the second application in the second terminal and the first application in the first terminal through the far-field communication connection, thereby ensuring the continuity of data transmission.
[0026] In one possible implementation, the first application and the second application are different versions of the same application. In this embodiment, the second terminal may be a smartwatch, the first terminal may be a mobile phone, the second application may be an application on the smartwatch, and the first application may be an instant messaging application on the mobile phone. This enables data transmission between the instant messaging application on the mobile phone and the smartwatch in scenarios where the mobile phone is close to the smartwatch and the mobile phone is far away from the smartwatch.
[0027] In one possible implementation, after the second terminal establishes a far-field communication connection with the first terminal, the method further includes: the second terminal displaying a fourth prompt message, where the fourth prompt message is used to notify the user that the far-field data transmission function has taken effect on the second terminal. In this way, after the far-field data transmission function takes effect, the second terminal can promptly notify the user that the function has taken effect, thereby improving the user experience.
[0028] In a possible implementation, the method further includes: the second terminal receiving a first message from the first terminal, where the first message is used to instruct the second terminal to start a function that supports a second application of the second terminal to use a far field communication connection for far field data transmission.
[0029] In a possible implementation, in response to receiving the first message, the second terminal displays first prompt information, where the first prompt information is used to prompt the user that the second terminal has enabled the far-field data transmission function.
[0030] In a possible implementation, the first message further includes an application list, where the application list includes a first application of the first terminal.
[0031] In a possible implementation manner, the second terminal receives the first message through a near field communication connection.
[0032] In one possible implementation, the first terminal includes a first near-field communication module, the second terminal includes a second near-field communication module, and the second terminal and the first terminal establish a near-field communication connection, including: the second near-field communication module of the second terminal establishes a near-field communication connection with the first near-field communication module of the first terminal according to the near-field communication address of the first terminal device.
[0033] In one possible implementation, the second terminal and the first terminal establish a far-field communication connection, including: the second terminal and the first terminal disconnect the near-field communication connection, in response to disconnecting the near-field communication connection, wherein the second terminal also includes a second switching module and a second far-field communication module, and the second switching module instructs the second far-field communication module to establish a far-field communication connection with the first far-field communication module of the first terminal.
[0034] In one possible implementation, the second switching module instructs the second far-field communication module and the first far-field communication module of the first terminal to establish a far-field communication connection, including: the second switching module sends the second communication address to the second far-field communication module, and the second far-field communication module establishes a far-field communication connection with the first far-field communication module of the first terminal based on the second communication address, wherein the second communication address is the far-field communication address of the first terminal.
[0035] In one possible implementation, the method further includes: in response to the NFC connection being disconnected, the second switching module notifying the second application that the NFC connection has been disconnected; and in response to the first terminal and the second terminal establishing a FF communication connection, the second switching module notifying the second application that the NFC connection has been established. In this way, the second switching module blocks the NFC connection from being unavailable to the second application.
[0036] In one possible implementation, the method further includes: in response to the disconnection of the near-field communication connection, within a preset time period, when the first terminal and the second terminal successfully establish a far-field communication connection, the second switching module does not notify the second application of the disconnection of the near-field communication connection; when the first terminal and the second terminal fail to successfully establish a far-field communication connection, the second switching module notifies the second application of the disconnection of the near-field communication connection. In this way, when the first terminal and the second terminal successfully establish a far-field communication connection within the preset time period, the second switching module masks the unavailability of the near-field communication connection from the second application.
[0037] In one possible implementation, the second terminal includes a second near-field communication application program interface, and the second application of the second terminal uses a far-field communication connection to transmit data with the first application of the first terminal, including: the second application of the second terminal calls the second near-field communication application program interface, and transmits data with the first application of the first terminal through the far-field communication connection.
[0038] In one possible implementation, the near-field communication connection includes a Bluetooth communication connection or a Wi-Fi Direct communication connection, and the far-field communication connection includes a Wi-Fi communication connection or a cellular communication connection.
[0039] In one possible implementation, when the second terminal and the first terminal are within near-field communication range, the second terminal and the first terminal also establish a far-field communication connection, and the second application of the second terminal uses both the near-field communication connection and the far-field communication connection to transmit data with the first application of the first terminal. In this way, when the second terminal and the first terminal are within near-field communication range, the second application of the second terminal can use both the near-field communication connection and the far-field communication connection to complete data transmission with the first application of the first terminal, thereby improving the efficiency and reliability of data transmission.
[0040] In one possible implementation, the first terminal includes a mobile phone or a tablet, and the second terminal includes a smart watch, smart glasses, or a smart car machine.
[0041] In one possible implementation, the first terminal includes a smart watch, smart glasses, or a smart car machine, and the second terminal includes a mobile phone or a tablet.
[0042] In a third aspect, an embodiment of the present application provides a method for data transmission, which is applied to a first terminal and a second terminal, wherein the first terminal executes the method as shown in the above-mentioned first aspect and various implementation methods of the first aspect, and the second terminal executes the method as shown in the above-mentioned second aspect and various implementation methods of the second aspect.
[0043] In a fourth aspect, an embodiment of the present application provides a first terminal, which includes: one or more processors, one or more memories, the one or more memories storing one or more computer programs, and the one or more computer programs including instructions. When the instructions are executed by the one or more processors, the first terminal implements the method shown in the above-mentioned first aspect and the various implementation methods of the first aspect.
[0044] In a fifth aspect, an embodiment of the present application provides a second terminal, which includes: one or more processors, one or more memories, the one or more memories storing one or more computer programs, and the one or more computer programs including instructions. When the instructions are executed by one or more processors, the second terminal implements the method shown in the above-mentioned second aspect and the various implementation methods of the second aspect.
[0045] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method shown in the above-mentioned first aspect and each implementation of the first aspect, as well as the method shown in the above-mentioned second aspect and each implementation of the second aspect.
[0046] In the seventh aspect, an embodiment of the present application provides a chip, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method shown in the first aspect and the various implementations of the first aspect and the method shown in the second aspect and the various implementations of the second aspect are implemented.
[0047] In an eighth aspect, an embodiment of the present application provides a system for data transmission, the system comprising a first terminal and a second terminal, wherein the first terminal executes the method as shown in the above-mentioned first aspect and various implementations of the first aspect, and the second terminal executes the method as shown in the above-mentioned second aspect and various implementations of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1A A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0049] Figure 1B A software structure diagram of a terminal device provided in an embodiment of the present application;
[0050] Figure 2 A schematic diagram of a network architecture provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of a software architecture provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of another network architecture provided in an embodiment of the present application;
[0053] Figure 5 Another software architecture diagram provided for an embodiment of the present application;
[0054] Figure 6 A flowchart of a data transmission method provided in an embodiment of the present application;
[0055] Figure 7 A flowchart of another data transmission method provided in an embodiment of the present application;
[0056] Figures 8a-8f A UI diagram for setting far-field data transmission provided in an embodiment of the present application;
[0057] Figures 9a-9e Another UI diagram for setting up far-field data transmission provided in an embodiment of the present application;
[0058] Figures 10a-10d Another UI diagram for setting up far-field data transmission provided in an embodiment of the present application;
[0059] Figure 11 Another UI diagram for setting up far-field data transmission provided in an embodiment of the present application;
[0060] Figure 12 A schematic diagram of another network architecture provided in an embodiment of the present application;
[0061] Figure 13 A schematic diagram of the structure of a first terminal provided in an embodiment of the present application; Figure 14 A schematic diagram of the structure of the second terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to facilitate the understanding of the present application, the concept of the device involved in the present application is first explained.
[0063] The device referred to in this application refers to a terminal device with communication transmission capabilities. Multiple apps can be installed on the terminal device to provide users with different functions, such as sending and receiving messages through an instant messaging app. The terminal device can be a mobile phone, computer, watch, tablet, vehicle-mounted device, wearable device, industrial equipment, artificial intelligence equipment, augmented reality (AR) equipment, virtual reality (VR) equipment, etc.
[0064] The following combination Figure 1A Introduce the structure of the terminal equipment:
[0065] Figure 1A For a schematic diagram of the structure of the terminal device provided in the embodiment of the present application, see Figure 1A The terminal 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0066] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on terminal 100. In other embodiments of the present application, terminal 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0067] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0068] The controller may be the nerve center and command center of the terminal 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0069] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0070] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0071] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the terminal 100.
[0072] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0073] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0074] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0075] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the terminal 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the terminal 100.
[0076] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0077] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal 100, or to transfer data between the terminal 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect to other terminals, such as AR devices.
[0078] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative description and does not constitute a structural limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.
[0079] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the terminal 100. While charging the battery 142, the charging management module 140 can also provide power to the terminal via the power management module 141.
[0080] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0081] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0082] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 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.
[0083] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the terminal 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0084] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0085] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied on the terminal 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0086] In some embodiments, the antenna 1 of the terminal 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal 100 can communicate with the network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0087] Terminal 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0088] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, terminal 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0089] The terminal 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0090] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0091] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0092] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0093] Video codecs are used to compress or decompress digital video. Terminal 100 may support one or more video codecs. This allows terminal 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0094] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in the terminal 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0095] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0096] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0097] The terminal 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0098] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0099] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The terminal 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0100] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal 100 receives a call or voice message, the voice can be heard by placing the receiver 170B close to the ear.
[0101] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal 100 can be provided with at least one microphone 170C. In other embodiments, the terminal 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and identification of sound sources, and realize directional recording function, etc.
[0102] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0103] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Terminal 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, terminal 100 detects the touch intensity based on pressure sensor 180A. Terminal 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0104] The gyroscope sensor 180B can be used to determine the motion posture of the terminal 100. In some embodiments, the angular velocity of the terminal 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0105] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0106] The magnetic sensor 180D includes a Hall sensor. The terminal 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the terminal 100 is a flip phone, the terminal 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Furthermore, based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.
[0107] Accelerometer 180E can detect the magnitude of acceleration of terminal 100 in all directions (generally three axes). When terminal 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify terminal posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0108] The distance sensor 180F is used to measure distance. The terminal 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the terminal 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0109] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal 100 emits infrared light outward through the light emitting diode. The terminal 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal 100. When insufficient reflected light is detected, the terminal 100 can determine that there is no object near the terminal 100. The terminal 100 can use the proximity light sensor 180G to detect when the user holds the terminal 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0110] Ambient light sensor 180L is used to sense ambient light brightness. Terminal 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light brightness. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether terminal 100 is in a pocket to prevent accidental touches.
[0111] The fingerprint sensor 180H is used to collect fingerprints. The terminal 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0112] Temperature sensor 180J is used to detect temperature. In some embodiments, terminal 100 uses the temperature detected by temperature sensor 180J to implement a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, terminal 100 reduces the performance of a processor located near temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature falls below another threshold, terminal 100 heats battery 142 to prevent abnormal shutdown of terminal 100 due to low temperature. In other embodiments, when the temperature falls below yet another threshold, terminal 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0113] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the terminal 100, in a location different from that of the display screen 194.
[0114] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.
[0115] Keys 190 include a power button, a volume button, etc. Keys 190 may be mechanical keys or touch keys. Terminal 100 may receive key inputs and generate key signal inputs related to user settings and function control of terminal 100.
[0116] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0117] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0118] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the terminal 100 by inserting it into or removing it from the SIM card interface 195. The terminal 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal 100 and cannot be separated from the terminal 100.
[0119] The terminal 100 may further include a magnetometer (not shown in the figure), which may also be called an electronic compass or a needle compass, and may be used to detect the strength and direction of a magnetic field.
[0120] Figure 1B This is a block diagram of the software structure of a terminal device in an embodiment of the present application. A layered architecture divides software into several layers, each with distinct roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into five layers: application layer, system framework layer, system library and runtime layer, and kernel layer, from top to bottom.
[0121] The application layer can include applications such as camera, gallery, calendar, sports health, WLAN, music, video, etc. It should be noted that Figure 1B The applications included in the application layer shown in FIG are only exemplary and are not limited in this application. It is understood that the applications included in the application layer do not constitute a specific limitation on the mobile phone 100. In other embodiments of this application, compared to Figure 1B The application layer shown includes applications, and the mobile phone 100 may include more or fewer applications, or the mobile phone 100 may include entirely different applications.
[0122] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer, including various components and services to support developers' Android development. The system framework layer includes some predefined functions. Figure 1BAs shown, the system framework layer may include a view system, a window manager, a resource manager, a content provider, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. A control is a graphical user interface element, including buttons, icons, text boxes, etc. The view system can be used to build applications. The display interface can be composed of one or more views. The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc. The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The content provider is used to store and obtain data and make the data accessible to the application. The data may include video, images, audio, etc.
[0123] The system library and runtime layer include the system library and the Android runtime. The system library can include multiple functional modules, such as the browser kernel, 3D graphics library (for example, OpenGL ES), and font library. The browser kernel is responsible for interpreting web page syntax (such as HTML and JavaScript in Standard Generalized Markup Language) and rendering (displaying) the web page. The 3D graphics library is used to implement three-dimensional graphics drawing, image rendering, compositing, and layer processing. The font library is used to implement input of different fonts. The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one part contains function calls required by the Java language, and the other part is the Android core library. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files in the application layer and application framework layer as binary files. The virtual machine is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0124] It is understandable that Figure 1B The components included in the illustrated system framework layer, system library, and runtime layer do not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown, or may combine or split some components, or arrange the components differently.
[0125] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0126] Based on the structure of the terminal device introduced above, the background technology involved in this application is further introduced in detail below. Figure 2 A schematic diagram of a network architecture is shown as an example. Figure 2The network architecture shown may include a first terminal 201 and a second terminal 202, wherein the first terminal 201 may establish a near-field communication connection 203 with the second terminal 202, and the near-field communication connection 203 may be a Bluetooth communication connection, a Wi-Fi direct communication connection, an NFC communication connection, or a ZigBee communication connection, etc., wherein the Wi-Fi direct communication connection is also referred to as a Wi-Fi P2P connection, which is not limited in the embodiments of the present application. Specifically, in the embodiments of the present application, the first terminal 201 and the second terminal 202 may complete the transmission and reception of data within a short range through near-field communication. Near-field communication may also be referred to as short-range communication, which is not limited in the embodiments of the present application. Figure 2 In the network architecture shown, the first terminal 201 may include various terminals such as mobile phones, tablet computers, personal digital assistants, mobile Internet devices, and vehicle-mounted terminals. The second terminal 202 may include various wearable devices such as smart bracelets, smart watches, smart glasses, or other smart terminals such as vehicle-mounted devices. The above is for example only and is not limited to the embodiments of this application.
[0127] Figure 3 An example is shown Figure 2 A schematic diagram of a software architecture of a first terminal 201 and a second terminal 202 in the network architecture shown.
[0128] like Figure 3 As shown, the first terminal 201 includes an application layer, an application framework layer, and a hardware layer. The application layer of the first terminal 201 includes one or more first applications, each of which is a fully functional application. The first application can be a clock application, a calendar application, a gallery application, an instant messaging application, and the like.
[0129] It should be noted that a fully functional application means that the first terminal 201 installed with the application can complete all functions of the application without the aid of other devices. For example, the first terminal 201 installed with an instant messaging application can independently receive and send messages.
[0130] like Figure 3 As shown, the application framework layer of the first terminal 201 may include a far-field communication application program interface (API) and a near-field communication application program interface (API). The far-field communication application program interface (API) is used to provide an interface for upper-layer applications to access the far-field communication module, wherein the far-field communication application program interface includes a cellular communication application program interface (API) or a Wi-Fi communication application program interface (API). The near-field communication application program interface (API) is used to provide an interface for upper-layer applications to access the near-field communication module, wherein the near-field communication application program interface includes a Bluetooth communication application program interface (API), a Wi-Fi direct communication application program interface (API), an NFC communication application program interface (API), or a ZigBee communication application program interface (API).
[0131] The application framework layer of the first terminal 201 may also include other software modules, for details, see Figure 1B The description is not repeated here.
[0132] like Figure 3 As shown, the hardware layer of the first terminal 201 may include a far field communication module and a near field communication module. Specifically, the far field communication module may include a far field communication protocol stack and a far field communication driver, and the near field communication module may include a near field communication protocol stack and a near field communication driver.
[0133] In one possible implementation, the far-field communication protocol stack can be deployed on Figure 1B In the system library of the software structure shown, the far-field communication driver can be deployed in Figure 1B The kernel layer in the software structure shown is not limited in the embodiments of the present application. Among them, the far-field communication protocol stack includes a cellular communication protocol stack or a Wi-Fi communication protocol stack, etc. Taking the cellular communication protocol stack as an example, the cellular communication protocol stack includes an LTE protocol stack or an NR protocol stack, etc. The far-field communication driver provides the upper layer with the function of accessing the far-field communication chip. The far-field communication driver may include a cellular communication driver or a Wi-Fi communication driver, etc.
[0134] In one possible implementation, the near field communication protocol stack can be deployed in Figure 1B In the system library of the software structure shown, the near field communication driver can be deployed in Figure 1B The kernel layer in the software structure shown is not limited in the embodiments of the present application. Among them, the near field communication protocol stack includes the Bluetooth communication protocol stack, the Wi-Fi direct communication protocol stack, the NFC communication protocol stack or the ZigBee communication protocol stack, etc. Taking the Bluetooth communication protocol stack as an example, the Bluetooth communication protocol stack defines multiple applications (profiles) and core protocols (protocols) in the Bluetooth framework. Each profile defines its own corresponding message format and application rules. The profile is a Bluetooth service (Application). In order to achieve interconnection and interoperability between different devices under different platforms, the Bluetooth protocol has formulated specifications for various possible and universal application scenarios, such as A2DP (advanced audio distribution profile), HFP (hands-free profile), etc. The core protocol includes but is not limited to the basic Bluetooth service protocol SDP (service discovery protocol), the logical link control and adaptation protocol L2CAP (logical link control and adaptation protocol), etc. The core protocol is indispensable in the Bluetooth protocol stack.
[0135] The Bluetooth protocol of the embodiments of the present application may support classic Bluetooth (Basic Rate / Enhanced Data Rate, BR / EDR) and / or Bluetooth low energy (BLE). The Bluetooth protocol may also include different versions of the Bluetooth protocol, such as Bluetooth versions 1.0, 1.2, 2.0+EDR, 3.0+HS, 4.0, 4.1, 4.2, and 5.0.
[0136] The NFC driver provides upper layers with access to the NFC chip. NFC drivers can include Bluetooth, Wi-Fi Direct, NFC, or ZigBee.
[0137] The first application in the first terminal 201 can access the far-field communication module by calling the far-field communication application program interface, and can also access the near-field communication module through the near-field application program interface. It should be noted that when the first application in the first terminal 201 and the second terminal 202 perform data transmission, the first application only completes the data transmission by calling the near-field communication application program interface to access the near-field communication module.
[0138] like Figure 3 As shown, the second terminal 202 includes an application layer, an application framework layer, and a hardware layer. The application layer of the second terminal 202 includes one or more second applications, which are applications that do not have complete functionality. Second applications can include clock applications, calendar applications, gallery applications, instant messaging applications, and so on. It should be noted that an application that does not have complete functionality means that the second terminal 202 installed with the application requires the use of other devices to complete all the functions of the application. For example, the second terminal 202 installed with instant messaging application 202A requires the use of the first terminal 201 to complete the reception and transmission of messages.
[0139] The description of the application framework layer and the hardware layer in the second terminal 202 can refer to the above description of the first terminal 201, and will not be repeated here.
[0140] It should be noted that due to functional limitations of the second application, the second application only accesses the near-field communication module by calling the near-field communication application program interface (API). That is, when the second application in the second terminal 202 and the first terminal 201 perform data transmission, the second application only accesses the near-field communication module by calling the near-field communication application program interface (API). In one possible embodiment, the application system of the second terminal 202 also includes a third application, which is a fully functional application. The third application can access the far-field communication module by calling the far-field communication application program interface (API), or it can access the near-field communication module by calling the near-field communication application program interface (API).
[0141] Figure 3 The first application in the first terminal 201 and the second application in the second terminal 202 are two different versions of the same application.
[0142] Continue to see Figure 3In one possible embodiment, taking the first application being an instant messaging application 201A and the second application being an instant messaging application 202A as an example, a near field communication connection 203 is established between the instant messaging application 201A on the first terminal 201 and the instant messaging application 202A on the second terminal 202. The near field communication connection 203 may be a Bluetooth communication connection, a Wi-Fi Direct communication connection, an NFC communication connection, or a ZigBee communication connection. The instant messaging application 201A on the first terminal 201 and the instant messaging application 202A on the second terminal 202 are two different versions of the same instant messaging application. For example, the instant messaging application 201A is a fully functional application, while the instant messaging application 202A is an incomplete application. When the first terminal 201 and the second terminal 202 are within the communication range of the near field communication connection 203, the instant messaging application 202A on the second terminal 202 can receive and send messages via the near field communication connection 203. That is, the instant messaging application 202A on the second terminal 202 can implement the full functionality of the instant messaging application with the help of the first terminal 201. However, when first terminal 201 and second terminal 202 exceed the communication range of near-field communication connection 203, due to the functional limitations of instant messaging application 202A on second terminal 202, instant messaging application 202A only calls the near-field communication application interface. Therefore, instant messaging application 202A cannot complete the reception and transmission of messages. In other words, instant messaging application 202A on second terminal 202 cannot realize the full functionality of the instant messaging application, which reduces the user experience of second terminal 202. In particular, instant messaging application 201A is an example of a first application on first terminal 201. The first application on first terminal 201 can also be other applications, such as system notification application 202A, which is not limited in this embodiment of the present application; instant messaging application 202A is an example of a second application on second terminal 202. The second application on second terminal 202 can also be other applications, such as system notification application 202B, which is not limited in this embodiment of the present application.
[0143] In order to solve the technical problems existing in the above-mentioned prior art, an embodiment of the present application provides a method for data transmission. Figure 4 A network architecture of an embodiment of the present application is exemplified. Figure 4The network architecture shown may include a first terminal 201 and a second terminal 202, wherein the first terminal 201 and the second terminal 202 may establish a near-field communication connection 203, or may establish a far-field communication connection 204, wherein the near-field communication connection 203 may include a Bluetooth communication connection, a Wi-Fi direct communication connection, an NFC communication connection, or a ZigBee communication connection, and the far-field communication connection 204 may include a Wi-Fi communication connection or a cellular communication connection. In an embodiment of the present application, when the first terminal 201 and the second terminal 202 are within the near-field communication range, the first application in the first terminal 201 completes data transmission with the second application in the second terminal 202 via the near-field communication connection 203; when the first terminal 201 and the second terminal 202 are outside the near-field communication range, the first application in the first terminal 201 completes data transmission with the second application in the second terminal 202 via the far-field communication connection 204.
[0144] in, Figure 4 The illustrated network architecture also includes a server 210, and the first terminal 201 and the second terminal 202 can establish a far-field communication connection via the server 210. In some embodiments, a first application in the first terminal 201 can transmit data to a second application in the second terminal 202 via the server 210.
[0145] Further, in Figure 4 Based on the network architecture shown, Figure 5 A schematic diagram of a software architecture of the first terminal 201 and the second terminal 202 in an embodiment of the present application is exemplified.
[0146] and Figure 3In comparison, the difference is that the application framework layer in the first terminal 201 and the second terminal 202 also includes a switching module, wherein the switching module is connected to the near-field communication application interface and is connected to the far-field communication module and the near-field communication module. When the first terminal 201 and the second terminal 202 are within the near-field communication range, the near-field communication application interface can access the near-field communication module through the switching module, so that the first application on the first terminal 201 and the second application on the second terminal 202 use the near-field communication connection 203 to complete the data transmission. When the first terminal 201 and the second terminal 202 are outside the near-field communication range, the near-field communication application interface can access the far-field communication module through the switching module, so that the first application on the first terminal 201 and the second application on the second terminal 202 use the far-field communication connection 204 to complete the data transmission. In one possible implementation, the switching module can be part of the near-field communication application interface or part of the near-field communication module, and the embodiment of the present application is not limited to this. Specifically, the switching module is a software module that performs the functions provided by the embodiment of the present application through a computer program or one or more functions. In some possible embodiments, the switching module can also be called a distribution module, and the embodiment of the present application is not limited to this.
[0147] In the embodiment of the present application, the first terminal 201 and the second terminal 202 do not need to make any modifications to the first application and the second application. By simply modifying the implementation of the near-field communication application program interface, the first terminal 201 and the second terminal 202 can use the near-field communication connection 203 or the far-field communication connection 204 according to the near-field communication conditions through the switching module to complete the data transmission between the first application in the first terminal 201 and the second application in the second terminal 202. In other words, the first application and the second application still complete the data transmission between the first terminal 201 and the second terminal 202 by calling the near-field communication application program interface in the scenario where the second terminal 202 is close to the first terminal 201 and the second terminal 202 is far away from the first terminal 201.
[0148] based on Figure 5 The software architecture of the first terminal 201 and the second terminal 202 provided in the embodiment of the present application is shown. The first terminal 201 is installed with a first application, and the second terminal 202 is installed with a second application. The first application and the second application are the same application. The embodiment of the present application provides a method for data transmission. Figure 6 The flowchart exemplarily shows the data transmission method, including:
[0149] S601: The first terminal 201 and the second terminal 202 are paired using near field communication.
[0150] S602: When the first terminal 201 and the second terminal 202 are within the NFC range, the first terminal 201 and the second terminal 202 establish an NFC connection, and a first application of the first terminal 201 and a second application of the second terminal 202 use the NFC connection to perform data transmission.
[0151] S603: When the first terminal 201 and the second terminal 202 are not within the near field communication range, the first terminal 201 and the second terminal 202 establish a far field communication connection, and the first application of the first terminal 201 and the second application of the second terminal 202 use the far field communication connection to perform data transmission.
[0152] In this way, when the near-field communication connection between the first terminal 201 and the second terminal 202 is disconnected, the first terminal 201 and the second terminal 202 can promptly establish a far-field communication connection and complete the data transmission between the first application in the first terminal 201 and the second application in the second terminal 202 via the far-field communication connection, thereby ensuring the continuity of the data transmission. It should be noted that the first application and the second application can belong to the same version of the same application, or they can belong to different versions of the same application.
[0153] In a possible embodiment, taking the near field communication as Bluetooth communication as an example, Figure 4 Based on the network architecture shown, Figure 7 The flowchart of a data transmission method provided by one embodiment of the present application is exemplarily shown, including:
[0154] S701: The first terminal 201 and the second terminal 202 perform Bluetooth pairing.
[0155] In one possible implementation, both the first terminal 201 and the second terminal 202 turn on the Bluetooth communication function. The first terminal 201 selects the scanned second terminal 202 in the Bluetooth device interface and sends a Bluetooth pairing request to the second terminal 202. The second terminal 202 completes the Bluetooth pairing after agreeing to accept the Bluetooth pairing request of the first terminal 201.
[0156] In another possible implementation, both the first terminal 201 and the second terminal 202 enable Bluetooth communication functions, and the first terminal 201 completes Bluetooth pairing by scanning a QR code displayed by the second terminal 202. The embodiment of the present application does not limit the method of Bluetooth pairing.
[0157] S702 : The first terminal 201 obtains the unique identification information of the second terminal 202 , and sends the unique identification information of the first terminal 201 and the unique identification information of the second terminal 202 to the server 210 .
[0158] Specifically, the first terminal 201 obtains the unique identification information of the second terminal 202 through Bluetooth communication. The unique identification information of the second terminal 202 can be the Bluetooth MAC address of the second terminal 202, the International Mobile Equipment Identity (IMEI), etc., which is not limited in this embodiment of the present application. Further, the first terminal 201 obtains its own unique identification information. The unique identification information of the first terminal 201 can be the Bluetooth MAC address of the first terminal 201, the International Mobile Equipment Identity (IMEI), etc., which is not limited in this embodiment of the present application. Then, the first terminal 201 sends the unique identification information of the second terminal 202 and the unique identification information of the first terminal 201 to the server 210, and the server 210 marks the first terminal 201 and the second terminal 202 as paired devices. Furthermore, the first terminal 201 can also send the account information of the second terminal 202 and the account information of the first terminal 201 to the server 210, wherein the account information of the second terminal 202 and the account information of the first terminal 201 can belong to the same account or different accounts, which is not limited in this embodiment of the present application.
[0159] In one possible implementation, the second terminal 202 may obtain the unique identification information of the first terminal 201 and send the unique identification information of the second terminal 202 and the unique identification information of the first terminal 201 to the server 210 , which is not limited in this embodiment of the present application.
[0160] In another possible implementation, Bluetooth pairing is not required between the first terminal 201 and the second terminal 202. The first terminal 201 and the second terminal 202 transmit unique identification information of the terminal devices via Bluetooth broadcast. The Bluetooth broadcast may be a low-power Bluetooth BLE broadcast, which is not limited in this embodiment of the application.
[0161] S703: When the first terminal 201 and the second terminal 202 are within the Bluetooth communication range, the first application in the first terminal 201 and the second application in the second terminal 202 use the Bluetooth near-field communication connection to perform data transmission.
[0162] Specifically, when the first terminal 201 and the second terminal 202 are within the Bluetooth communication range, a Bluetooth near-field communication connection is established between the first terminal 201 and the second terminal 202. The first application in the first terminal 201 and the second application in the second terminal 202 use the Bluetooth near-field communication connection for data transmission.
[0163] In a possible embodiment, the first application on the first terminal 201 is an instant messaging application 201A, and the second application on the second terminal 202 is an instant messaging application 202A, wherein the instant messaging application 201A and the instant messaging application 202A are two different versions of an instant messaging application, for example, the instant messaging application 201A is an application with complete functions, and the instant messaging application 202A is an application without complete functions. It should be noted that when a Bluetooth near-field communication connection is established between the first terminal 201 and the second terminal 202, the switching modules on the first terminal 201 and the second terminal 202 maintain that the communication link currently available between the first terminal 201 and the second terminal 202 is a Bluetooth near-field communication connection. Specifically, in a possible implementation, the information maintained by the switching module of the first terminal 201 is shown in Table 1, and the information maintained by the switching module of the second terminal 202 is shown in Table 2. Among them, Tables 1 and 2 show the information maintained by the switching modules of the first terminal 201 and the second terminal 202, which may also include other information, such as the Bluetooth communication address of the opposite device, which is not limited in this embodiment of the present application.
[0164] Peer device Available communication links Second terminal 202 Bluetooth near-field communication connection
[0165] Table 1
[0166] Peer device Available communication links First terminal 201 Bluetooth near-field communication connection
[0167] Table 2
[0168] In one possible implementation, the switching module of the first terminal 201 sends the Bluetooth communication address of the opposite device, that is, the Bluetooth communication address of the second terminal 202, to the far-field communication module of the first terminal 201, and the switching module of the first terminal 201 establishes a Bluetooth communication connection with the second terminal 202 based on the Bluetooth communication address of the second terminal 202.
[0169] In a possible implementation, take the example of the instant messaging application 201A on the first terminal 201 sending data to the instant messaging application 202A on the second terminal 202. A first Bluetooth transmission channel is established between the instant messaging application 201A on the first terminal 201 and the instant messaging application 202A on the second terminal 202, and a binding relationship is established between the first Bluetooth transmission channel and the instant messaging application. The first Bluetooth transmission channel is a Bluetooth transmission channel established based on a Bluetooth near-field communication connection. The instant messaging application 201A on the first terminal 201 calls a near-field communication application program interface, i.e., a Bluetooth communication application program interface, and sends the application data and the device information of the second terminal 202 to the Bluetooth communication application program interface. The device information may be the name of the device or the Bluetooth MAC address of the device, etc., which is not limited in the embodiment of the present application. The Bluetooth communication application program interface on the first terminal 201 calls the switching module to send the application data to the switching module. The switching module on the first terminal 201 queries the peer device information and determines that the currently available communication link between the first terminal 201 and the second terminal 202 is a Bluetooth near-field communication connection. Therefore, the switching module on the first terminal 201 invokes the near-field communication module, i.e., the Bluetooth communication module, and sends the application data to the Bluetooth communication module. The Bluetooth communication module on the first terminal 201 generates data to be transmitted based on the Bluetooth communication address of the second terminal 202, the Bluetooth communication address of the first terminal 201, and the application data, and sends the data to the Bluetooth communication module on the second terminal 202 via the first Bluetooth transmission channel. The data to be transmitted includes the application data and a destination address, i.e., the Bluetooth communication address of the second terminal 202. In one possible implementation, the data to be transmitted also includes a source address, i.e., the Bluetooth communication address of the first terminal 201. The Bluetooth communication module on the second terminal 202 receives the data to be transmitted over the first Bluetooth transmission channel, parses it to obtain the application data, and sends the application data to the near-field communication application program interface (NFC API) via the switching module. Based on the binding relationship between the first Bluetooth transmission channel and the instant messaging application, the Bluetooth communication API on the second terminal 202 sends the application data to the instant messaging application 202A. In one possible implementation, after the Bluetooth communication module on the second terminal 202 parses and obtains the application data, it directly sends the application data to the Bluetooth communication application program interface. This embodiment of the present application is not limited to this. The process of sending data from the instant messaging application 202A on the second terminal 202 to the instant messaging application 201A on the first terminal 201 is similar to the description above and is not further described in this embodiment of the present application.
[0170] In one possible implementation, a switching module on the first terminal 201 queries the peer device information contained in the application data and determines that the currently available communication link between the first terminal 201 and the second terminal 202 is a Bluetooth near-field communication connection. The switching module on the first terminal 201 adds a first identifier to the application data to generate first application data, where the first identifier indicates that the application data is of a near-field communication type. The switching module on the first terminal 201 invokes a near-field communication module, i.e., a Bluetooth communication module, and sends the first application data to the Bluetooth communication module. The Bluetooth communication module on the first terminal 201 generates data to be transmitted based on the Bluetooth communication address of the second terminal 202, the Bluetooth communication address of the first terminal 201, and the first application data, and sends the data to be transmitted to the Bluetooth communication module on the second terminal 202 via a first Bluetooth transmission channel. Upon receiving the data to be transmitted on the first Bluetooth transmission channel, the Bluetooth communication module on the second terminal 202 parses the data to obtain the first application data and sends the data to the switching module. The switching module on the second terminal 202 parses the first application data to obtain the first identifier and the application data, and sends the application data to the Bluetooth communication application program interface based on the first identifier.
[0171] In another possible embodiment, the first application on the first terminal 201 is the system notification application 201B, and the second application on the second terminal 202 is the system notification application 202B, wherein the system notification application 201B and the system notification application 202B are two different versions of the system notification application, for example, the system notification application 201B is an application with complete functions, and the system notification application 202B is an application without complete functions.
[0172] When the first terminal 201 and the second terminal 202 are within Bluetooth communication range, the system notification application 201B in the first terminal and the system notification application 202B in the second terminal 202 use Bluetooth near-field communication to perform data transmission. The process of using Bluetooth near-field communication for data transmission between the system notification application 201B and the system notification application 202B is similar to that described in the above embodiment and will not be further described here.
[0173] S704: When the first terminal 201 and the second terminal 202 are not within the Bluetooth communication range, the first terminal 201 and the second terminal 202 establish a far field communication connection, and the first application in the first terminal 201 and the second application in the second terminal 202 use the far field communication connection to transmit data.
[0174] Specifically, in one possible implementation, the user carries the second terminal 202 away from the first terminal 201, causing the first terminal 201 and the second terminal 202 to be out of the Bluetooth communication range, and the Bluetooth near-field communication connection between the first terminal 201 and the second terminal 202 is disconnected. In response to the disconnection of the Bluetooth near-field communication connection, the far-field communication module in the first terminal 201 and the far-field communication module in the second terminal 202 establish a far-field connection through the server 210.
[0175] In a possible embodiment, in response to the disconnection of the Bluetooth near-field communication connection, the Bluetooth communication module in the first terminal 201 and the second terminal 202 notifies the corresponding switching module that the Bluetooth near-field communication connection has been disconnected. The switching module in the first terminal 201 and the second terminal 202 notifies the corresponding far-field communication module to establish a far-field connection with the opposite device. Specifically, the far-field communication module in the first terminal 201 sends the communication address of the first terminal 201 to the server 210 and requests the communication address of the second terminal 202 from the server 210. At the same time, the far-field communication module in the second terminal 202 sends the communication address of the second terminal 202 to the server 210 and requests the communication address of the first terminal 201 from the server 210. The communication address includes an IP address and a port number, which is not limited in this application. The server 210 sends the received communication address of the second terminal 202 to the first terminal 201, and at the same time sends the received communication address of the first terminal 201 to the second terminal 202. Based on the received communication address of the opposite device, the first terminal 201 and the second terminal 202 establish a TCP connection or a UDP connection. In this way, the first terminal 201 and the second terminal 202 can communicate with each other in a peer-to-peer (P2P) manner through the communication address of the other terminal device, thereby achieving direct communication between the first terminal 201 and the second terminal 202. It is understandable that the communication address in this step is a far-field communication address.
[0176] In another possible implementation, based on the received communication address of the peer device, the server 210 acts as a relay server, and the first terminal 201 and the second terminal 202 establish a TCP connection or a UDP connection via the server 210. In this way, the first terminal 201 and the second terminal 202 can communicate with each other via the relay of the server 210.
[0177] It should be noted that when the far-field communication connection between the first terminal 201 and the second terminal 202 is established, the far-field communication modules on the first terminal 201 and the second terminal 202 save the communication address of the opposite end. When the far-field communication modules on the first terminal 201 and the second terminal 202 receive a data packet from the opposite end device, the data packet is sent to the corresponding switching module. At the same time, the switching modules on the first terminal 201 and the second terminal 202 maintain the communication link currently available between the first terminal 201 and the second terminal 202 as a far-field communication connection. Furthermore, the switching modules in the first terminal 201 and the second terminal 202 also maintain the communication address of the opposite end device of the far-field communication connection. Specifically, the information maintained by the switching module of the first terminal 201 is shown in Table 3, and the information maintained by the switching module of the second terminal 202 is shown in Table 4. Among them, Tables 3 and 4 show the information maintained by the switching modules of the first terminal 201 and the second terminal 202, which may also include other information, and the embodiments of the present application are not limited to this.
[0178] Peer device Available communication links Communication address of the peer device Second terminal 202 Far-field communication connection XX.XX.XX.XX
[0179] Table 3
[0180] Peer device Available communication links Communication address of the peer device First terminal 201 Far-field communication connection XX.XX.XX.XX
[0181] Table 4
[0182] In one possible implementation, the switching module of the first terminal 201 sends the communication address of the opposite device, that is, the communication address of the second terminal 202, to the far-field communication module of the first terminal 201, and the switching module of the first terminal 201 establishes a far-field communication connection with the second terminal 202 based on the communication address of the second terminal 202.
[0183] The far-field communication modules in the first terminal 201 and the second terminal 202 may include a cellular communication module or a Wi-Fi communication module. In one possible implementation, taking the far-field communication module in the first terminal 201 as a Wi-Fi communication module and the far-field communication module in the second terminal 202 as a cellular communication module as an example, the first terminal 201 uses the Wi-Fi communication module to establish a far-field connection with the cellular communication module in the second terminal 202. The far-field connection also includes other network element devices, such as routers and base stations, which are not limited in this embodiment of the present application.
[0184] In one possible embodiment, an instant messaging application 201A on a first terminal 201 sends data to an instant messaging application 202A on a second terminal 202. A first far-field communication transmission channel is established between the instant messaging application 201A on the first terminal 201 and the instant messaging application 202A on the second terminal 202, and a binding relationship is established between the first far-field communication transmission channel and the first Bluetooth transmission channel. The first far-field communication transmission channel may be a UDP transmission channel or a TCP transmission channel established based on the far-field communication connection 204. The instant messaging application 201A on the first terminal 201 calls a near-field communication application program interface (API), i.e., a Bluetooth communication API, and sends the application data and device information of the second terminal 202 to the Bluetooth communication API. The Bluetooth communication API on the first terminal 201 calls a switching module and sends the application data to the switching module. The switching module on the first terminal 201 queries the peer device information and determines that the currently available communication link between the first terminal 201 and the second terminal 202 is a far-field communication connection, as well as the communication address of the peer device in the far-field communication connection, i.e., the communication address of the second terminal 202. Therefore, the switching module on the first terminal 201 calls the far-field communication module, i.e., the Wi-Fi communication module, and sends the application data and the communication address of the second terminal 202 to the Wi-Fi communication module. The Wi-Fi communication module on the first terminal 201 generates data to be sent based on the communication address of the second terminal 202, the communication address of the first terminal 201, and the application data, and sends the data to be sent to the far-field communication module, i.e., the cellular communication module, on the second terminal 202 via the first far-field communication transmission channel. The data to be sent includes the application data, the source address, i.e., the communication address of the first terminal 201, and the destination address, i.e., the communication address of the second terminal 202. When the cellular communication module on the second terminal 202 receives the data to be sent on the first far-field communication transmission channel, it parses the source address and application data, and determines from the source address that the sender of the data to be sent is the first terminal 201. The switching module then sends the application data in the data to be sent to the near-field communication application program interface, i.e., the Bluetooth communication application program interface. The Bluetooth communication application program interface sends the application data to the instant messaging application 202A based on the binding relationship between the first far-field communication transmission channel and the first Bluetooth transmission channel.
[0185] In one possible implementation, after the cellular communication module on second terminal 202 receives the data to be transmitted on the first far-field communication transmission channel, it determines, based on the source address in the data to be transmitted, that the sender of the data to be transmitted is first terminal 201. The module then directly sends the application data in the data to be transmitted to the Bluetooth communication application program interface (this embodiment of the present application is not limited to this). The process for instant messaging application 202A on second terminal 202 to send data to instant messaging application 201A on first terminal 201 is similar to the description above and is not further described in this embodiment of the present application.
[0186] In one possible implementation, after receiving the data to be transmitted on the first far-field communication transmission channel, the cellular communication module on the second terminal 202 parses the data to obtain the application data and the source address, i.e., the communication address of the first terminal 201. The cellular communication module on the second terminal 202 sends the application data and the source address to the switching module. The switching module on the second terminal 202 searches the maintenance information for the source address. If the source address is stored, the switching module on the second terminal 202 sends the application data to the Bluetooth communication application program interface. If the source address is not stored, the switching module on the second terminal 202 sends the application data to the far-field communication application program interface.
[0187] In one possible implementation, the switching module on the first terminal 201 queries the information of the peer device and obtains that the currently available communication link between the first terminal 201 and the second terminal 202 is a far-field communication connection, and the communication address of the peer device in the far-field communication connection, i.e., the communication address of the second terminal 202. The switching module on the first terminal 201 adds a second identifier to the application data to generate second application data, where the second identifier is used to indicate that the application data is of a far-field communication data type. The switching module on the first terminal 201 calls the far-field communication module, i.e., the Wi-Fi communication module, and sends the second application data and the communication address of the second terminal 202 to the Wi-Fi communication module. The Wi-Fi communication module on the first terminal 201 generates data to be sent based on the communication address of the second terminal 202, the communication address of the first terminal 201, and the second application data, and sends the data to be sent to the far-field communication module, i.e., the cellular communication module, on the second terminal 202 via the first far-field communication transmission channel. The data to be sent includes the second application data and the destination address, i.e., the communication address of the second terminal 202. When the cellular communication module on the second terminal 202 receives the data to be transmitted, it parses it to obtain the second application data and sends the second application data to the switching module. The switching module on the second terminal 202 parses the second application data to obtain the second identifier and the application data, and sends the application data to the Bluetooth communication application program interface according to the second identifier.
[0188] The process of the system notification application 201B and the system notification application 202B using the far field communication connection to transmit data is similar to that described in the above embodiment, and therefore will not be repeated here.
[0189] It should be noted that, in one possible implementation, in response to the disconnection of the Bluetooth near-field connection, if the far-field connection between the first terminal 201 and the second terminal 202 is not successfully established within a preset time period, the switching module in the first terminal 201 notifies the first application through the Bluetooth communication application program interface that the Bluetooth near-field connection is unavailable. At the same time, the switching module in the second terminal 202 notifies the second application through the Bluetooth communication application program interface that the Bluetooth near-field connection is unavailable. If the far-field connection between the first terminal 201 and the second terminal 202 is successfully established within the preset time period, the switching module in the first terminal 201 does not notify the first application of the unavailability of the Bluetooth near-field connection, that is, the switching module shields the first application from the unavailability of the Bluetooth near-field connection. At the same time, the switching module in the second terminal 202 does not notify the second application of the unavailability of the Bluetooth near-field connection, that is, the switching module shields the second application from the unavailability of the Bluetooth near-field connection.
[0190] In another possible implementation, in response to the Bluetooth near-field connection being disconnected, the switching module in the first terminal 201 directly notifies the first application via the Bluetooth communication application program interface that the Bluetooth near-field connection is unavailable. Simultaneously, the switching module in the second terminal 202 directly notifies the second application via the Bluetooth communication application program interface that the Bluetooth near-field connection is unavailable. When the far-field connection between the first terminal 201 and the second terminal 202 is successfully established, the switching module in the first terminal 201 notifies the first application via the Bluetooth communication application program interface that the Bluetooth near-field connection is normal. Simultaneously, the switching module in the second terminal 202 notifies the second application via the Bluetooth communication application program interface that the Bluetooth near-field connection is normal.
[0191] It should be noted that when direct data transmission between the first terminal 201 and the second terminal 202 using the far-field communication module fails, the first terminal 201 and the second terminal 202 can use the far-field communication module to forward data through the server 210, thereby realizing the function of data transmission between the first terminal 201 and the second terminal 202. The embodiment of the present application does not limit the specific method of using the far-field communication connection for data transmission.
[0192] S705: When the first terminal 201 and the second terminal 202 are again within the Bluetooth communication range, the first terminal 201 and the second terminal 202 establish a Bluetooth near-field communication connection, and disconnect the far-field connection between the first terminal 201 and the second terminal 202. The first application in the first terminal 201 and the second application in the second terminal 202 use the Bluetooth near-field connection for data transmission.
[0193] Specifically, in one possible implementation, the user brings the second terminal 202 close to the first terminal 201, and the first terminal 201 and the second terminal 202 are again within the Bluetooth communication range. The Bluetooth communication module in the first terminal 201 and the Bluetooth communication module in the second terminal 202 establish a Bluetooth near-field communication connection and disconnect the far-field connection between the first terminal 201 and the second terminal 202. Specifically, the far-field communication module in the first terminal 201 and the far-field communication module in the second terminal 202 disconnect the established TCP transmission channel or UDP transmission channel. In one possible implementation, in response to the establishment of the Bluetooth near-field connection, the switching module in the first terminal 201 notifies the far-field communication module to disconnect the far-field connection, and the switching module in the second terminal 202 notifies the far-field communication module to disconnect the far-field connection. Furthermore, when a Bluetooth near-field communication connection is established between the first terminal 201 and the second terminal 202, the switching modules on the first terminal 201 and the second terminal 202 maintain the current available communication link between the first terminal 201 and the second terminal 202 as a Bluetooth near-field communication connection, as shown in Table 1 and Table 2.
[0194] The process of the first application in the first terminal 201 and the second application in the second terminal 202 using the Bluetooth near-field connection to perform data transmission can be referred to the description of step S703 and will not be repeated here.
[0195] In one possible embodiment, a near-field communication connection 203 and a far-field communication connection 204 may exist simultaneously between the first terminal 201 and the second terminal 202. A first Bluetooth communication transmission channel and a first far-field communication transmission channel may be established simultaneously between the instant messaging application 201A in the first terminal 201 and the instant messaging application 202A in the second terminal 202. The switching module in the first terminal 201 may use the first Bluetooth communication transmission channel and the first far-field communication transmission channel simultaneously to send the same data to the second terminal 202. This may increase the reliability of data transmission between the first terminal 201 and the second terminal 202. In another possible embodiment, the switching module in the first terminal 201 may use the first Bluetooth communication transmission channel and the first far-field communication transmission channel simultaneously to send different data to the second terminal 202. This may improve the efficiency of data transmission between the first terminal 201 and the second terminal 202.
[0196] In another possible implementation, the first application in the first terminal 201 and the second application in the second terminal 202 can be the same version of the same application. For example, if both the first terminal and the second terminal are mobile phones, data can be transmitted between the same application in the mobile phones via either a near-field communication connection or a far-field communication connection, thereby increasing the reliability and flexibility of data transmission between the mobile phones.
[0197] from Figure 7 As can be seen from the given examples, in the embodiments of the present application, the first terminal 201 and the second terminal 202 do not need to make any modifications to the first application and the second application. By simply modifying the implementation of the near-field communication application interface, the first terminal 201 and the second terminal 202 can use a near-field communication connection or a far-field communication connection through the switching module according to the near-field communication conditions to complete the data transmission between the first terminal 201 and the second terminal 202. In this way, only the application interface in the terminal device system needs to be modified, without modifying the implementation of each application one by one, so that the second application on the second terminal 202 can achieve complete application functionality, that is, data synchronization can be achieved without relying on the first terminal 201 being nearby.
[0198] In the embodiment of the present application, the first terminal 201 may have a setting function, which can enable the far-field data transmission function of the first application in the first terminal 201 in the Bluetooth setting interface.
[0199] Please refer to Figure 8a For example, the Bluetooth setting interface 802 of the first terminal 201 includes one or more controls. The controls include, but are not limited to, a Bluetooth control 804, a power control, a network control, etc. For example, the user can click the Bluetooth control 804 to enable the Bluetooth function.
[0200] Exemplarily, the first terminal 201 turns on the Bluetooth function in response to the received user operation. Figure 8b For example, the first terminal 201 may display a Bluetooth icon on the network control on the Bluetooth settings interface 802 to indicate that the Bluetooth function is activated. The Bluetooth settings interface 802 displays paired devices 806 and available devices 808. The devices displayed in the available devices 808 are Bluetooth devices scanned by the first terminal 201 but have not yet completed Bluetooth pairing with the first terminal 201. The paired devices 806 include the second terminal 202. In response to the user clicking the control 810 to the right of the icon of the second terminal 202, the settings interface of the second terminal 202 is entered.
[0201] Figure 8cThe example shows a settings interface 812 of the second terminal 202, which includes, for example, a far-field data transmission control 814. For example, a user can click the far-field data transmission control 814 to enable the far-field data transmission function between the first terminal 201 and the second terminal 202. Specifically, the far-field data transmission function refers to a function that enables a first application on the first terminal to use a far-field communication connection to transmit data to a second application on the second terminal.
[0202] Exemplarily, the first terminal 201 responds to the received user operation and turns on the far-field data transmission function of the second terminal 202. Figure 8d The settings interface 812 of the second terminal 202 includes a far-field data transmission control 814, a selectable list of far-field data transmission applications, and an application addition control 816, among others. The far-field data transmission control 814 indicates that the far-field data transmission function is enabled. The selectable list of far-field data transmission applications includes an instant messaging application 818. The user can also click the application addition control 814 to add other applications to the selectable list of far-field data transmission applications. In response to the instant messaging application 818 having enabled the far-field data transmission function, the instant messaging application 201A in the first terminal 201 and the instant messaging application 202A in the second terminal 202 can execute the data transmission method provided in the embodiments of the present application to complete the data transmission function between the instant messaging application 201A and the instant messaging application 202A.
[0203] In one possible implementation, in response to a user selecting, for example, Figure 8c In the setting interface 812 shown, click the far-field data transmission control 814, and the first terminal 201 displays, for example Figure 8e The setting interface 822 of the second terminal 202 is shown. The status bar of the setting interface 822 of the second terminal 202 displays a far-field data transmission icon 824, which is used to indicate that the first terminal 201 has turned on the far-field data transmission function. When the user clicks the far-field data transmission control 826 to turn off the far-field data transmission function between the first terminal 201 and the second terminal 202, the first terminal 201 displays, for example, Figure 8c The setting interface 812 of the second terminal 202 is shown. At this time, the far-field data transmission icon has been cleared from the status bar in the setting interface 812 of the second terminal 202.
[0204] In a possible implementation, the first terminal 201 may replace the Bluetooth icon in the status bar with another Bluetooth icon to indicate that the first terminal 201 has enabled the far-field data transmission function. Figure 8e, another Bluetooth icon 834 is displayed in the status bar of the setting interface 832 of the second terminal 202, which is used to indicate that the first terminal 201 has enabled the far-field data transmission function. It should be noted that this application does not limit the icon used to indicate the far-field data transmission function.
[0205] In another possible embodiment, the first terminal 201 may have a setting function, which can enable the far-field data transmission function of the first application in the first terminal 201 in the sports health application.
[0206] Figure 9a The main interface 902 displayed by the first terminal 201 is shown as an example. The interface 902 displays a page with application icons. The page includes multiple icons (for example, a clock application icon, a calendar application icon, a gallery application icon, a memo application icon, a file management application icon, a browser application icon, a camera application icon, etc.). A page indicator 908 is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator are multiple tray icons, which remain displayed when the page is switched. In some embodiments, the above page may also include multiple application icons and page indicators. The page indicator may not be part of the page and may exist independently. The above application icons are also optional, and this embodiment of the application is not limited to this. A status bar 904 is displayed in the upper part of the interface 902. The status bar 904 may include: one or more signal strength indicators of the mobile communication signal (also known as the cellular signal), a battery status indicator, a time indicator, etc. When the terminal turns on the Bluetooth function, the status bar 904 may also display a Bluetooth on indicator. The user can operate the terminal through preset gestures, such as returning to the main interface, displaying open applications, etc. This application does not limit the specific operation gestures. Not limited to gesture operations, the terminal can perform related operations through virtual buttons or physical buttons. The user clicks the sports health icon 906 to enter the sports health application interface.
[0207] Figure 9bThe example interface 912 of the sports health application is shown. This interface 912 includes a sports parameter display area and a menu bar. The sports parameter display area can be used to display today's sports data, such as distance traveled, calories burned, and steps taken. The sports parameter display area can also be used to display recent sports health data, such as exercise history, heart rate, and weight. The menu bar may include a health icon, a sports icon, a device icon 914, and a "My" icon. The health icon can be used to display the sports parameter display area, i.e., the sports parameter display area of the sports health interface 912. The sports icon can be used to switch the display of the sports details area, i.e., the sports details display area provides different exercise modes, and users can choose different exercise modes to exercise. The device icon 914 can be used to switch the display of the device details display area, which can display other electronic devices connected to the first terminal 201. Users can use the function controls provided in the device details display area to delete, connect, or set up these electronic devices. The "My" icon can be used to switch the display of the personal information area. Users click the device icon 914 to enter the device details display area.
[0208] Figure 9c The device details display area interface 922 of the sports health application is exemplarily shown. The interface 922 includes other electronic devices that the first terminal 201 has connected to. For example, the device details display area interface 922 displays an icon 924 of the second terminal 202. The user clicks icon 924 to enter the settings interface of the second terminal 202.
[0209] Figure 9d The setting interface 932 of the second terminal 202 is exemplarily shown, and the interface 932 includes a far-field data transmission control 934. For example, the user can click the far-field data transmission control 934 to enable the far-field data transmission function between the first terminal 201 and the second terminal 202.
[0210] Exemplarily, the first terminal 201 responds to the received user operation and turns on the far-field data transmission function of the second terminal 202. Figure 9e, the setting interface 932 of the second terminal 202 includes a far-field data transmission control 934, an optional list of far-field data transmission applications, and an application adding control 936, etc. The far-field data transmission control 934 shows that the far-field data transmission function has been turned on. The optional list of far-field data transmission applications includes an instant messaging application 938. The user can also click the application adding control 936 to add other applications to the optional list of far-field data transmission applications. In response to the instant messaging application 938 having turned on the far-field data transmission function, the instant messaging application 201A in the first terminal 201 and the instant messaging application 202A in the second terminal 202 can execute the data transmission method provided in the embodiment of the present application to complete the data transmission function between the instant messaging application 201A and the instant messaging application 202A. Among them, the display of the far-field data transmission function icon can be referred to. Figure 8e and 8f As shown, no further details are given here.
[0211] It should be noted that if Figure 8c As shown in Figure 9d, in response to a user clicking on the far-field data transmission control 814 or the far-field data transmission control 934, the first terminal 201 sends a first message to the second terminal 202. The first message is used to notify the second terminal 202 to enable the far-field data transmission function. The first message carries the device address of the second terminal 202 and a list of far-field data transmission applications. The application list may include the first application in the first terminal 201 or the second application in the second terminal 202. After receiving the first message, the second terminal 202 enables the far-field data transmission function. In one possible embodiment, after enabling the far-field data transmission function, the second terminal 202 sends a second message to the first terminal 201. The second message is used to notify the first terminal 201 that the far-field data transmission function has been successfully enabled. The first message and the second message can be transmitted via a near-field communication connection or relayed through a server, which is not limited in this embodiment of the present application.
[0212] In one possible implementation, after the second terminal 202 receives the first message sent by the first terminal 201, the second terminal 202 displays a first prompt message, which is used to prompt the user that the second terminal 202 has turned on the far-field data transmission function. In one example, the second terminal 202 displays a prompt box, prompting the user that "the far-field data transmission function has been turned on." Optionally, a "Cancel" control and a countdown prompt box are also displayed in the prompt box. Clicking the "Cancel" control can be understood as the second terminal 202 refusing to turn on the far-field data transmission function. The countdown prompt box is used to prompt the user that within the preset time, if the "Cancel" control is not clicked, it means that the second terminal 202 agrees to turn on the far-field data transmission function. The preset time length can be 3 seconds, which is not limited in this embodiment of the present application.
[0213] In a possible implementation, after the first terminal 201 receives the second message sent by the second terminal 202, the first terminal 201 displays second prompt information, where the second prompt information is used to prompt the user that the second terminal 202 has enabled the far-field data transmission function.
[0214] In another possible embodiment, the second terminal 202 may have a setting function, which can enable the far-field data transmission function of the second application in the second terminal 202 in a setting application.
[0215] Please refer to Figure 10a Exemplarily, the Bluetooth setting interface 1002 of the second terminal 202 includes a Bluetooth control 1004. Exemplarily, the user can click the Bluetooth control 1004 to enable the Bluetooth function.
[0216] Exemplarily, the second terminal 202 turns on the Bluetooth function in response to the received user operation. Figure 10b For example, the second terminal 202 displays paired devices 1006 and available devices 1008 in the Bluetooth setting interface 1002, where the devices displayed in the available devices 1008 are Bluetooth devices scanned by the second terminal 202 but have not yet completed Bluetooth pairing with the second terminal 202. The paired devices 1006 include the first device 201. In response to the user clicking the control 1010 to the right of the icon of the first terminal 201, the setting interface of the first terminal 201 is entered.
[0217] Figure 10c The setting interface 1012 of the first terminal 201 is exemplarily shown, and the interface 1012 includes a far-field data transmission control 1014 . For example, the user can click the far-field data transmission control 1014 to enable the far-field data transmission function of the first terminal 201 .
[0218] Exemplarily, the second terminal 202 responds to the received user operation and turns on the far-field data transmission function of the first terminal 201. Figure 10d The settings interface 1012 of the first terminal 201 includes a far-field data transmission control 1014, a selectable list of far-field data transmission applications, and an application addition control 1016, among others. The far-field data transmission control 1014 indicates that the far-field data transmission function is enabled. The selectable list of far-field data transmission applications includes an instant messaging application 1018. The user can also click the application addition control 1014 to add other applications to the selectable list of far-field data transmission applications. In response to the instant messaging application 1018 having enabled the far-field data transmission function, the instant messaging application 202A in the second terminal 202 and the instant messaging application 201A in the first terminal 201 can execute the data transmission method provided in the embodiments of the present application to complete the data transmission function between the instant messaging application 202A and the instant messaging application 201A.
[0219] In one possible embodiment, the first terminal 201 includes an instant messaging application 201A and a system notification application 201B, and the second terminal 202 includes an instant messaging application 202A and a system notification application 202B. The instant messaging application 201A and the instant messaging application 202A are two different versions of the instant messaging application, and the system notification application 201B and the system notification application 202B are two different versions of the system notification application. In one possible implementation, the instant messaging application has enabled the far-field data transmission function, while the system notification application has disabled the far-field data transmission function. Figure 8d As shown, the instant messaging application is in the selectable list of the far field communication application, while the system notification application is not in the selectable list of the far field communication application.
[0220] When first terminal 201 and second terminal 202 are within Bluetooth communication range, the switching modules on first terminal 201 and second terminal 202 maintain the Bluetooth communication link as the currently available communication link between first terminal 201 and second terminal 202, as described in Tables 1 and 2. At this point, data transmission between instant messaging applications 201A and 202A, as well as between system notification applications 201B and 202B, is accomplished using the Bluetooth communication link. The specific data transmission method is described in step S703 and will not be further elaborated here.
[0221] When the first terminal 201 and the second terminal 202 are not within the Bluetooth communication range, the switching modules on the first terminal 201 and the second terminal 202 maintain the available communication link between the current instant messaging application 201A and the instant messaging application 202A as a far-field communication connection. Since the system notification application has not enabled the far-field data transmission function, the switching modules on the first terminal 201 and the second terminal 202 maintain that the communication link between the current system notification application 201B and the system notification application 202B is unavailable. Specifically, the information maintained by the switching module of the first terminal 201 is shown in Table 5, and the information maintained by the switching module of the second terminal 202 is shown in Table 6. Among them, Tables 5 and 6 show the information maintained by the switching modules of the first terminal 201 and the second terminal 202, which may also include other information, and the embodiments of the present application do not limit this.
[0222] Peer device app Available communication links Communication address of the peer device Second terminal 202 Instant messaging applications Far-field communication connection XX.XX.XX.XX Second terminal 202 System Notification Application none none
[0223] Table 5
[0224] Peer device app Available communication links Communication address of the peer device First terminal 201 Instant messaging applications Far-field communication connection XX.XX.XX.XX First terminal 201 System Notification Application none none
[0225] Table 6
[0226] In one possible implementation, when first terminal 201 and second terminal 202 are out of Bluetooth communication range, in response to the disconnection of the Bluetooth communication connection between first terminal 201 and second terminal 202, the switching module in first terminal 201 notifies system notification application 201B, via the Bluetooth communication API, that the Bluetooth near-field connection is unavailable. The switching module in second terminal 202 also notifies system notification application 202B, via the Bluetooth communication API, that the Bluetooth near-field connection is unavailable. At this point, data transmission between instant messaging application 201A and instant messaging application 202A is completed using a far-field communication connection, while data transmission between system notification application 201B and system notification application 202B is unavailable.
[0227] In one possible implementation, Figure 8d As shown, the user can click the application add control 814 to add the system notification application to the optional list of far-field data transmission applications. In response to the add operation, the first terminal 201 displays the setting interface of the second terminal 202 as shown in FIG. Figure 11 As shown, the instant messaging application and the system notification application are both in the optional list of far-field communication applications, indicating that the far-field data transmission function has been enabled for both the instant messaging application and the system notification application.
[0228] When first terminal 201 and second terminal 202 are within Bluetooth communication range, the switching modules on first terminal 201 and second terminal 202 maintain the Bluetooth communication link as the currently available communication link between first terminal 201 and second terminal 202, as shown in Tables 1 and 2. At this point, data transmission between instant messaging applications 201A and 202A, as well as between system notification applications 201B and 202B, is accomplished using the Bluetooth communication link. The specific data transmission method is described in step S703 and will not be further elaborated here.
[0229] When the first terminal 201 and the second terminal 202 are not within the Bluetooth communication range, the switching modules on the first terminal 201 and the second terminal 202 maintain the communication link that can be used between the current instant messaging application 201A and the instant messaging application 202A as a far-field communication connection. At the same time, the switching modules on the first terminal 201 and the second terminal 202 maintain the communication link that can be used between the current system notification application 201B and the system notification application 202B as a far-field communication connection. Specifically, the information maintained by the switching module of the first terminal 201 is shown in Table 7, and the information maintained by the switching module of the second terminal 202 is shown in Table 8. Among them, Table 7 and Table 8 show the information maintained by the switching modules of the first terminal 201 and the second terminal 202, which may also include other information, and this embodiment of the application is not limited to this. At this time, the data transmission between the instant messaging application 201A and the instant messaging application 202A, and between the system notification application 201B and the system notification application 202B, are completed using a far-field communication connection. The specific data transmission method is as described in step S704 and will not be repeated here.
[0230] Peer device app Available communication links Communication address of the peer device Second terminal 202 Instant messaging applications Far-field communication connection XX.XX.XX.XX Second terminal 202 System Notification Application Far-field communication connection XX.XX.XX.XX
[0231] Table 7
[0232] Peer device app Available communication links Communication address of the peer device First terminal 201 Instant messaging applications Far-field communication connection XX.XX.XX.XX First terminal 201 System Notification Application Far-field communication connection XX.XX.XX.XX
[0233] Table 8
[0234] In one possible implementation, when the first terminal 201 and the second terminal 202 are not within the Bluetooth communication range, after the first terminal 201 and the second terminal 202 successfully establish a far-field communication connection, a third prompt message is displayed on the first terminal 201, and the third prompt message is used to prompt the user that the far-field data transmission function in the first terminal 201 has taken effect. In one example, the third prompt message can be as follows: Figure 8e The far-field data transmission icon 824 in the Figure 8fThe far-field data transmission icon 834 in the embodiment of the present application is not limited to this. That is, in this implementation, when the first terminal 201 turns on the far-field data transmission function, the first terminal 201 does not display the far-field data transmission icon 834. Figure 8e The far-field data transmission icon 824 in the Figure 8f Instead, the first terminal 201 displays the far-field data transmission icon 834 when the first terminal 201 and the second terminal 202 successfully establish a far-field communication connection. Figure 8e The far-field data transmission icon 824 in the Figure 8f The far-field data transmission icon 834 is displayed in the first terminal 201. It should be noted that the first terminal 201 may also use other methods to notify the user that the far-field data transmission function is active on the first terminal 201. In one example, the first terminal 201 may display a card indicating that the far-field data transmission function is active in the notification center of the negative one screen and / or the drop-down menu. The user can use this card to turn off the far-field data transmission function, causing the first terminal 201 to terminate the far-field data transmission function.
[0235] In one possible implementation, when the first terminal 201 and the second terminal 202 are not within the Bluetooth communication range, after the first terminal 201 and the second terminal 202 successfully establish a far-field communication connection, a fourth prompt message is displayed on the second terminal 202. This fourth prompt message is used to notify the user that the far-field data transmission function in the second terminal 202 has taken effect. The information displayed on the second terminal 202 can refer to the description of the first terminal 201 above and is not repeated here.
[0236] In one possible embodiment, Figure 8c As shown, after the user clicks the far-field data transmission control 814 to enable the far-field data transmission function of the second terminal 202, the far-field data transmission function is enabled by default for all applications. In response to enabling the far-field data transmission function of the second terminal 202, the data transmission process between the first application in the first terminal 201 and the second application in the second terminal 202 is as described in the above embodiment and will not be repeated here. It should be noted that in this scenario, in response to the user clicking the far-field data transmission control 714, the first message sent by the first terminal 201 to the second terminal 202 may not include the far-field data transmission application list. After receiving the first message, the second terminal 202 enables the far-field data transmission function for all applications.
[0237] based on Figure 5The software architecture of the first terminal 201 and the second terminal 202 provided in the embodiment of the present application is shown. The embodiment of the present application provides another possible implementation method. When the first terminal 201 and the second terminal 202 are within the near-field communication range, the first terminal 201 and the second terminal 202 establish a near-field communication connection 203, and the first application of the first terminal 201 calls the near-field communication application interface and the second application of the second terminal 202 for data transmission; when the first terminal 201 and the second terminal 202 are not within the near-field communication range, the first terminal 201 and the second terminal 202 establish a far-field communication connection 204, and the first application of the first terminal 201 calls the far-field communication application interface and the second application of the second terminal 202 for data transmission.
[0238] In one possible embodiment, Figure 4 The network architecture shown also includes a third terminal 203, which can be a smart terminal such as VR glasses or vehicle-mounted equipment, and this embodiment of the application is not limited to this. Figure 12 Another network architecture provided by an embodiment of the present application is exemplified. Among them, the first terminal 201 and the third terminal 203 can establish a near field communication connection 206, or a far field communication connection 207, wherein the near field communication connection 206 may include a Bluetooth communication connection or a Wi-Fi direct communication connection, and the far field communication connection 207 may include a Wi-Fi communication connection or a cellular communication connection. When the first terminal 201 and the third terminal 203 are within the near field communication range, the first application in the first terminal 201 completes data transmission with the third application in the third terminal 203 through the near field communication connection 206; when the first terminal 201 and the third terminal 203 are outside the near field communication range, the first application in the first terminal 201 completes data transmission with the third application in the third terminal 203 through the far field communication connection 207. The specific data transmission process is as described in the above embodiment and will not be repeated here. Among them, the first application in the first terminal 201 and the third application in the third terminal 207 are two different versions of the same application.
[0239] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0240] The embodiment of the present application provides a first terminal, such as Figure 13As shown, the first terminal includes one or more processors 1301 and one or more memories 1302. The one or more memories 1302 store one or more computer programs, each of which includes instructions. When the one or more processors 1301 execute these instructions, the technical solution implemented by the first terminal in the above embodiment is executed. The implementation principles and technical effects are similar to those of the above-mentioned method-related embodiments and will not be further described here.
[0241] The embodiment of the present application provides a second terminal, such as Figure 14 As shown, the first terminal includes one or more processors 1401 and one or more memories 1402. The one or more memories 1402 store one or more computer programs, each of which includes instructions. When the one or more processors 1401 execute these instructions, the technical solution implemented by the second terminal in the above embodiment is executed. The implementation principles and technical effects are similar to those of the above method-related embodiments and will not be further described here.
[0242] The present application also provides a data transmission system, comprising a first terminal and a second terminal, wherein the first terminal is configured to execute the method executed by the first terminal in each of the above embodiments, and the second terminal is configured to execute the method executed by the second terminal in each of the above embodiments.
[0243] The present embodiment provides a computer program product that, when executed on a first terminal or a second terminal, causes the first terminal or the second terminal to execute the technical solution of the above embodiment. The implementation principle and technical effects are similar to those of the above method-related embodiments and will not be further described here.
[0244] This embodiment of the present application provides a readable storage medium containing instructions that, when executed on a first terminal or a second terminal, cause the first terminal or the second terminal to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar and will not be further described here.
[0245] The present application provides a chip for executing instructions. When the chip is running, the technical solution of the above embodiment is executed. The implementation principle and technical effect are similar and will not be described here.
[0246] In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0247] In the embodiments of the present application, the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SS), or a volatile memory, such as a random-access memory (RAM). The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, without limitation.
[0248] The memory in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data. The methods provided in the various embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DWD), or a semiconductor medium (e.g., an SSD), etc.
[0249] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein.
[0250] In addition, the various technologies, systems, devices, methods and the technical features described in the above embodiments can be combined to form other modules, methods, devices, systems and technologies that do not deviate from the spirit and principles of the invention. These modules, methods, devices, systems and technologies combined according to the records of the embodiments of the present invention are all within the scope of protection of the present invention.
Claims
1. A method for data transmission, It is characterized in that The method comprises: A first terminal and a second terminal are paired using near field communication, wherein the first terminal has a first application installed, the second terminal has a second application installed, and the first application and the second application are the same application; When the first terminal and the second terminal are within the near field communication range, the first terminal and the second terminal establish a near field communication connection, and the first application of the first terminal uses the near field communication connection to perform data transmission with the second application of the second terminal; When the first terminal and the second terminal are not within the near field communication range, the first terminal and the second terminal establish a far field communication connection, and the first application of the first terminal uses the far field communication connection to perform data transmission with the second application of the second terminal.
2. The method according to claim 1, It is characterized in that The first application and the second application are different versions of the same application.
3. The method according to claim 1 or 2, further comprising: include: The first terminal receives a first operation of a user; In response to the first operation, a function of supporting the first application of the first terminal to use the far field communication connection to perform data transmission with the second application of the second terminal is started.
4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: The first terminal displays a first interface, the first interface includes a selectable list of far-field data transmission applications, and the selectable list includes the first application program.
5. The method according to any one of claims 1 to 4, It is characterized in that After the first terminal and the second terminal establish a far-field communication connection, the method further includes: The first terminal displays a third prompt message, where the third prompt message is used to prompt a user that a far-field data transmission function in the first terminal has taken effect.
6. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: In response to the first operation, the first terminal sends a first message to the second terminal, where the first message is used to instruct the second terminal to start a function that supports the second application of the second terminal to perform far-field data transmission using a far-field communication connection.
7. The method according to claim 6, It is characterized in that The first message further includes an application list, and the application list includes the first application of the first terminal.
8. The method according to claim 6 or 7, It is characterized in that The first terminal sends the first message through the near field communication connection.
9. The method according to any one of claims 1 to 8, It is characterized in that The first terminal includes a first near field communication module, the second terminal includes a second near field communication module, and the first terminal and the second terminal establish a near field communication connection, including: The first near field communication module of the first terminal establishes the near field communication connection with the second near field communication module of the second terminal according to the near field communication address of the second terminal device.
10. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: The first terminal and the second terminal disconnect the near field communication connection in response to the disconnection of the near field communication connection, wherein the first terminal also includes a first switching module and a first far field communication module, and the first switching module instructs the first far field communication module and the second far field communication module of the second terminal to establish the far field communication connection.
11. The method according to claim 10, It is characterized in that The first switching module instructs the first far-field communication module and the second far-field communication module of the second terminal to establish the far-field communication connection, including: The first switching module sends a first communication address to the first far-field communication module, and the first far-field communication module establishes the far-field communication connection according to the first communication address and a second far-field communication module of the second terminal, wherein the first communication address is the far-field communication address of the second terminal.
12. The method according to claim 10, It is characterized in that The method further comprises: In response to disconnecting the near field communication connection, the first switching module notifies the first application that the near field communication connection has been disconnected; In response to the first terminal and the second terminal establishing the far field communication connection, the first switching module notifies the first application that the near field communication connection has been established.
13. The method according to claim 10, It is characterized in that The method further comprises: In response to the disconnection of the near-field communication connection, within a preset time period, when the first terminal and the second terminal successfully establish the far-field communication connection, the first switching module does not notify the first application that the near-field communication connection has been disconnected; when the first terminal and the second terminal fail to successfully establish the far-field communication connection, the second switching module notifies the second application that the near-field communication connection has been disconnected.
14. The method according to any one of claims 1 to 13, It is characterized in that The first terminal includes a first near field communication application program interface, and the first application of the first terminal uses the far field communication connection to perform data transmission with the second application of the second terminal, including: The first application of the first terminal calls the first near field communication application program interface and uses the far field communication connection to perform data transmission with the second application of the second terminal.
15. The method according to any one of claims 1 to 14, It is characterized in that The near-field communication connection includes a Bluetooth communication connection or a Wi-Fi direct communication connection, and the far-field communication connection includes a Wi-Fi communication connection or a cellular communication connection.
16. The method according to claim 1, It is characterized in that When the first terminal and the second terminal are within the near field communication range, the first terminal and the second terminal also establish the far field communication connection, and the first application of the first terminal simultaneously uses the near field communication connection and the far field communication connection to perform data transmission with the second application of the second terminal.
17. The method according to any one of claims 1 to 16, It is characterized in that The first terminal includes a mobile phone or a tablet, and the second terminal includes a smart watch, smart glasses or a smart car machine.
18. The method according to any one of claims 1 to 16, It is characterized in that The first terminal includes a smart watch, smart glasses or a smart car machine, and the second terminal includes a mobile phone or a tablet.
19. A method of data transmission, It is characterized in that The method comprises: The second terminal is paired with the first terminal using near field communication, wherein the first terminal is installed with a first application, the second terminal is installed with a second application, and the first application and the second application are the same application; When the second terminal and the first terminal are within the near field communication range, the second terminal and the first terminal establish a near field communication connection, and the second application of the second terminal uses the near field communication connection to perform data transmission with the first application of the first terminal; When the second terminal and the first terminal are not within the near field communication range, the second terminal and the first terminal establish a far field communication connection, and the second application of the second terminal uses the far field communication connection to perform data transmission with the first application of the first terminal.
20. The method according to claim 19, It is characterized in that The first application and the second application are different versions of the same application.
21. The method according to claim 19 or 20, after the second terminal and the first terminal establish a far-field communication connection, the method further include: The second terminal displays fourth prompt information, where the fourth prompt information is used to prompt the user that the far-field data transmission function in the second terminal has taken effect.
22. The method according to any one of claims 19 to 21, It is characterized in that The method further comprises: The second terminal receives a first message from the first terminal, where the first message is used to instruct the second terminal to start a function that supports the second application of the second terminal to perform far-field data transmission using a far-field communication connection.
23. The method according to claim 22, It is characterized in that In response to receiving the first message, the second terminal displays first prompt information, where the first prompt information is used to prompt a user that the second terminal has enabled a far-field data transmission function.
24. The method according to claim 22 or 23, It is characterized in that The first message further includes an application list, and the application list includes the first application of the first terminal.
25. The method according to any one of claims 22 to 24, It is characterized in that The second terminal receives the first message through the near field communication connection.
26. The method according to any one of claims 19 to 25, It is characterized in that The first terminal includes a first near field communication module, the second terminal includes a second near field communication module, and the second terminal and the first terminal establish a near field communication connection, including: The second near field communication module of the second terminal establishes the near field communication connection with the first near field communication module of the first terminal according to the near field communication address of the first terminal device.
27. The method according to any one of claims 19 to 25, It is characterized in that The second terminal and the first terminal establish a far-field communication connection, including: The second terminal and the first terminal disconnect the near field communication connection in response to the disconnection of the near field communication connection, wherein the second terminal also includes a second switching module and a second far field communication module, and the second switching module instructs the second far field communication module and the first far field communication module of the first terminal to establish the far field communication connection.
28. The method according to claim 27, It is characterized in that The second switching module instructs the second far-field communication module to establish the far-field communication connection with the first far-field communication module of the first terminal, including: The second switching module sends a second communication address to the second far-field communication module, and the second far-field communication module establishes the far-field communication connection according to the second communication address and the first far-field communication module of the first terminal, wherein the second communication address is the far-field communication address of the first terminal.
29. The method according to claim 27, It is characterized in that The method further comprises: In response to disconnecting the near field communication connection, the second switching module notifies the second application that the near field communication connection has been disconnected; In response to the first terminal and the second terminal establishing the far field communication connection, the second switching module notifies the second application that the near field communication connection has been established.
30. The method according to claim 27, It is characterized in that The method further comprises: In response to the disconnection of the near-field communication connection, within a preset time period, when the first terminal and the second terminal successfully establish the far-field communication connection, the second switching module does not notify the second application that the near-field communication connection has been disconnected; when the first terminal and the second terminal fail to successfully establish the far-field communication connection, the second switching module notifies the second application that the near-field communication connection has been disconnected.
31. The method according to any one of claims 19 to 30, It is characterized in that The second terminal includes a second near field communication application program interface, and the second application program of the second terminal uses the far field communication connection to perform data transmission with the first application program of the first terminal, including: The second application of the second terminal calls the second near-field communication application program interface and performs data transmission with the first application of the first terminal through the far-field communication connection.
32. The method according to any one of claims 19 to 31, It is characterized in that The near-field communication connection includes a Bluetooth communication connection or a Wi-Fi direct communication connection, and the far-field communication connection includes a Wi-Fi communication connection or a cellular communication connection.
33. The method according to claim 19, It is characterized in that When the second terminal and the first terminal are within the near field communication range, the second terminal and the first terminal also establish the far field communication connection, and the second application of the second terminal uses the near field communication connection and the far field communication connection at the same time to transmit data with the first application of the first terminal.
34. The method according to any one of claims 19 to 33, It is characterized in that The first terminal includes a mobile phone or a tablet, and the second terminal includes a smart watch, smart glasses or a smart car machine.
35. The method according to any one of claims 19 to 33, It is characterized in that The first terminal includes a smart watch, smart glasses or a smart car machine, and the second terminal includes a mobile phone or a tablet.
36. A data transmission method, the method being applied to a first terminal and a second terminal, in, The first terminal executes the method according to any one of claims 1 to 18, and the second terminal executes the method according to any one of claims 19 to 35.
37. A first terminal, include: One or more processors, one or more memories, the one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, and when the instructions are executed by the one or more processors, the first terminal executes the method as described in any one of claims 1-18.
38. A second terminal, include: One or more processors, one or more memories, the one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, and when the instructions are executed by the one or more processors, the second terminal executes the method as described in any one of claims 19-35.
39. A computer readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 35 is implemented.
40. A chip, It is characterized in that The chip includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 35 is implemented.
41. A data transmission system, comprising a first terminal and a second terminal, in, The first terminal executes the method according to any one of claims 1 to 18, and the second terminal executes the method according to any one of claims 19 to 35.
Citation Information
Patent Citations
Method, device and system of communication of on-board terminal and road side equipment
CN109474911A
Data interaction method, electronic equipment and computer readable storage medium
CN115914983A
Smart automatic communication method and system
US20140153455A1
Data transmission method and related device
WO2022222733A1
Cited By
Device communication method, related apparatus and communication system
WO2025157105A1
