A method, device and medium for transmitting data

By selecting the appropriate Wi-Fi or BT transmission method according to the amount of data, the problem of high power consumption of smart wearable devices when transmitting data is solved, the data transmission with the lowest power consumption is achieved, the life of the device is extended and the user experience is improved.

CN113873626BActive Publication Date: 2024-10-25GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111148507.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-27
Publication Date
2024-10-25
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

When smart wearable devices transmit data, the two communication protocols of Wi-Fi and BT cannot avoid the problem of high power consumption, resulting in shortened device working life and reduced user experience.

Method used

By obtaining the current data volume and the preset data volume, and comparing their relationship to determine the transmission method, if the current data volume is greater than the preset data volume, Wi-Fi transmission is used, and if it is less than the preset data volume, BT transmission is used to ensure that the data is completed under the lowest power consumption. transmission.

Benefits of technology

It effectively reduces the power consumption of wearable devices, extends the working life of the device, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113873626B_ABST
    Figure CN113873626B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and medium for transmitting data, which are applied to the field of communication technology, and obtain the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted by Wi‑Fi transmission mode and BT transmission mode and the power consumption generated is the same; the relationship between the current data volume and the preset data volume is compared to determine the data transmission mode, and the current data is transmitted according to the determined data transmission mode. The preset data volume is determined from the perspective of power consumption, and the power consumption generated by transmitting data by Wi‑Fi transmission mode and BT transmission mode is linearly increased with the data volume, respectively, and the relationship between the data volume and the preset data volume is compared to select a suitable data transmission mode. It solves the problem that no matter which of the above transmission modes is used, data transmission is completed with the lowest power consumption, thereby achieving the purpose of reducing power consumption, extending the working life of wearable devices, and greatly improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, device and medium for transmitting data. Background Art

[0002] With the development of technology, smart wearable devices have become popular in people's daily lives, especially sports watches. They can establish connections and transmit data with electronic products and devices such as mobile phones or tablets through communication protocols such as Wireless-Fidelity (Wi-Fi) and Bluetooth (BT). Wi-Fi transmission is more suitable for transmitting large data, with high transmission rate and high power consumption. BT transmission is more suitable for transmitting small data, with low transmission rate and low power consumption.

[0003] At present, when intelligent wearable devices are connected to electronic products and devices using BT transmission to transmit data, although the power consumption is low, the transmission rate is slow when transmitting large data due to the large amount of data, which prolongs the transmission time and thus increases the power consumption. When using Wi-Fi transmission to transmit data, it can quickly complete the transmission of small data, but it will be overkill overall, and the power consumption is higher than that of BT transmission when transmitting small data. Therefore, both communication protocols cannot avoid the problem of high power consumption when facing different data, which shortens the working life of wearable devices and reduces the user experience.

[0004] Therefore, how to reduce the power consumption of wearable devices is an urgent problem that technicians in this field need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a method, device and medium for transmitting data, thereby reducing power consumption, extending the working life of wearable devices and improving user experience.

[0006] In order to solve the above technical problems, the present invention provides a method for transmitting data, the method comprising:

[0007] Obtaining the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to when the same amount of data is transmitted using the Wi-Fi transmission mode and the BT transmission mode and the power consumption generated is the same;

[0008] Compare the current data volume with the preset data volume to determine the data transmission mode. If the current data volume is greater than the preset data volume, determine that the data transmission mode is the Wi-Fi transmission mode; if the current data volume is less than the preset data volume, determine that the data transmission mode is the BT transmission mode;

[0009] The current data is transmitted according to the determined data transmission mode.

[0010] Preferably, before comparing the relationship between the current data amount and the preset data amount to determine the data transmission mode, the method further includes:

[0011] Establish a BT connection with the terminal device.

[0012] Preferably, transmitting the current data according to the determined Wi-Fi transmission mode includes:

[0013] Determine whether the configuration information of the Wi-Fi transmission mode is successfully obtained through the BT connection;

[0014] If yes, establish a Wi-Fi connection with the terminal device according to the configuration information, disconnect the BT connection with the terminal device, and transmit the current data to the terminal device via the Wi-Fi connection;

[0015] If not, the Wi-Fi transmission mode is switched to the BT transmission mode to transmit the current data.

[0016] Preferably, after transmitting the current data according to the determined Wi-Fi transmission mode, the method further includes:

[0017] Starting from the time when the current data is transmitted via Wi-Fi transmission, it is determined whether the current data transmission is completed within a preset time;

[0018] If not, disconnect the Wi-Fi connection with the terminal device, establish a BT connection with the terminal device, and switch the Wi-Fi transmission mode to the BT transmission mode to transmit the current data.

[0019] Preferably, if the Wi-Fi transmission method is adopted and after the current data is transmitted through the Wi-Fi transmission method, it also includes:

[0020] Disconnect the Wi-Fi connection with the terminal device.

[0021] Preferably, switching the Wi-Fi transmission mode to the BT transmission mode to transmit the current data includes:

[0022] The remaining current data is transmitted via BT transmission.

[0023] Preferably, after transmitting the current data according to the determined data transmission mode, the method further includes:

[0024] When the current data is transmitted according to the determined data transmission mode, a prompt message is played.

[0025] In order to solve the above technical problems, the present invention provides a device for transmitting data, comprising:

[0026] An acquisition module, used to acquire a current data volume and a preset data volume, wherein the preset data volume is a data volume corresponding to when an equal amount of data is transmitted using a Wi-Fi transmission mode and a BT transmission mode and the power consumption generated is the same;

[0027] A determination module, used to compare the current data volume with the preset data volume to determine the data transmission mode, if the current data volume is greater than the preset data volume, the data transmission mode is determined to be the Wi-Fi transmission mode, if the current data volume is less than the preset data volume, the data transmission mode is determined to be the BT transmission mode;

[0028] The transmission module is used to transmit the current data according to the determined data transmission mode.

[0029] In order to solve the above technical problems, the present invention further provides a device for transmitting data, comprising:

[0030] Memory for storing computer programs;

[0031] A processor is used to implement the steps of the above-mentioned method for transmitting data when executing a computer program.

[0032] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method for transmitting data are implemented.

