Data transmission method, device and program product
By transmitting TCP heartbeat packets and Bluetooth connection requests between the smart end and the device end, the problem that the smart end cannot know the update status of the data on the device end in time is solved, and the smart end can obtain the update data in a timely and reliable manner.
Patent Information
- Application Number
- CN202510519088.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-24
AI Technical Summary
The smart end may not be able to know the data update status of the device side in time, resulting in the smart end being unable to obtain the updated data in time and reliably.
By transmitting a TCP heartbeat packet based on the Wi-Fi link between the intelligent terminal and the device terminal, the device terminal sends data update instructions through the TCP connection determined by the TCP heartbeat packet when it detects the data to be sent. After receiving the instruction, the intelligent terminal actively sends a Bluetooth connection request to establish a Bluetooth connection for data transmission.
Ensure that the intelligent end can promptly know that the data to be sent needs to be obtained, reduce the chance that the intelligent end will not respond in time, and improve the reliability of the intelligent end to obtain data.
Smart Images

Figure CN120050804A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission, and in particular to a data transmission method, device and program product. Background Art
[0002] Bluetooth Low Energy (BLE) has extremely low power consumption and faster transmission speed, but the amount of data transmitted is small. It is often used in various smart electronic products that have high requirements for battery life and only need to transmit small amounts of data, such as smart wearable devices, smart homes, sensors, etc., and has a wide range of application scenarios. For example, in the industrial field and smart homes, low-power Bluetooth is usually used for data transmission to improve the battery life of the device.
[0003] However, in actual use, if the data on the device side is updated, the smart side may not be able to know the status in time. Although the device side, as a slave, can actively send "notifications" or "instructions" to the host through Bluetooth Low Energy (BLE), if the host does not respond in time, the slave will often be blocked, resulting in the failure to send data related to the host's key request instructions, which is not conducive to the smart side to obtain updated data in a timely and reliable manner. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a data transmission method, device and storage medium to solve the problem in the prior art that the smart terminal may not be able to promptly know that the data on the device side has been updated, which is not conducive to the smart terminal obtaining updated data in a timely and reliable manner.
[0005] A first aspect of an embodiment of the present application provides a data transmission method, the method comprising: TCP heartbeat packets based on Wi-Fi links are transmitted between the smart terminal and the device; The smart terminal receives the data update instruction sent by the device terminal through the TCP connection determined by the TCP heartbeat packet, and the data update instruction is generated when the device terminal detects data to be sent; According to the data update instruction, the smart terminal sends a Bluetooth connection request to the device terminal that has completed Bluetooth pairing with the smart terminal; The smart end receives the request response from the device end and establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection.
[0006] In combination with the first aspect, in a first possible implementation manner of the first aspect, the smart terminal receives the data update instruction sent by the device terminal through the TCP connection determined by the TCP heartbeat packet, including: The intelligent terminal determines the connection status between the intelligent terminal and the device terminal through the TCP heartbeat packet; Based on the device states of the smart terminal and the device terminal, the smart terminal, which serves as a TCP client, receives a data update instruction sent by the device terminal, which serves as a TCP server terminal.
[0007] In combination with the first aspect, in a second possible implementation manner of the first aspect, according to the data update instruction, the smart end sends a Bluetooth connection request to the device end that has completed Bluetooth pairing with the smart end, including: According to the data update instruction, the smart terminal as the Bluetooth host searches for the Bluetooth connection information of the paired device terminal as the Bluetooth slave; According to the Bluetooth connection information, the smart end sends a Bluetooth connection request to the device end.
[0008] In combination with any one of the first aspect to the second implementation manner of the first aspect, in a third possible implementation manner of the first aspect, after the smart end receives the request response of the device end and establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection, the method further includes: After the data to be sent is sent, the Bluetooth connection is closed.
[0009] In combination with any one of the first aspect to the second implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, after the smart end receives the request response of the device end and establishes a Bluetooth connection according to the request response, the method further includes: The intelligent end stops the transmission of TCP heartbeat packets with the device end, or the intelligent end reduces the frequency of TCP heartbeat packet transmission with the device end; After the data transmission to be sent is completed, the method further includes: The intelligent end resumes the transmission of TCP heartbeat packets between the intelligent end and the device end, or the intelligent end increases the transmission frequency of TCP heartbeat packets between the intelligent end and the device end.
[0010] A second aspect of an embodiment of the present application provides a data transmission method, the method comprising: The device terminal and the intelligent terminal transmit a TCP heartbeat packet based on a Wi-Fi link; When the device detects data to be sent, the device sends a data update instruction through the TCP connection determined by the TCP heartbeat packet; The device receives the Bluetooth connection request sent by the smart terminal, and sends a request response to the smart terminal according to the Bluetooth request; The device side establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection.
[0011] In combination with the second aspect, in a first possible implementation manner of the second aspect, transmitting a TCP heartbeat packet based on a Wi-Fi link between the device end and the smart end includes: The device side obtains the detection data of the device side; The device side determines the data interval to which the detection data of the device side belongs; According to the correspondence between the preset data interval and the sending frequency of the TCP heartbeat packet, the device end determines the sending frequency of the TCP heartbeat packet between the smart end and the device end; According to the determined sending frequency of the TCP heartbeat packet, the device end transmits the TCP heartbeat packet based on the Wi-Fi link to the smart end.
[0012] In combination with the second aspect, in a second possible implementation manner of the second aspect, transmitting a TCP heartbeat packet based on a Wi-Fi link between the device end and the smart end includes: The device side obtains the detection data of the device side; The device determines a change trend of the detection data; Determine the detection data of a predetermined period in the future according to the trend, and the device end determines the frequency of sending TCP heartbeat packets between the smart end and the device end according to the detection data of the predetermined period in the future; According to the determined sending frequency of the TCP heartbeat packet, the device end transmits the TCP heartbeat packet based on the Wi-Fi link to the smart end.
[0013] A third aspect of an embodiment of the present application provides a data transmission device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data transmission device implements a method as described in any one of the first aspect or the second aspect.
[0014] A fourth aspect of the embodiments of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method in the first aspect, the second aspect or each of their implementations.
[0015] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspect or the second aspect are implemented.
[0016] The sixth aspect of the embodiment of the present application provides a chip for implementing the methods in each implementation of the first aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the method in the first aspect or its implementation.
[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application transmit TCP heartbeat packets based on the Wi-Fi link in advance between the smart terminal and the device terminal. When the device terminal detects data to be sent and determines the TCP connection through the TCP heartbeat packet, the device terminal sends a data update instruction to the smart terminal, so that the smart terminal can promptly know that it needs to obtain the data to be sent. The smart terminal sends a Bluetooth connection request to the paired device terminal according to the data update instruction, and establishes a Bluetooth link for data transmission based on the Bluetooth connection request. By actively sending the Bluetooth connection request by the smart terminal, the probability of blocking the device terminal due to the untimely response of the smart terminal can be reduced, which is conducive to improving the reliability of data acquisition by the smart terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 It is a schematic diagram of an implementation scenario of a data transmission method provided in an embodiment of the present application; Figure 2 It is a schematic diagram of an implementation flow of a data transmission method provided in an embodiment of the present application; Figure 3 It is a schematic diagram of an implementation flow of a method for transmitting a TCP heartbeat packet provided in an embodiment of the present application; Figure 4 It is a schematic diagram of an implementation flow of a method for transmitting a TCP heartbeat packet provided in an embodiment of the present application; Figure 5 is a schematic diagram of a data transmission device provided in an embodiment of the present application; Figure 6 It is a schematic diagram of a data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0021] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0022] Bluetooth Low Energy (BLE) is known for its extremely low energy consumption, fast transmission rate and small data transmission volume. This technology is widely used in smart devices that have high battery life requirements and low data transmission requirements, such as smart watches, smart home devices and various sensors. Its application range is very wide. For example, in the fields of industrial automation and smart home, low-power Bluetooth is often used to transmit data to extend the use time of the device.
[0023] However, in actual operation, if the data on the device side is updated, the smart side may not be able to quickly detect the change. Although the slave device can actively report data updates by sending "notifications" or "indications" to the host through BLE technology, if the host fails to respond in time, it may cause the slave to be blocked, which in turn affects the host's ability to send key request instructions and data, which is not conducive to the smart side quickly and reliably receiving the latest data updates.
[0024] Based on the above problems, the present application embodiment proposes a data transmission method, such as Figure 1 The diagram shows an implementation scenario of the data transmission method, which includes an intelligent terminal 1 and a device terminal 2, wherein the device terminal 2 can generate data to be transmitted. For example, the device terminal 2 can be an inverter or other equipment. The data to be transmitted generated in the device terminal 2 can be data in an abnormal operating state. For example, the device terminal 2 can include a sensor device 21, including a temperature sensor, a smoke sensor, etc. The device terminal 2 analyzes the data collected by the sensor device 21 to determine whether the collected data is data in an abnormal operating state. If the collected data is data in an abnormal operating state, the data is determined as data to be sent. The intelligent terminal can be a smart device such as a smart phone or a tablet computer.
[0025] Device 2 and smart terminal 1 can establish a dual-channel connection, including a Bluetooth connection and a TCP (Transmission Control Protocol) connection based on Wi-Fi. When device 2 is in normal operation, the Bluetooth connection between smart terminal 1 and device 2 is disconnected, and TCP heartbeat packets are transmitted between smart terminal 1 and device 2, that is, the connection between smart terminal 1 and device 2 is kept alive by sending and receiving TCP heartbeat packets. Since the data volume of TCP heartbeat packets is extremely low, the power consumption is very small.
[0026] When the device 2 is in an abnormal operation state, the device 2 sends a data update instruction through a TCP connection. After receiving the data update instruction, the smart terminal 1 sends a Bluetooth connection request to the device 2. After receiving the Bluetooth connection request, the device 2 sends a request response to the smart terminal 1. After receiving the request response, the smart terminal 1 establishes a connection based on the request response and transmits the data to be sent through a low-power Bluetooth connection link. By sending a data update instruction from the device 2 to the smart terminal 1, the smart terminal 1 can promptly know that it needs to obtain the data to be sent. By actively sending a Bluetooth connection request by the smart terminal 1, the probability of blocking the device 2 due to the untimely response of the smart terminal 1 can be reduced, which is conducive to improving the reliability of the smart terminal 1 in obtaining data.
[0027] Figure 2 A schematic diagram of a data transmission implementation flow provided in an embodiment of the present application is described in detail as follows: In S201, a TCP heartbeat packet based on a Wi-Fi link is transmitted between the smart terminal and the device terminal.
[0028] The TCP heartbeat packet in the embodiment of the present application is a heartbeat packet based on TCP for keeping alive that is transmitted between the intelligent terminal and the device terminal. The TCP heartbeat packet may include information such as a heartbeat identifier and a sending time, or may also include information such as a sending interval. The intelligent terminal may determine that the received data is a TCP heartbeat packet for keeping alive a TCP link based on the heartbeat identifier included in the received TCP heartbeat packet. According to the timestamp of the sending time, the link quality of the TCP link, i.e., the transmission delay of the TCP data, is determined.
[0029] TCP connection over Wi-Fi link means using Wi-Fi wireless communication technology to establish and maintain TCP (Transmission Control Protocol) connection. TCP is a connection-oriented, reliable, byte stream-based transport layer communication protocol, while Wi-Fi (Wireless Fidelity) is a wireless local area network technology that allows electronic devices to connect to the Internet or communicate with each other through wireless signals. The power consumption of Wi-Fi connection is positively correlated with the amount of data transmitted. The larger the amount of data transmitted, the more power is consumed. TCP heartbeat packets are transmitted at predetermined time intervals. Since the amount of data transmitted is very small, the power consumed by transmitting TCP heartbeat packets over TCP link is very small.
[0030] The TCP heartbeat packet can be sent from the device end to the smart end, or from the smart end to the device end. In a possible implementation, the embodiment of the present application can determine the sending method of the TCP heartbeat packet based on the detection data obtained by the device end, such as Figure 3 As shown, the method includes: In S301, the device side obtains detection data of the device side.
[0031] The device end in the embodiment of the present application may include a sensor device for detecting the operating state. For example, in the energy storage system, the inverter may include a temperature sensor device for temperature detection, a smoke sensor for smoke detection, etc. It is not limited to this, and may also include other sensor devices for detecting whether the device end is in a normal operating state.
[0032] In S302, the device side determines the data interval to which the detection data of the device side belongs.
[0033] The acquired detection data can be compared with the set standard data range to determine whether the detection data is abnormal data. For example, the normal temperature range can be set to be less than a preset temperature threshold, such as less than 75 degrees Celsius. The currently collected detection data, that is, the temperature, is compared with the temperature threshold. If the currently collected temperature is less than 75 degrees Celsius, it means that the temperature data is normal data. If the currently collected temperature is greater than or equal to 75 degrees Celsius, it means that the temperature data is abnormal data. When it is determined that the collected data is abnormal data, a data update instruction can be sent to the sending intelligent terminal through a TCP connection to update the data to be transmitted to the intelligent terminal.
[0034] When the detected data belongs to normal data, the data interval to which the collected data belongs can be determined. For example, when the currently collected temperature is less than the temperature threshold, the temperature interval to which the currently collected temperature belongs can be determined. For example, the temperature interval may include [65°C-75°C), [55°C-65°C), [45°C-55°C), [35°C-45°C) and temperature intervals less than 35°C.
[0035] In S303, according to the correspondence between the preset data interval and the sending frequency of the TCP heartbeat packet, the device end determines the sending frequency of the TCP heartbeat packet between the smart end and the device end.
[0036] The correspondence between different data intervals and sending frequencies can be preset. In general, the smaller the difference between the value in the data interval and the most recent abnormal value, the higher the sending frequency of the TCP heartbeat packet. For example, the higher the temperature in the temperature interval, the smaller the difference from 75°C, the higher the sending frequency of the TCP heartbeat packet.
[0037] In S304, according to the determined sending frequency of the TCP heartbeat packet, the device end transmits the TCP heartbeat packet based on the Wi-Fi link to the smart end.
[0038] By sending TCP heartbeat packets according to the determined frequency of sending TCP heartbeat packets, the state of the TCP link can be determined more reliably, thereby enabling more reliable transmission of data update instructions through the TCP connection, or also referred to as the TCP link, to improve the reliability of state acquisition.
[0039] In a possible implementation, the embodiment of the present application can also determine the change trend of the data based on the collected data, and determine the transmission frequency of the TCP heartbeat packet based on the change trend of the data, such as Figure 4 As shown, the method includes: In S401, the device side obtains detection data of the device side.
[0040] The device end in the embodiment of the present application may include a sensor device for detecting the operating state. For example, in the energy storage system, the inverter may include a temperature sensor device for temperature detection, a smoke sensor for smoke detection, etc. It is not limited to this, and may also include other sensor devices for detecting whether the device end is in a normal operating state.
[0041] In S402, the device determines a change trend of the detection data.
[0042] Based on the acquired detection data, a straight line or curve can be obtained by data fitting, and the change trend of the detection data can be determined according to the slope of the fitted straight line, or the change of future data can be predicted according to the fitted curve, that is, the change trend of the detection data can be obtained.
[0043] In a possible implementation, matching analysis may be performed in combination with historical data to determine a change trend of the currently acquired detection data.
[0044] In S403, detection data of a future predetermined period is determined according to the trend, and the device end determines a frequency of sending TCP heartbeat packets between the smart end and the device end according to the detection data of the future predetermined period.
[0045] According to the changing trend of the determined detection data, the embodiment of the present application can estimate the detection data of the future predetermined period. For example, the size of the detection data in the predetermined period after the current time node and closest to the current time node can be estimated. The transmission frequency corresponding to the detection data estimated in the future predetermined period can be determined according to the corresponding relationship between the size of the detection data and the transmission frequency. Alternatively, the transmission frequency corresponding to the detection data estimated in the future predetermined period can be determined according to the data interval to which the estimated detection data belongs.
[0046] In S404, according to the determined sending frequency of the TCP heartbeat packet, the device end transmits the TCP heartbeat packet based on the Wi-Fi link to the smart end.
[0047] By sending TCP heartbeat packets according to the determined frequency of sending TCP heartbeat packets, the state of the TCP link can be determined more reliably, thereby enabling more reliable transmission of data update instructions through the TCP connection, or also referred to as the TCP link, to improve the reliability of state acquisition.
[0048] In S202, the smart terminal receives a data update instruction sent by the device terminal through the TCP connection determined by the TCP heartbeat packet, and the data update instruction is generated when the device terminal detects data to be sent.
[0049] Based on the transmitted TCP heartbeat packet, it can be determined whether the TCP connection is reliable and effective. For example, the reliability of the connection state of the TCP connection between the smart terminal and the device terminal can be determined based on whether the TCP heartbeat packet is successfully transmitted or the transmission delay. If the connection state of the TCP connection between the smart terminal and the device terminal meets the reliability requirements, such as the delay between the smart terminal and the device terminal is less than the predetermined duration, the device terminal can transmit the data update instruction to the smart terminal through the TCP connection.
[0050] In the embodiment of the present application, the device end can act as a TCP server to send a data update instruction to the smart end acting as a TCP client, and the state of the existence of new data to be sent can be quickly and effectively updated to the smart end without the need to establish an additional communication link.
[0051] In S203, according to the data update instruction, the smart terminal sends a Bluetooth connection request to the device terminal that has completed Bluetooth pairing with the smart terminal.
[0052] In the embodiment of the present application, the device end and the smart end can complete the pairing operation in advance. The smart end can act as a Bluetooth host, and the device end can act as a Bluetooth slave. When there is no data to be sent on the device end, the smart end can set the Bluetooth connection to a disconnected state, thereby saving power consumption of the device end as a Bluetooth slave.
[0053] The smart terminal as a Bluetooth host can obtain data update instructions through a TCP connection. Compared with the polling method at a predetermined time interval, the acquisition efficiency of data update instructions is higher and the status of data update is known more timely.
[0054] Compared with the method in which the device actively sends notifications or instructions, the embodiment of the present application sends notifications or instructions (data update instructions) through a TCP connection, which can effectively reduce the probability of slave blocking and make the host's key request instructions more reliably issued, which is conducive to the smart end to obtain updated data to be transmitted in a timely and reliable manner.
[0055] In S204, the smart end receives the request response from the device end and establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection.
[0056] After the device responds to the Bluetooth connection request of the smart terminal, for example, the device accepts the connection, a Bluetooth connection between the device and the smart terminal can be established. Based on the established Bluetooth connection, the device transmits the data to be sent to the smart terminal.
[0057] In a possible implementation, the embodiment of the present application can also close or disconnect the Bluetooth connection when it detects that the data to be sent has been transmitted, so that the device end as a Bluetooth slave does not need to monitor, thereby improving the battery life of the device end. The smart end can receive the data to be transmitted according to the Bluetooth connection. After the data to be transmitted is sent, the smart end can close the Bluetooth connection according to the end mark of the transmitted data to be sent. After detecting that the data to be sent has been successfully sent, the device end closes the Bluetooth connection, for example, the Bluetooth module can be put into a power-off state.
[0058] In possible implementation, the embodiment of the present application can also determine the transmission frequency of the TCP heartbeat packet according to the transmission state of the data to be sent. For example, after the Bluetooth connection is established, the transmission of the TCP heartbeat packet between the device end and the intelligent end can be stopped, or the transmission frequency of the TCP heartbeat packet between the device end and the intelligent end can be reduced. After the transmission of the data to be sent is completed, or after the Bluetooth connection is closed, the transmission of the TCP heartbeat packet between the device end and the intelligent end can be restored, or the transmission frequency of the TCP heartbeat packet between the device end and the intelligent end can be improved. Thereby the transmission frequency of the TCP heartbeat packet can effectively adapt to the requirement of the instruction transmission.
[0059] 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 the present application.
[0060] Figure 5 A schematic diagram of a data transmission device provided in an embodiment of the present application, the device comprising: A first heartbeat packet transmission unit 501 is used to transmit a TCP heartbeat packet based on a Wi-Fi link between an intelligent terminal and a device terminal; A data update instruction receiving unit 502, configured to receive, by the intelligent terminal, a data update instruction sent by the device terminal through the TCP connection determined by the TCP heartbeat packet, wherein the data update instruction is generated when the device terminal detects data to be sent; A Bluetooth connection request sending unit 503 is used to send a Bluetooth connection request from the smart terminal to the device terminal that has completed Bluetooth pairing with the smart terminal according to the data update instruction; The first data transmission unit 504 is configured to receive the request response from the device end by the smart end, establish a Bluetooth connection according to the request response, and transmit the data to be sent according to the Bluetooth connection.
[0061] Alternatively, an embodiment of the present application further provides another data transmission device, the device comprising: A second heartbeat packet transmission unit, used for transmitting a TCP heartbeat packet based on a Wi-Fi link between the device end and the intelligent end; A data update instruction sending unit, when the device detects data to be sent, the device sends the data update instruction through the TCP connection determined by the TCP heartbeat packet; A Bluetooth connection request receiving unit, configured to receive the Bluetooth connection request sent by the smart terminal from the device terminal, and send a request response to the smart terminal according to the Bluetooth request; The second data transmission unit is used for the device to establish a Bluetooth connection according to the request response, and transmit the data to be sent according to the Bluetooth connection.
[0062] The data transmission device and Figure 2 The data transmission method shown corresponds to.
[0063] Figure 6 Schematic diagram of a data transmission device provided in an embodiment of the present application. Figure 6As shown, the data transmission device 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a data transmission program. When the processor 60 executes the computer program 62, the steps in the above-mentioned various data transmission method embodiments are implemented. Alternatively, when the processor 60 executes the computer program 62, the functions of the modules / units in the above-mentioned various device embodiments are implemented.
[0064] Exemplarily, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 62 in the data transmission device 6.
[0065] The data transmission device 6 may be a smart terminal or a device terminal. The smart terminal may be a computing device such as a desktop computer, a notebook, a palm computer, etc. The data transmission device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that Figure 6 It is only an example of a data transmission device 6 and does not constitute a limitation of the data transmission device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the data transmission device may also include input and output devices, network access devices, buses, etc.
[0066] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0067] The memory 61 may be an internal storage unit of the data transmission device 6, such as a hard disk or memory of the data transmission device 6. The memory 61 may also be an external storage device of the data transmission device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the data transmission device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the data transmission device 6. The memory 61 is used to store the computer program and other programs and data required by the data transmission device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0068] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0069] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0070] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0071] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0072] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0073] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0074] If the integrated module / unit 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0075] In addition, an embodiment of the present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the methods in the above-mentioned implementation modes.
[0076] The embodiments described above 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 aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: The method comprises: TCP heartbeat packets based on Wi-Fi links are transmitted between the smart terminal and the device; The smart terminal receives the data update instruction sent by the device terminal through the TCP connection determined by the TCP heartbeat packet, and the data update instruction is generated when the device terminal detects data to be sent; According to the data update instruction, the smart terminal sends a Bluetooth connection request to the device terminal that has completed Bluetooth pairing with the smart terminal; The smart end receives the request response from the device end and establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection.
2. The method according to claim 1, characterized in that The intelligent terminal receives the data update instruction sent by the device terminal through the TCP connection determined by the TCP heartbeat packet, including: The intelligent terminal determines the connection status between the intelligent terminal and the device terminal through the TCP heartbeat packet; Based on the device states of the smart terminal and the device terminal, the smart terminal, which serves as a TCP client, receives a data update instruction sent by the device terminal, which serves as a TCP server terminal.
3. The method according to claim 1, characterized in that: According to the data update instruction, the smart terminal sends a Bluetooth connection request to the device terminal that has completed Bluetooth pairing with the smart terminal, including: According to the data update instruction, the smart terminal as the Bluetooth host searches for the Bluetooth connection information of the paired device terminal as the Bluetooth slave; According to the Bluetooth connection information, the smart end sends a Bluetooth connection request to the device end.
4. The method according to any one of claims 1 to 3, characterized in that: After the smart terminal receives the request response from the device terminal and establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection, the method further includes: After the data to be sent is sent, the Bluetooth connection is closed.
5. The method according to any one of claims 1 to 3, characterized in that: After the smart terminal receives the request response from the device terminal and establishes a Bluetooth connection according to the request response, the method further includes: The intelligent end stops the transmission of TCP heartbeat packets with the device end, or the intelligent end reduces the frequency of TCP heartbeat packet transmission with the device end; After the data transmission to be sent is completed, the method further includes: The intelligent end resumes the transmission of TCP heartbeat packets between the intelligent end and the device end, or the intelligent end increases the transmission frequency of TCP heartbeat packets between the intelligent end and the device end.
6. A data transmission method, characterized in that: The method comprises: TCP heartbeat packets based on Wi-Fi links are transmitted between the device and the smart terminal; When the device detects data to be sent, the device sends a data update instruction through the TCP connection determined by the TCP heartbeat packet; The device receives the Bluetooth connection request sent by the smart terminal, and sends a request response to the smart terminal according to the Bluetooth request; The device side establishes a Bluetooth connection according to the request response, and transmits the data to be sent according to the Bluetooth connection.
7. The method according to claim 6, characterized in that The TCP heartbeat packet based on the Wi-Fi link is transmitted between the device and the smart terminal, including: The device side obtains the detection data of the device side; The device side determines the data interval to which the detection data of the device side belongs; According to the correspondence between the preset data interval and the sending frequency of the TCP heartbeat packet, the device end determines the sending frequency of the TCP heartbeat packet between the smart end and the device end; According to the determined sending frequency of the TCP heartbeat packet, the device end transmits the TCP heartbeat packet based on the Wi-Fi link to the smart end.
8. The method according to claim 6, characterized in that The TCP heartbeat packet based on the Wi-Fi link is transmitted between the device and the smart terminal, including: The device side obtains the detection data of the device side; The device determines a change trend of the detection data; Determine the detection data of a predetermined period in the future according to the trend, and the device end determines the frequency of sending TCP heartbeat packets between the smart end and the device end according to the detection data of the predetermined period in the future; According to the determined sending frequency of the TCP heartbeat packet, the device end transmits the TCP heartbeat packet based on the Wi-Fi link to the smart end.
9. A data transmission device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the data transmission device implements the method according to any one of claims 1 to 8.
10. A computer program product comprising computer program instructions, characterized in that When the computer program is executed, the method according to any one of claims 1 to 8 is performed.
Citation Information
Patent Citations
File sharing method and system, sending end device and receiving end device
CN114071789A
Bluetooth test method and device, storage medium and program product
CN118200969A
Control method and system of BLE intelligent equipment
CN119136334A
Method and apparatus for forming communication link using bluetooth
US20160302026A1