[0033] The present invention provides a method for transmitting data, which obtains the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted using the Wi-Fi transmission mode and the BT transmission mode and the power consumption generated is the same; the relationship between the current data volume and the preset data volume is compared to determine the data transmission mode, and the current data is transmitted according to the determined data transmission mode. The method determines the preset data volume from the perspective of power consumption, and the power consumption generated by transmitting data using the Wi-Fi transmission mode and the BT transmission mode is linearly increasing with the data volume, and the relationship between the data volume and the preset data volume is compared to select a suitable data transmission mode. When the current data volume is less than the preset data volume, the power consumption generated by the Wi-Fi transmission mode is greater than the power consumption generated by the BT transmission mode, so the BT transmission mode is selected to transmit the data; when the current data volume is greater than the preset data volume, the power consumption generated by the BT transmission mode is greater than the power consumption generated by the Wi-Fi transmission mode, so the Wi-Fi transmission mode is selected to transmit the data. This avoids the high power consumption problem when the data volume is greater than the preset data volume when the BT transmission mode is used and when the data volume is less than the preset data volume when the Wi-Fi transmission mode is used. This solves the problem that data transmission is completed with the lowest power consumption regardless of whether the Wi-Fi transmission mode or the BT transmission mode is used, thereby achieving the purpose of reducing power consumption, extending the working life of the wearable device, and greatly improving the user experience.

[0034] In addition, the present invention also provides a device for transmitting data and a computer-readable storage medium, which have the same beneficial effects as the above-mentioned method for transmitting data. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A flow chart of a data transmission method provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram showing the correspondence between power consumption and data volume when transmitting data in a Wi-Fi transmission mode and a BT transmission mode provided in an embodiment of the present invention;

[0038] Figure 3 A flow chart of transmitting data using Wi-Fi transmission provided by an embodiment of the present invention;

[0039] Figure 4 A structural diagram of a data transmission device provided by an embodiment of the present invention;

[0040] Figure 5 A structural diagram of another data transmission device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] The core of the present invention is to provide a method, device and medium for transmitting data, thereby reducing power consumption, extending the working life of wearable devices and improving user experience.

[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0044] It should be noted that the method for transmitting data mentioned in the present invention can be applied to establish a connection function and transmit data between a wearable device and an electronic product device such as a mobile phone or a tablet computer through a communication protocol. The wearable device can be a true wireless stereo (True Wireless Stereo, TWS) headset, a smart watch or smart glasses. Commonly used communication protocols include BT, Wi-Fi, ZigBee and Near Field Communication (NFC), etc. The ZigBee communication protocol is used in a short range and a low transmission data rate. Its network is mainly established for automatic control data transmission and is suitable for smart home systems. The NFC communication protocol has a short transmission distance and a slow transmission rate, so both are not suitable for transmission between wearable devices and terminal devices. Therefore, under normal circumstances, the transmission protocols between wearable devices and electronic product devices are BT and Wi-Fi. The Wi-Fi transmission method is more suitable for transmitting large data, with a high transmission rate and high power consumption. The BT transmission method is more suitable for transmitting small data, and its transmission rate is low and the power consumption is low. Based on this, the method for transmitting data in the present invention only discusses two methods: BT transmission method and Wi-Fi transmission method.

[0045] Figure 1 A flow chart of a data transmission method provided by an embodiment of the present invention, such as Figure 1 As shown, the present invention provides a method for transmitting data, the method comprising:

[0046] S11: obtaining a current data volume and a preset data volume, wherein the preset data volume is a data volume corresponding to when an equal amount of data is transmitted using a Wi-Fi transmission mode and a BT transmission mode and the power consumption generated is the same.

[0047] In a specific embodiment, the current data volume is the amount of data obtained by converting the user's instruction information into data form through the data processing module of the wearable device and then calculating the number of current data, and establishing a connection according to the communication protocol between the wearable device and the terminal device, transmitting the data in the data form converted from the current user instruction to the terminal device, and the terminal device receives the instruction and implements the corresponding function. The terminal device can be a mobile phone or other types of electronic products and devices, which are not specifically limited in the present invention.

[0048] It should be noted that the data volume can be a unit of data capacity, and the smallest unit of data volume is a bit or a byte. It can also refer to the length of the data, which is not specifically limited in the present invention.

[0049] In addition, the preset data volume is the data volume corresponding to the case where the power consumption generated by transmitting data using the Wi-Fi transmission mode and the BT transmission mode is the same. Figure 2A schematic diagram of power consumption and data volume when transmitting data in a Wi-Fi transmission mode and a BT transmission mode provided in an embodiment of the present invention, wherein the power consumption generated by transmitting data in the Wi-Fi transmission mode and the BT transmission mode increases linearly with the data volume, respectively, and the power consumption required for transmitting data in the Wi-Fi transmission mode satisfies:

[0050] W W =D*P W / S W +P0*T0;

[0051] Where D represents the amount of data to be transmitted, P0 is the average power of the Wi-Fi module or Wi-Fi chip from the time it is turned on to the time it is initialized, T0 is the average time it takes for the Wi-Fi module or Wi-Fi chip to be initialized from the time it is turned on, and S W is the transmission rate of Wi-Fi transmission mode, P W The power generated when Wi-Fi transmits data, W W It is the overall power consumption generated by transmitting this segment of data via Wi-Fi transmission.

[0052] The power consumption required for transmitting data using BT transmission method meets the following requirements:

[0053] W B =D*P B / S B +P1*T1;

[0054] Where D represents the amount of data to be transmitted, P1 is the average power of the BT module or BT chip from the time it is turned on to the time it is initialized, T1 is the average time it takes for the BT module or BT chip to be initialized from the time it is turned on to the time it is initialized, and S B is the transmission rate of BT transmission mode, P B The power generated when transmitting data in BT transmission mode, W B It is the overall power consumption generated by transmitting data in BT transmission mode.

[0055] like Figure 2 As shown, when two different data transmission methods transmit the same amount of data and generate the same power consumption, there will be an intersection point, namely D0. The amount of data at this intersection is the preset data amount. The preset data amount can be obtained according to the data transmission rate or the size of the transmitted data. The preset data amount of the present invention is determined from the perspective of power consumption. When commonly used wearable devices are transmitted, only the data size or transmission rate is considered, and the power consumption of the wearable device is not really considered. Although the transmission rate is improved, the power consumption of the wearable device is also increased, the working life of the wearable device is shortened, and the cost problem is also increased for users.

[0056] It is understandable that the Wi-Fi transmission method is to transmit data between the wearable device and the terminal device through the Wi-Fi connection technology. When the wearable device and the terminal device are connected to each other, certain standards and protocols are required to facilitate smooth transmission and communication. The wearable device uses a wireless adapter to convert the data into radio waves and uses an antenna to send data signals. The radio waves are emitted from the antenna and received by the wireless router. The wireless router converts the radio waves into data form and uses the router's hardware equipment to connect the data to the terminal device for transmission. A higher frequency means that there can be more data in the signal, which means that the large data transmission rate is higher, and of course it also means that more power is consumed.

[0057] The BT transmission method is to use the wearable device to search for the terminal device to which data needs to be transmitted, and then initiate pairing to obtain the BT address of the terminal device and the pairing password and other information. After the connection is established, data can be sent and received. The entire BT transmission method is a pairing-connection-transmission process. The transmission distance of the BT transmission method is 2-30M, the rate is 1Mbps, and the power consumption is 10MA, while the Wi-Fi transmission distance is 100-300M, the rate can reach 300Mbps, and the power consumption is 10-50MA. Overall, BT transmission is lower than Wi-Fi transmission in terms of transmission distance, transmission rate and power consumption. When transmitting data between wearable devices and terminal devices, no transmission method can fully meet the requirements of long transmission distance, low power consumption and fast transmission rate. Therefore, on the basis of reducing power consumption, the BT transmission method and the Wi-Fi transmission method are sought to coexist, and suitable transmission methods can be found for different data to transmit data.

[0058] It should be noted that the present invention does not make specific requirements on the number of wearable devices and terminal devices, which can be set according to specific actual conditions.

[0059] In addition, in a specific implementation, the preset amount of data can be pre-stored in the memory, so that when data is transmitted, the data can be quickly acquired, thereby improving the efficiency of data transmission.

[0060] S12: Compare the current data amount with the preset data amount to determine the data transmission mode. If the current data amount is greater than the preset data amount, the data transmission mode is determined to be the Wi-Fi transmission mode. If the current data amount is less than the preset data amount, the data transmission mode is determined to be the BT transmission mode.

[0061] On the basis of the above-mentioned embodiment, the relationship between the current data amount and the preset data amount is compared, and it is determined which transmission mode is used to transmit the data.

[0062] It can be understood that after obtaining the current data volume and the preset data volume, the relationship between the two is compared to determine the method of transmitting data. The power consumption generated by transmitting data by the Wi-Fi transmission method and the BT transmission method increases linearly with the data volume. When the data volume increases, the power consumption generated by transmitting the data by the two transmission methods will also increase accordingly. Figure 2 As shown, when the current data volume is less than the preset data volume, the power consumption generated by the Wi-Fi transmission mode is greater than the power consumption generated by the BT transmission mode, so the transmission mode is determined to be the BT transmission mode; when the current data volume is greater than the preset data volume, the power consumption generated by the BT transmission mode is greater than the power consumption generated by the Wi-Fi transmission mode, so the transmission mode is determined to be the Wi-Fi transmission mode; when the current data volume is the same as the preset data volume, the power consumption generated by the BT transmission mode is the same as the power consumption generated by the Wi-Fi transmission mode, so it is determined that the transmission mode can be the BT transmission mode or the Wi-Fi transmission mode.

[0063] S13: Transmitting current data according to the determined data transmission method.

[0064] It is understandable that when it is determined that the current data transmission mode is Wi-Fi transmission, the data is transmitted according to the Wi-Fi communication protocol; when it is determined that the current data transmission mode is BT transmission, the data is transmitted according to the BT communication protocol.

[0065] It should be noted that data transmission by Wi-Fi and BT cannot be transmitted at the same time. When the current data is transmitted by Wi-Fi transmission, the BT connection needs to be disconnected. When the current data is transmitted by BT transmission, the Wi-Fi connection needs to be disconnected. For the acquisition of current data, the user's instructions are converted into data through the data processing module of the wearable device for transmission. For example, the headset as a wearable device includes a voice acquisition module, a voice signal processor and a voice recognition function module. The voice acquisition module of the headset collects the user's audio information in real time and transmits it to the voice signal processor, which converts the user's audio information into an electrical signal. The converted electrical signal is converted into text information through the voice recognition function module and recognized in the form of data. The recognized text information is transmitted to the terminal device as the current data through the communication protocol, and then the terminal device receives the transmitted data to start the voice recognition function.

[0066] The present invention provides a method for transmitting data, which obtains the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted using the Wi-Fi transmission mode and the BT transmission mode and the power consumption generated is the same; the relationship between the current data volume and the preset data volume is compared to determine the data transmission mode, and the current data is transmitted according to the determined data transmission mode. The method determines the preset data volume from the perspective of power consumption, and the power consumption generated by transmitting data using the Wi-Fi transmission mode and the BT transmission mode is linearly increasing with the data volume, and the relationship between the data volume and the preset data volume is compared to select a suitable data transmission mode. When the current data volume is less than the preset data volume, the power consumption generated by the Wi-Fi transmission mode is greater than the power consumption generated by the BT transmission mode, so the BT transmission mode is selected to transmit the data; when the current data volume is greater than the preset data volume, the power consumption generated by the BT transmission mode is greater than the power consumption generated by the Wi-Fi transmission mode, so the Wi-Fi transmission mode is selected to transmit the data. This avoids the high power consumption problem when the data volume is greater than the preset data volume when the BT transmission mode is used and when the data volume is less than the preset data volume when the Wi-Fi transmission mode is used. This solves the problem that data transmission is completed with the lowest power consumption regardless of whether the Wi-Fi transmission mode or the BT transmission mode is used, thereby achieving the purpose of reducing power consumption, extending the working life of the wearable device, and greatly improving the user experience.

[0067] In order to achieve information exchange and resource sharing, the wearable device and the terminal device mentioned in the above embodiment must have certain standards and protocols to enable the two to communicate with each other and transmit data. For example, for a smart sports watch, the user's sports data needs to be analyzed by the terminal device for sports data parameters, and then the sports data is transmitted to the terminal device for sharing. Therefore, before transmitting data, it is necessary to open the communication protocol to enable the terminal device to pair and connect with the smart sports watch. Therefore, before determining which data transmission method is used, it also includes:

[0068] Establish a BT connection with the terminal device.

[0069] It should be noted that establishing a BT connection with a terminal device is based on the premise that the wearable device and the terminal device are paired. If the two devices are not paired, an authentication relationship cannot be established, and a BT connection cannot be achieved. For the first communication authentication between the two devices, an agreed keyword is established between the devices using a personal identification number (PIN code) to generate an initial authentication code to facilitate the establishment of a BT connection.

[0070] In a BT connection, the master device (the device that initiates the connection, here the wearable device) will page the slave device (the device that receives the connection, here the terminal device). The wearable device uses frequency hopping to page the terminal device. The terminal device will scan for external paging at fixed intervals. When it scans external paging, it will respond to the paging operation. At this time, a link for data transmission is established between the wearable device and the terminal device. The wearable device will initiate a channel connection request. The wearable device uses the Session Description Protocol (SDP) to query the hands-free service of the slave device, from which it obtains the channel number of the Serial Linear Emulation Protocol (RFCOMM). Then the master device will initiate an RFCOMM connection request to establish an RFCOMM connection, and finally establish a BT connection with the terminal device.

[0071] In addition, it can be understood that before comparing the relationship between the current data volume and the preset data volume to determine the data transmission method, a BT connection with the terminal device is first established. A Wi-Fi connection with the terminal device can also be established here, and a BT connection and a Wi-Fi connection with the terminal device can also be established at the same time. If a BT connection is established, the device consumes a certain amount of power when BT is turned on. If a Wi-Fi connection is established, when Wi-Fi is turned on, the power consumption value generated by the device is greater than the power consumption value when BT is turned on. If the BT connection and the WIFI connection are turned on at the same time, it means that when BT and Wi-Fi are turned on, the power consumption generated by the device is more than the former two cases. The purpose of the present invention is to reduce the power consumption of the device, so establishing a BT connection with the terminal device is a preferred embodiment.

[0072] In the present invention, the BT connection can be one-to-one, one wearable device corresponds to one terminal device, or it can be a many-to-one connection, where multiple wearable devices are connected to one terminal device. It should be noted that multiple wearable devices can be paired and connected to one terminal device, but in the process of transmitting data, multiple wearable devices transmit data to the terminal device separately, and data cannot be transmitted at the same time. For example, a headset, a BT speaker and an intelligent sports watch are connected to electronic products such as mobile phones, and the present invention does not make specific limitations. Specifically, after establishing a BT connection with the terminal device, data can be transmitted, such as voice input of the wearable device or activation of sports data, and then it is determined whether the currently received data needs to be transmitted. If so, it is necessary to obtain the data volume of the current data, and then compare the data volume of the data with the preset data volume. The relationship between the data volume and the preset data volume determines the selection of a suitable transmission method to transmit it to the terminal device. If not, continue to judge until the received data is sufficient to meet the conditions of the data transmission request, and then step S12 can be performed.

[0073] As mentioned above, when the current data volume is the same as the preset data volume, the power consumption generated by the BT transmission mode is the same as the power consumption generated by the Wi-Fi transmission mode. Considering that a BT connection has been established with the terminal device, it is preferred to determine that the transmission mode can be the BT transmission mode, thereby avoiding the process of obtaining Wi-Fi configuration information, etc., and further improving the efficiency of data transmission.

[0074] The establishment of a BT connection with a terminal device provided in this embodiment can reduce the power consumption of the wearable device, extend the working life of the wearable device, improve the user experience, and save the user's costs compared to establishing other communication connections.

[0075] In the above embodiment, when the current data volume is greater than the preset data volume, after determining that the data transmission mode is the Wi-Fi transmission mode, the current data is transmitted according to the determined Wi-Fi transmission mode. Figure 3 A flow chart of transmitting data using Wi-Fi transmission is provided in an embodiment of the present invention, such as Figure 3 As shown, specifically including:

[0076] S31: Determine whether the configuration information of the Wi-Fi transmission mode is successfully obtained through the BT connection; if so, proceed to step S32, if not, proceed to step S33.

[0077] On the basis of the above embodiment, a BT connection is established with the terminal device, and then the configuration information of the Wi-Fi transmission mode is obtained through the BT connection. In order to smoothly transmit the current data to the terminal device, it is determined whether the configuration information of the Wi-Fi transmission mode can be successfully obtained through the BT connection. The configuration information of the Wi-Fi transmission mode includes security protocols, key management schemes, group management passwords, etc. To obtain the configuration information, it is necessary to obtain the application programming interface (API) for managing all aspects of the Wi-Fi connection, obtain access point information, determine the WIFI switch status, and then obtain the Wi-Fi configuration information, determine the encryption type and configure it respectively.

[0078] Regarding how to successfully obtain the configuration information of the Wi-Fi connection, a verification success module can be set up. The module contains a start character and an end character, converts the currently transmitted data into hexadecimal data, specifies the start character, the end character and the data length, for example, the start character is hexadecimal data 0x68, and the end character is hexadecimal data 0x43. When the current data is verified, it is necessary to determine whether the start character is useful information of the currently transmitted data. If so, enter the verification acquisition program. According to the calculation of the data length and the data domain, the end of the current data is 0x43, which means that the configuration information of the Wi-Fi connection is successfully obtained through the BT connection.

[0079] In addition, the method for determining how to successfully obtain the configuration information of the Wi-Fi connection can also be a parity check, and can also be specifically set according to the Wi-Fi module or according to the data size and type. The present invention does not require this, as long as the Wi-Fi configuration information can be successfully obtained through the BT connection. This embodiment mentions obtaining the configuration information of the Wi-Fi transmission mode through the BT connection. If it is an established Wi-Fi connection, the configuration information of the BT transmission mode can be obtained through the Wi-Fi connection. If both Wi-Fi and BT have established a connection relationship with the terminal device, it is necessary to determine the specific transmission mode of the current data transmission mode, determine the current transmission mode and establish a corresponding communication connection, and then it is necessary to close the other communication connection.

[0080] S32: Establish a Wi-Fi connection with the terminal device according to the configuration information, disconnect the BT connection with the terminal device, and transmit the current data to the terminal device via the Wi-Fi connection.

[0081] On the basis of the above embodiment, after the configuration information of the Wi-Fi transmission mode is successfully obtained through the BT connection, the wireless access point (AP) information is obtained according to the configuration information, such as the security protocol, the key management scheme, the group management password, etc., and the received AP information is decrypted using the key, and then a suitable wireless AP is found and connected. After the Wi-Fi four-way handshake, the key exchange is successfully completed and the Wi-Fi connection with the terminal device is established.

[0082] It should be noted that data cannot be transmitted at the same time using the Wi-Fi and BT transmission modes. When the current data is transmitted using the Wi-Fi transmission mode, the BT connection needs to be disconnected. When the current data is transmitted using the BT transmission mode, the Wi-Fi connection needs to be disconnected. If the two connection modes work at the same time and transmit data, and the communication frequency of the BT connection is within the frequency band of the Wi-Fi connection, a frequency conflict will occur, and even signal blocking will occur. For example, if the current wearable device is a headset, and if it is currently determined that the transmission connection of the headset is a Wi-Fi connection, and the BT connection is also established and transmitting at the same time, when the user communicates with other users through the headset, the voice information transmitted to the terminal device may cause noise interference and blocking interference, resulting in low call quality and serious impact on the user experience. Therefore, after successfully establishing the Wi-Fi connection, it is necessary to disconnect the BT connection between the wearable device and the terminal device.

[0083] The Wi-Fi transmission method is to transmit data between the wearable device and the terminal device through a Wi-Fi connection. After the Wi-Fi connection is established, the current data is transmitted to the terminal device through the Wi-Fi connection.

[0084] S33: Switch the Wi-Fi transmission mode to the BT transmission mode to transmit the current data.

[0085] When the configuration information of the Wi-Fi transmission mode is not successfully obtained through the BT connection, it is impossible to establish a Wi-Fi connection with the terminal device to transmit the current data. Since it has been determined that the current transmission mode is the Wi-Fi transmission mode, it is necessary to switch the Wi-Fi transmission mode to the BT transmission mode to complete the transmission of the current data. The current data is transmitted according to the BT transmission mode until the transmission of the current data is completed. It should be noted that the Wi-Fi transmission mode is determined on the premise that the current data volume is greater than the preset data volume. Since the configuration information of the Wi-Fi transmission mode is not successfully obtained through the BT connection, the BT transmission mode is switched, which may cause the power consumption generated by BT transmitting the current data to be higher than the power consumption generated by Wi-Fi transmitting the current data, but it can ensure the completion of the transmission of the data, avoiding the adverse effects caused by the failure of the current data to be transmitted, causing congestion of other data and inability to continue to judge and transmit, affecting the transmission process.

[0086] This embodiment provides a method for determining whether the configuration information of the Wi-Fi transmission mode is successfully obtained through the BT connection. If so, a Wi-Fi connection is established with the terminal device according to the configuration information, the BT connection with the terminal device is disconnected, and the current data is transmitted to the terminal device through the Wi-Fi connection. If not, the Wi-Fi transmission mode is switched to the BT transmission mode to transmit the current data. When the Wi-Fi configuration information is successfully obtained, it is necessary to establish a Wi-Fi connection and disconnect the BT connection at the same time to prevent the two connection protocols from interfering with each other and causing the user experience effect, and then transmit it to the terminal device through the Wi-Fi connection. If not, the current data is switched to the BT transmission mode to transmit the current data, which can complete the data transmission in time, avoid the impact caused by the current data not being transmitted, which causes congestion of other data and cannot continue to be judged and transmitted, thereby reducing the user experience effect.

[0087] On the basis of the above embodiment, when the current data volume is greater than the preset data volume, the transmission mode is determined to be the Wi-Fi transmission mode, and the current data is transmitted according to the Wi-Fi transmission mode. The size and length of each transmitted data are different. When the data is small, the transmission rate is faster. When the data is large and the data length is longer, the transmission rate is slower, which may cause congestion in the next data transmitted by the Wi-Fi transmission mode, and the Wi-Fi module may be damaged. In order to prevent the above situation from occurring, a preset time is set when transmitting data. After the current data is transmitted according to the determined Wi-Fi transmission mode, Figure 3 Also includes:

[0088] S34: starting from the time when the current data is transmitted via the Wi-Fi transmission mode, determining whether the current data transmission is completed within a preset time, if not, proceeding to step S35.

[0089] When it is determined that the current transmission mode is the Wi-Fi transmission mode, the current data is then transmitted using the Wi-Fi transmission mode. To ensure that the current data can be transmitted smoothly, a preset time is set to determine whether the current data is transmitted within the preset time. If not, proceed to step S35.

[0090] Specifically, the setting of the preset time can be started when it is determined that the current data transmission mode is the Wi-Fi transmission mode, or it can be started after the Wi-Fi connection is established, or it can be started when the BT connection with the terminal device is disconnected. If it is determined that the current transmission mode is the Wi-Fi transmission mode, it is necessary to consider whether the configuration information of the Wi-Fi connection is successfully obtained through the BT connection and the steps of establishing the Wi-Fi connection, so the preset time set is longer, and it is also necessary to consider the transmission time if the acquisition is not successful and the BT connection is switched. Similarly, whether it is the preset time when establishing a Wi-Fi connection or disconnecting a BT connection, it must be longer than the preset time when the current data is transmitted through the Wi-Fi transmission mode. It can be set according to the specific actual situation. The present invention does not make specific requirements, as long as it does not affect the transmission of the current data. The preset time provided by the present invention when the current data is transmitted through the Wi-Fi transmission mode is only a preferred embodiment.

[0091] It should be noted that, usually, the wearable device and the terminal device use BT transmission to transmit data. Only when the amount of current data is greater than the preset amount of data, the current data is transmitted to the terminal device via Wi-Fi transmission. When the current data is transmitted using Wi-Fi transmission, it is possible that the Wi-Fi connection has not been used for a long time, resulting in the inability to complete the transmission of the current data. Therefore, a heartbeat packet can be set to regularly inform the terminal device of the status of data transmission between the wearable device and the terminal device. It is sent at a certain time interval to determine whether the current data transmission status is running normally. If no response is received from the terminal device within the specified time, it is determined that the current transmission status is abnormal and has been disconnected. It is necessary to re-establish the Wi-Fi connection with the terminal device or switch from the current Wi-Fi transmission mode to the BT transmission mode to transmit the current data.

[0092] It is understandable that when the data transmission via Wi-Fi transmission is completed within the preset time, the current data transmission task is terminated, and the judgment and transmission of the next data are not affected.

[0093] S35: disconnect the Wi-Fi connection with the terminal device, establish a BT connection with the terminal device, and switch the Wi-Fi transmission mode to the BT transmission mode to transmit the current data.

[0094] If the current data is not transmitted to the terminal device within the preset time via Wi-Fi transmission, there may be current data congestion or even damage to the Wi-Fi module. In this case, you need to switch the transmission mode to complete the transmission of the current data.

[0095] It can be understood that in the above embodiment, the Wi-Fi connection and the BT connection cannot transmit data at the same time. Therefore, before switching the transmission mode, it is necessary to disconnect the successfully established Wi-Fi connection with the terminal device, and then re-establish the BT connection with the terminal device. At this time, there is no need to compare the relationship between the data volume of the current data and the preset data volume. The current data is directly transmitted through the established BT connection through the BT transmission mode until the current data transmission task is completed.

[0096] This embodiment provides that when the current data is transmitted via Wi-Fi transmission, it is determined whether the current data is transmitted within a preset time. If not, the Wi-Fi connection with the terminal device is disconnected, a BT connection with the terminal device is established, and the Wi-Fi transmission mode is switched to the BT transmission mode to transmit the current data. This ensures that the current data can be transmitted smoothly without affecting the transmission progress of the next data, improves the transmission rate, extends the working life of the wearable device, saves the cost of the wearable device, and improves the user experience.

[0097] Based on the above embodiment, after the current data is transmitted using the Wi-Fi transmission method, Figure 3 Also includes:

[0098] S36: Disconnect the Wi-Fi connection with the terminal device.

[0099] In the above embodiment, before the current data is transmitted by Wi-Fi transmission, the configuration information of the Wi-Fi connection is obtained through the BT connection established with the terminal device, and the Wi-Fi connection with the terminal device is established according to the configuration information. After the current data is successfully transmitted to the terminal device within the preset time, it is necessary to disconnect the Wi-Fi connection in time, that is, disconnect the Wi-Fi connection with the terminal device mentioned in this embodiment. In the above embodiment, it is mentioned that the power consumption generated by transmitting data through Wi-Fi connection is large compared with that generated by transmitting data through BT connection. Therefore, in order to save power consumption, it is necessary to disconnect the Wi-Fi connection in time to reduce the power consumption of the wearable device itself. Of course, if other data continues to be transmitted, it is necessary to compare the relationship between the data volume of other data and the preset data volume and then select the appropriate transmission method. Regardless of whether the BT transmission method or the Wi-Fi transmission method is selected, it is necessary to re-establish the BT connection or Wi-Fi connection corresponding to the terminal device.

[0100] It should be noted that disconnecting the Wi-Fi connection does not mean turning off the Wi-Fi module. The power consumption generated by turning on and off the Wi-Fi module of the wearable device is much greater than the power consumption generated by transmitting data through the Wi-Fi connection. If the Wi-Fi module is turned off after transmitting data once, when the amount of the next data is greater than the preset data amount, the Wi-Fi module needs to be turned on again. Repeated turning on and off will greatly increase the power consumption of the wearable device, which is contrary to the problem that the present invention is intended to solve.

[0101] The disconnection of the Wi-Fi connection with the terminal device mentioned in this embodiment means promptly stopping the power consumption generated by the Wi-Fi connection to avoid increasing the power consumption of the wearable device, thereby achieving the purpose of reducing the power consumption of the wearable device.

[0102] In the above embodiment, it is mentioned that from the time when the current data is transmitted via the Wi-Fi transmission mode, it is determined whether the current data transmission is completed within the preset time. If not, the Wi-Fi connection with the terminal device is disconnected, a BT connection with the terminal device is established, and the Wi-Fi transmission mode is switched to the BT transmission mode to transmit the current data. Therefore, the switching of the Wi-Fi transmission mode to the BT transmission mode to transmit the current data in step S35 specifically includes:

[0103] The remaining current data is transmitted via BT transmission.

[0104] When the current data is transmitted via Wi-Fi transmission, if the transmission is not completed within the preset time, the transmission progress of the current data at this time includes two, one is the transmitted data transmitted to the terminal device via Wi-Fi transmission, and the other is the remaining data that has not been transmitted to the terminal device due to data congestion or damage to the Wi-Fi module.

[0105] The current data cannot be transmitted within the preset time. In order to achieve the purpose of transmitting the current data, it is necessary to switch the current transmission mode to the BT transmission mode. When transmitting data through the BT transmission mode, all the current data can be transmitted, or the remaining part of the current data can be transmitted. The transmission of the remaining part of the current data mentioned in the present invention is a preferred embodiment. If all the data is transmitted through the BT transmission mode, it is necessary to re-establish the BT connection with the terminal device. It should be noted that the amount of current data is greater than the preset data amount and is suitable for the Wi-Fi transmission mode. Since the Wi-Fi transmission mode cannot transmit the current data within the preset time, it is necessary to select the BT transmission mode for transmission. In the above embodiment, it is mentioned that when the BT transmission mode transmits large data, the transmission rate is slow and the power consumption is large. Therefore, if the entire current data is transmitted, greater power consumption is generated. If the remaining data is transmitted through the BT connection mode, the power consumption generated is less than that of transmitting all the data through the BT connection.

[0106] It should be noted that when the remaining data is transmitted via BT, a portion of the data that has been transmitted via Wi-Fi can be temporarily stored in the data storage module of the terminal device to wait for the remaining data to be transmitted and then decapsulated.

[0107] The present embodiment mentions transmitting the remaining current data via BT transmission, which solves the problem that the Wi-Fi connection in the wearable device cannot completely transmit the current data. The remaining current data is transmitted via BT transmission, which avoids generating large power consumption. At the same time, the transmission rate is improved compared to transmitting all the current data via BT transmission.

[0108] On the basis of the above embodiment, when the Wi-Fi transmission mode is determined, the current data needs to be transmitted according to the Wi-Fi transmission mode; when the BT transmission mode is determined, the current data needs to be transmitted according to the BT transmission mode; after the current data is transmitted according to the corresponding transmission mode, the following further includes:

[0109] When the current data is transmitted according to the determined data transmission mode, a prompt message is played.

[0110] Specifically, the prompt information is played to remind the user that the current data has been successfully transmitted to the terminal device, and other data instructions can be transmitted. For example, in the earphone of a wearable device, when the user is inputting voice through the earphone, the voice information is converted into data by the voice processing module of the earphone and transmitted to the terminal device, the relationship between the data volume of the current data and the preset amount is compared according to an embodiment of the present invention. If it is greater than the preset data volume, the Wi-Fi transmission method is selected to transmit the data. If it is less than the preset data volume, the BT transmission method is selected to transmit the data. In the process of transmitting data, the user's voice information is composed of multiple data, and the data volume of each voice information is different. During the transmission of the data of the current voice information, it is possible that data is piled up and not transmitted. The data accumulation will be stored in the local library of the earphone, resulting in excessive memory of the earphone affecting the transmission effect, and even damaging the Wi-Fi module, and thus cannot be transmitted to the terminal device in time. Therefore, when the current data is successfully transmitted, it is necessary to remind the user that the current data transmission is over, and the next instruction information can be input and transmitted.

[0111] It should be noted that the prompt information may be of various types, such as controlling the vibration module to vibrate, or displaying the end of transmission on the display interface, etc. This embodiment does not make specific requirements.

[0112] This embodiment provides a reminder for the user that the current data transmission has ended, that is, to remind the user that other instructions can be executed for transmission, thereby avoiding data accumulation caused by the user inputting a lot of information at one time and converting it into data, which affects the transmission effect, thereby improving the user experience and extending the working life of the wearable device.

[0113] The above detailed descriptions of various embodiments corresponding to the data transmission method are based on which the present invention further discloses a data transmission device corresponding to the above method. Figure 4 FIG. 1 is a structural diagram of a data transmission device provided by an embodiment of the present invention. Figure 4 As shown, the data transmission device includes:

[0114] The acquisition module 11 is used to acquire the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to when the same amount of data is transmitted by using the Wi-Fi transmission mode and the BT transmission mode and the power consumption generated is the same;

[0115] A determination module 12 is used to compare the current data volume with the preset data volume to determine the data transmission mode. If the current data volume is greater than the preset data volume, the data transmission mode is determined to be the Wi-Fi transmission mode. If the current data volume is less than the preset data volume, the data transmission mode is determined to be the BT transmission mode.

[0116] The transmission module 13 is used to transmit the current data according to the determined data transmission mode.

[0117] Since the embodiments of the device part correspond to the above embodiments, please refer to the description of the embodiments of the method part for the embodiments of the device part, and will not be repeated here.

[0118] The present invention provides a data transmission device, which obtains the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted using the Wi-Fi transmission mode and the BT transmission mode and the power consumption generated is the same; the relationship between the current data volume and the preset data volume is compared to determine the data transmission mode, and the current data is transmitted according to the determined data transmission mode. The device determines the preset data volume from the perspective of power consumption, and the power consumption generated by transmitting data using the Wi-Fi transmission mode and the BT transmission mode is linearly increasing with the data volume, and compares the relationship between the data volume and the preset data volume to select a suitable data transmission mode. When the current data volume is less than the preset data volume, the power consumption generated by the Wi-Fi transmission mode is greater than the power consumption generated by the BT transmission mode, so the BT transmission mode is selected to transmit the data; when the current data volume is greater than the preset data volume, the power consumption generated by the BT transmission mode is greater than the power consumption generated by the Wi-Fi transmission mode, so the Wi-Fi transmission mode is selected to transmit the data. This avoids the high power consumption problem when the data volume is greater than the preset data volume when the BT transmission mode is used and when the data volume is less than the preset data volume when the Wi-Fi transmission mode is used. This solves the problem that data transmission is completed with the lowest power consumption regardless of whether the Wi-Fi transmission mode or the BT transmission mode is used, thereby achieving the purpose of reducing power consumption, extending the working life of the wearable device, and greatly improving the user experience.

[0119] Please refer to Figure 5 A structural diagram of another data transmission device provided by an embodiment of the present invention, such as Figure 5 As shown, the device comprises:

[0120] A memory 21, used for storing computer programs;

[0121] The processor 22 is used to implement the steps of the data transmission method when executing the computer program.

[0122] The data transmission device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0123] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0124] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the data transmission method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 21 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to data involved in the data transmission method, etc.

[0125] In some embodiments, the data transmission device may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a power supply 26 , and a communication bus 27 .

[0126] Those skilled in the art can understand that Figure 5 A structural diagram of another data transmission device provided in an embodiment of the present invention. Figure 5 The structure shown in the figure does not constitute a limitation on the data transmission device, and may include more or less components than those shown in the figure.

[0127] The processor 22 implements the data transmission method provided by any of the above embodiments by calling the instructions stored in the memory 21.

[0128] The present invention provides a data transmission device, which obtains the current data volume and the preset data volume, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted using the Wi-Fi transmission mode and the BT transmission mode and the power consumption generated is the same; the relationship between the current data volume and the preset data volume is compared to determine the data transmission mode, and the current data is transmitted according to the determined data transmission mode. The device determines the preset data volume from the perspective of power consumption, and the power consumption generated by transmitting data using the Wi-Fi transmission mode and the BT transmission mode is linearly increasing with the data volume, and compares the relationship between the data volume and the preset data volume to select a suitable data transmission mode. When the current data volume is less than the preset data volume, the power consumption generated by the Wi-Fi transmission mode is greater than the power consumption generated by the BT transmission mode, so the BT transmission mode is selected to transmit the data; when the current data volume is greater than the preset data volume, the power consumption generated by the BT transmission mode is greater than the power consumption generated by the Wi-Fi transmission mode, so the Wi-Fi transmission mode is selected to transmit the data. This avoids the high power consumption problem when the data volume is greater than the preset data volume when the BT transmission mode is used and when the data volume is less than the preset data volume when the Wi-Fi transmission mode is used. This solves the problem that data transmission is completed with the lowest power consumption regardless of whether the Wi-Fi transmission mode or the BT transmission mode is used, thereby achieving the purpose of reducing power consumption, extending the working life of the wearable device, and greatly improving the user experience.

[0129] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor 22, the steps of the above-mentioned data transmission method are implemented.

[0130] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0131] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the above method for transmitting data.

[0132] The above is a detailed introduction to a method, device and medium for transmitting data provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

[0133] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for transmitting data, characterized in that: Applied to wearable devices, including: After establishing a BT connection, the current data volume and the preset data volume are obtained, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted by Wi-Fi transmission and by BT transmission and the power consumption generated is the same; wherein the preset data volume is pre-stored in the memory; in the BT connection, the wearable device pages the terminal device, and the wearable device pages the terminal device in a frequency hopping manner. The terminal device scans for external paging at fixed intervals, and responds to the paging operation when an external paging is scanned; Compare the relationship between the current data amount and the preset data amount to determine the data transmission mode, if the current data amount is greater than the preset data amount, determine that the data transmission mode is the Wi-Fi transmission mode, if the current data amount is less than the preset data amount, determine that the data transmission mode is the BT transmission mode; Transmitting current data according to the determined data transmission mode; After transmitting the current data according to the determined Wi-Fi transmission mode, the method further includes: Starting from the time when the current data is transmitted through the Wi-Fi transmission method, determining whether the current data is transmitted within a preset time; If not, disconnect the Wi-Fi connection with the terminal device, establish the BT connection with the terminal device, and switch the Wi-Fi transmission mode to the BT transmission mode to transmit the current data; Among them, a heartbeat packet is set to periodically inform the terminal device of the data transmission status between the wearable device and the terminal device. If no response is received from the terminal device within the specified time, it is determined that the current transmission status is abnormal, and the Wi-Fi connection with the terminal device is re-established or the current Wi-Fi transmission mode is switched to BT transmission mode to transmit the current data; If the Wi-Fi transmission method is adopted and after the current data is transmitted through the Wi-Fi transmission method, the method further includes: disconnecting the Wi-Fi connection with the terminal device; The switching of the Wi-Fi transmission mode to the BT transmission mode to transmit the current data includes: transmitting the remaining part of the current data through the BT transmission mode; wherein a part of the data transmitted through the Wi-Fi transmission mode is temporarily stored in a data storage module of the terminal device so as to wait for the remaining part of the data to be transmitted and then decapsulated; Before comparing the relationship between the current data amount and the preset data amount to determine the data transmission mode, the method further includes: Establish a BT connection with the terminal device; Transmitting the current data according to the determined Wi-Fi transmission mode includes: Determining whether the configuration information of the Wi-Fi transmission mode is successfully acquired through the BT connection; If so, establishing a Wi-Fi connection with the terminal device according to the configuration information, disconnecting the BT connection with the terminal device, and transmitting the current data to the terminal device via the Wi-Fi connection; If not, switching the Wi-Fi transmission mode to the BT transmission mode to transmit the current data; After the current data is transmitted according to the determined data transmission mode, the method further includes: When the current data is completely transmitted according to the determined data transmission mode, a prompt message is played.

2. A device for transmitting data, characterized in that: Applied to wearable devices, including: An acquisition module is used to acquire the current data volume and the preset data volume after establishing a BT connection, wherein the preset data volume is the data volume corresponding to the case where the same amount of data is transmitted by Wi-Fi transmission and by BT transmission and the power consumption generated is the same; wherein the preset data volume is pre-stored in the memory; in the BT connection, the wearable device pages the terminal device, the wearable device pages the terminal device in a frequency hopping manner, the terminal device scans for external paging at fixed intervals, and responds to the paging operation when an external paging is scanned; a determination module, configured to compare the current data amount with the preset data amount to determine a data transmission mode, and if the current data amount is greater than the preset data amount, determine that the data transmission mode is the Wi-Fi transmission mode; if the current data amount is less than the preset data amount, determine that the data transmission mode is the BT transmission mode; After transmitting the current data according to the determined Wi-Fi transmission mode, the method further includes: Starting from the time when the current data is transmitted through the Wi-Fi transmission method, determining whether the current data is transmitted within a preset time; If not, disconnect the Wi-Fi connection with the terminal device, establish the BT connection with the terminal device, and switch the Wi-Fi transmission mode to the BT transmission mode to transmit the current data; Among them, a heartbeat packet is set to periodically inform the terminal device of the data transmission status between the wearable device and the terminal device. If no response is received from the terminal device within the specified time, it is determined that the current transmission status is abnormal, and the Wi-Fi connection with the terminal device is re-established or the current Wi-Fi transmission mode is switched to BT transmission mode to transmit the current data; A transmission module, used for transmitting current data according to the determined data transmission mode; If the Wi-Fi transmission method is adopted and after the current data is transmitted through the Wi-Fi transmission method, it also includes: disconnecting the Wi-Fi connection between the terminal device; wherein a portion of the data transmitted through the Wi-Fi transmission method is temporarily stored in a storage data module of the terminal device in order to wait for the remaining data to be transmitted and decapsulated together.

3. A device for transmitting data, characterized in that: Applied to wearable devices, including: Memory for storing computer programs; A processor, configured to implement the steps of the method for transmitting data as claimed in claim 1 when executing the computer program.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for transmitting data according to claim 1 are implemented.