Background
At present, the application of intelligent equipment is more and more popular. In a general application mode of the intelligent device, the master intelligent device collects and stores data and then transmits the data to the slave intelligent device, so that a user can obtain relevant information. For example, a user wants to acquire related information of a smart band through a smart phone, the smart band serves as a master smart device, the smart phone serves as a slave smart device, the smart band sends acquired data to the smart phone, and the user acquires the information through the smart phone. However, the battery capacity of the main smart device is small, the endurance is poor, the output interface is limited, and the electric quantity consumed by the main smart device along with the development of the application is more and more, however, the battery cannot realize long-time power supply, so that the requirement for low power consumption of the smart device is higher and higher in order to realize longer battery life and higher performance.
At present, data transmission is generally carried out between intelligent devices in a Bluetooth mode, the data transmission speed in the Bluetooth mode is high, but the operation is troublesome, a user needs to open the Bluetooth for Bluetooth pairing and then carry out data transmission, the energy consumption of Bluetooth pairing is large, and continuous power consumption can also be caused by closing the Bluetooth mode when the data transmission is not finished in time.
Near Field Communication (NFC) is a Near Field Communication technology suitable for handheld mobile devices, combines the functional characteristics of an RFID (radio frequency identification) card reader and a smart card, and has a Communication distance of usually 0 to 10cm, which is a very secure Communication range. Within this distance, data transmission between the two devices can be completed in an extremely short time. Therefore, NFC pairing is fast, power consumption is low, and NFC works in a passive mode with substantially no power consumption, but with slower NFC data transfer.
Therefore, how to perform data transmission between smart devices by using NFC and bluetooth to reduce power consumption of a host smart device is a general concern for those skilled in the art.
Disclosure of Invention
In view of this, the present invention provides a data transmission method and system, a master device and a slave device, so as to realize high-speed and low-power consumption data transmission between the master device and the slave device and reduce power consumption of the master device.
According to the above object, the present invention provides a method for transmitting data, the method comprising:
s1, establishing Bluetooth mode connection between the master device and the slave device, storing Bluetooth connection information, data identification and state information in the master device, and closing respective Bluetooth modes;
s2, the master device and the slave device carry out NFC communication, and the slave device reads data identification information and state information;
s3, when the data mark is larger than or equal to a preset data threshold value and the state information is transmittable data, the slave device opens its own Bluetooth and the master device opens its own Bluetooth through NFC communication;
s4, according to the Bluetooth connection information, the master device and the slave device establish a Bluetooth connection channel, the slave device receives data, and after the data reception is completed, the master device and the slave device respectively close respective Bluetooth.
Preferably, before step S1, the method further includes:
the master device initializes the data identification information and the state information.
Preferably, step S4 further includes:
and the master equipment updates the data identification information and the state information in real time, and the slave equipment reads the updated data identification information and the state information at regular time.
Preferably, the method further comprises:
and when the Bluetooth of the main equipment is closed, modifying the data identification information of the NFC module of the main equipment.
In accordance with the above object, the present invention also provides a data transmission system comprising a master device and a slave device, the master device and the slave device establishing a bluetooth connection, wherein,
the main equipment is used for storing Bluetooth connection information, data identification and state information;
the master device and the slave device carry out NFC communication, and close respective Bluetooth through respective NFC modules;
the slave device is used for reading the data identification information and the state information, and when the data identification is larger than or equal to a preset data threshold value and the state information is transmittable data, the slave device opens own Bluetooth and enables the master device to open own Bluetooth through NFC communication;
and according to the Bluetooth connection information, the master device and the slave device establish a Bluetooth connection channel, the slave device receives data, and the master device and the slave device close respective Bluetooth after the data reception is finished.
Preferably, the master device includes:
the first Bluetooth module is used for establishing Bluetooth connection with the slave equipment, and when the data identifier is larger than or equal to a preset data threshold value and the state information is transmittable data, according to the Bluetooth connection information, a Bluetooth connection channel is established between the first Bluetooth module and a second Bluetooth of the slave equipment, and the first Bluetooth module transmits the data;
the storage module is used for storing the Bluetooth connection information and storing the data identification information and the data state information;
and the first NFC module is used for carrying out NFC communication with the slave equipment and controlling the opening and closing of the first Bluetooth module.
Preferably, the slave device comprises:
the second Bluetooth module is used for establishing Bluetooth connection with the main equipment, and when the data identifier is larger than or equal to a preset data threshold value and the state information is transmittable data, according to the Bluetooth connection information, the second Bluetooth module establishes a Bluetooth connection channel with the first Bluetooth of the main equipment, and the second Bluetooth module receives data;
and the second NFC module is used for carrying out NFC communication with the main equipment and controlling the opening and closing of the second Bluetooth module.
Preferably, the storage module is further configured to update the data identification information and the data status information in real time during the data transmission process.
According to the above object, the present invention further provides a data transmission master device, including:
the first Bluetooth module is used for establishing Bluetooth connection with the slave equipment;
the storage module is used for storing the Bluetooth connection information and initializing and storing the data identification information and the data state information;
the first NFC module is used for carrying out NFC communication with the slave equipment after the master equipment and the slave equipment establish first Bluetooth connection, controlling to close the first Bluetooth module, controlling to open the first Bluetooth module when the data identifier is larger than or equal to a preset data threshold value and the state information is transmittable data, and closing the first Bluetooth module when data transmission is finished;
the first bluetooth module is further configured to establish a bluetooth connection channel with a second bluetooth of the slave device according to the bluetooth connection information when the data identifier is greater than or equal to a preset data threshold and the status information is transmittable data, and the first bluetooth module sends data.
According to the above object of the present invention, the present invention also provides a data transmission slave device, comprising:
the second Bluetooth module is used for establishing Bluetooth connection with the main equipment;
the second NFC module is used for carrying out NFC communication with the master device after the slave device establishes first Bluetooth connection with the master device, controlling to close the second Bluetooth module, controlling to open the second Bluetooth module when the data identifier is larger than or equal to a preset data threshold value and the state information is transmittable data, and closing the second Bluetooth module when data reception is finished;
the second bluetooth module is further configured to establish a bluetooth connection channel with the first bluetooth of the host device according to the bluetooth connection information when the data identifier is greater than or equal to a preset data threshold and the status information is transmittable data, and the second bluetooth module receives the data.
Compared with the prior art, the data transmission method and system, the master device and the slave device have the following beneficial effects: the data information of the master device is continuously read through the NFC of the slave device, and the master device operates in an NFC passive mode, so that the energy consumption of the master device is reduced, and the service time of a battery of the master device is prolonged; data transmission is carried out through the Bluetooth channel connection, the high speed rate of the data transmission is ensured, and the user experience is improved; according to the acquired and stored Bluetooth connection information, a Bluetooth connection channel is quickly established between the master device and the slave device, so that compared with the traditional Bluetooth transmission mode, the user connection uploading process is reduced, the speed of connecting the Bluetooth channel again is increased, and the power consumption of the device is reduced; after data transmission is finished, the Bluetooth mode can be immediately closed, so that redundant power consumption is avoided, and the power consumption of the equipment is reduced; data are transmitted by automatically switching the Bluetooth mode, user operation is not needed, and user experience is improved.
Detailed Description
As mentioned in the background art, how to perform data transmission between a master device and a slave device by using NFC and bluetooth is a general concern to reduce power consumption of the master device.
Therefore, the invention establishes Bluetooth mode connection between the master device and the slave device, stores Bluetooth connection information, data identification and state information in the master device, then closes respective Bluetooth modes, the slave device reads the data identification information and the state information through NFC communication with the master device, when the data identification is larger than or equal to a preset data threshold value and the state information is transmittable data, the slave device opens own Bluetooth and enables the master device to open own Bluetooth through NFC communication, then according to the Bluetooth connection information, the master device and the slave device establish a Bluetooth connection channel, the slave device receives the data, and after the data reception is completed, the master device and the slave device respectively close respective Bluetooth, thereby realizing high-speed low-power consumption data transmission between the master device and the slave device and reducing the power consumption of the master device.
Other advantages and capabilities of the present invention will be readily apparent to those skilled in the art from the present disclosure by describing the embodiments of the present invention with specific embodiments thereof in conjunction with the accompanying drawings. The invention is capable of other and different embodiments and its several details are capable of modification in various other respects, all without departing from the spirit and scope of the present invention.
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
s1, establishing Bluetooth mode connection between the master device and the slave device, storing Bluetooth connection information, data identification and state information in the master device, and closing respective Bluetooth modes;
s2, the master device and the slave device carry out NFC communication, and the slave device reads data identification information and state information;
s3, when the data mark is larger than or equal to a preset data threshold value and the state information is transmittable data, the slave device opens own Bluetooth, and the master device opens own Bluetooth through NFC communication;
and S4, according to the Bluetooth connection information, the master device and the slave device establish a Bluetooth connection channel, the slave device receives data, and after the data reception is completed, the master device and the slave device respectively close respective Bluetooth.
In a specific implementation, before step S1, the master device initializes data identification information and status information. The method comprises the steps that Bluetooth mode connection is established between master equipment and slave equipment, after the Bluetooth mode is established, the master equipment stores Bluetooth connection information, data identification and state information, then the master equipment and the slave equipment close the Bluetooth mode, and Bluetooth connection between the master equipment and the slave equipment is cancelled. The method comprises the steps that an NFC connection channel is established between a master device and a slave device, NFC communication is carried out, the master device runs an NFC passive mode, the slave device runs an NFC active mode, and the slave device reads data identification information and state information of the master device. And after the master device acquires the data, updating the data identification information and the state information in real time, and regularly reading the updated data identification information and the state information by the slave device through an NFC connecting channel. And when the data identifier is greater than or equal to a preset data threshold value and the state information is transmittable data, the slave device opens own Bluetooth, and the master device opens own Bluetooth through NFC communication. The slave device starts the bluetooth mode of the device itself and notifies the master device of the start of the bluetooth mode, and at the same time, the slave device transmits the bluetooth connection information of the device itself to the master device. And after receiving the notification, the master device sends the stored Bluetooth connection information to the slave device, and a Bluetooth connection channel is quickly established between the master device and the slave device according to the Bluetooth connection information. After the Bluetooth connection channel is established, the master device transmits data to the slave device through the Bluetooth connection channel, and after the data reception is completed, the master device and the slave device close respective Bluetooth. And when the Bluetooth of the main equipment is closed, the main equipment modifies the data identification information of the NFC module of the main equipment. According to the technical scheme, the slave device continuously reads the data identification information of the master device through the NFC connection channel, and the master device operates in the NFC passive mode, so that the energy consumption of the master device is low, and the battery consumption of the master device is saved; the data are transmitted through the Bluetooth connecting channel, and the Bluetooth mode is closed after the data transmission is finished, so that the data can be transmitted at a high rate and with low power consumption, and the user experience is improved; by acquiring the stored Bluetooth connection information, pairing connection is not required to be performed by a user, so that the speed of performing Bluetooth channel connection again is increased, and the power consumption of the equipment is reduced; data are transmitted by automatically switching the Bluetooth mode, user operation is not needed, and user experience is improved.
To sum up, the master device and the slave device use the NFC and the bluetooth for data transmission, thereby realizing high-speed and low-power consumption data transmission, reducing the power consumption of the master device, and improving the user experience.
Fig. 2 is a structural diagram of a data transmission system according to an embodiment of the present invention. As shown in fig. 2, the data transmission system includes a master device and a slave device, which establish a bluetooth connection, wherein,
the main equipment is used for storing Bluetooth connection information, data identification and state information;
the master device and the slave device carry out NFC communication, and close respective Bluetooth through respective NFC modules;
the slave equipment is used for reading the data identification and the state information, and when the data identification is larger than or equal to a preset data threshold value and the state information is transmittable data, the slave equipment opens the own Bluetooth and enables the master equipment to open the own Bluetooth through NFC communication;
and according to the Bluetooth connection information, the master device and the slave device establish a Bluetooth connection channel, the slave device receives data, and after the data reception is finished, the master device and the slave device close respective Bluetooth.
Specifically, the master device includes:
the first Bluetooth module 20 is configured to establish Bluetooth connection with the slave device, and when the data identifier is greater than or equal to a preset data threshold and the status information indicates that the data can be transmitted, according to the Bluetooth connection information, the first Bluetooth module establishes a Bluetooth connection channel with a second Bluetooth of the slave device, and the first Bluetooth module transmits the data;
the storage module 21 is used for storing the Bluetooth connection information and storing data identification information and data state information;
and the first NFC module 22 is configured to perform NFC communication with the slave device, and control to turn on and off the first bluetooth module.
Specifically, the slave device includes:
the second bluetooth module 23 is configured to establish a bluetooth connection with the host device, and when the data identifier is greater than or equal to a preset data threshold and the status information indicates that the data can be transmitted, according to the bluetooth connection information, the second bluetooth module establishes a bluetooth connection channel with the first bluetooth of the host device, and the second bluetooth module receives the data;
and the second NFC module 24 is configured to perform NFC communication with the host device and control turning on and off of the second bluetooth module.
In a specific implementation process, the first bluetooth module 20 of the master device establishes a bluetooth mode connection with the second bluetooth module 22 of the slave device, after the bluetooth mode connection is established, the bluetooth connection information, the data identification information and the data state information are stored in the storage module 21, then the master device closes the first bluetooth module 20, the slave device closes the second bluetooth module 22, and the bluetooth connection between the master device and the slave device is cancelled. The first NFC module 22 and the second NFC module 24 of the master device establish an NFC connection channel, the first NFC module 22 operates an NFC passive mode, the second NFC module 24 operates an NFC active mode, and the master device and the slave device communicate through the NFC connection channel. After the storage module 21 acquires the data of the master device, the data identification information and the data state information are updated in real time in the data transmission process. The second NFC module 24 obtains the updated data identification information and the updated data status information through the NFC connection channel. When the data identifier is greater than or equal to a preset data threshold and the status information indicates that the data can be transmitted, the second NFC module 24 opens the second bluetooth module 22, and notifies the first NFC module 22 to start its own bluetooth mode, and simultaneously, the second NFC module 24 sends the bluetooth connection information of the device itself to the first NFC module 22. After receiving the notification, the first NFC module 22 turns on the first bluetooth module 20, and sends the stored bluetooth connection information of the device itself to the second NFC module 24. The first bluetooth module 20 and the second bluetooth module 24 quickly establish bluetooth channel connection between the master device and the slave device according to the bluetooth connection information. After the bluetooth connection channel is established, the first bluetooth module 20 sends data to the second bluetooth module 24 through the bluetooth connection channel. When the data transmission is completed, the first bluetooth module 20 and the second bluetooth module 24 are turned off. According to the technical scheme, the slave device continuously reads the data identification information and the state information of the master device through the second NFC module, and the master device NFC works in a passive mode, so that the energy consumption of the master device is low, and the power consumption of the master device is saved; the first Bluetooth module and the second Bluetooth module transmit data through the Bluetooth connecting channel, and the Bluetooth mode is closed after the data transmission is finished, so that the data can be transmitted at a high rate and with low power consumption, and the user experience is improved; the speed of performing Bluetooth channel connection again is increased by acquiring the stored Bluetooth connection information, so that the power consumption of the intelligent equipment is reduced; data are transmitted by automatically switching the Bluetooth mode, user operation is not needed, and user experience is improved.
Fig. 3 is a system structure diagram of a data transmission master device according to an embodiment of the present invention. As shown in fig. 3, the master device includes:
a first bluetooth module 30 for establishing a bluetooth connection with a slave device;
the storage module 31 is used for storing the bluetooth connection information, and initializing and storing data identification information and data state information;
the first NFC module 32 is configured to perform NFC communication with the slave device after the master device establishes a first bluetooth connection with the slave device, control to turn off the first bluetooth module, control to turn on the first bluetooth module when the data identifier is greater than or equal to a preset data threshold and the state information is transmittable data, and turn off the first bluetooth module when data transmission is completed;
the first bluetooth module 30 is further configured to, when the data identifier is greater than or equal to a preset data threshold and the status information is transmittable data, establish a bluetooth connection channel between the first bluetooth module and the second bluetooth of the slave device according to the bluetooth connection information, and the first bluetooth module sends the data.
In the specific implementation process, the first bluetooth module 30 of the master device establishes a bluetooth mode connection with the slave device, stores bluetooth connection information, data identification information and data status information in the storage module 31, and then turns off the first bluetooth module 30. The first NFC module 32 and the slave device communicate through an NFC connection channel. After the storage module 31 acquires the data of the host device, the data identification information and the data state information are updated in real time in the data transmission process. When the data identifier is greater than or equal to a preset data threshold and the status information is transmittable data, the first NFC module 21 turns on the first bluetooth module 30 and transmits the stored bluetooth connection information of the device itself to the slave device. The first bluetooth module 30 establishes a bluetooth channel connection with the slave device according to the bluetooth connection information. After the bluetooth connection channel is established, the first bluetooth module 30 sends data to the slave device through the bluetooth connection channel. When the data transmission is completed, the first bluetooth module 30 is turned off. In the technical scheme, the NFC of the main equipment works in a passive mode, and the energy consumption of the main equipment is low, so that the power consumption of the main equipment is saved; the first Bluetooth module and the slave device transmit data through the Bluetooth connecting channel, and the Bluetooth mode is closed after the data transmission is finished, so that the data can be transmitted at a high rate and with low power consumption, and the user experience is improved; through the bluetooth connection information who obtains the storage, make again carry out bluetooth channel connection speed and accelerate to the consumption of main equipment has been reduced.
Fig. 4 is a system structure diagram of a data transmission slave device according to an embodiment of the present invention. As shown in fig. 4, the slave device includes:
the second Bluetooth module 40 is used for establishing Bluetooth connection with the main equipment;
the second NFC module 41 is configured to perform NFC communication with the master device after the slave device establishes a first bluetooth connection with the master device, control to close the second bluetooth module, control to open the second bluetooth module when the data identifier is greater than or equal to a preset data threshold and the status information is transmittable data, and close the second bluetooth module when data reception is completed;
the second bluetooth module 40 is further configured to, when the data identifier is greater than or equal to a preset data threshold and the status information indicates that the data can be transmitted, establish a bluetooth connection channel with the first bluetooth of the host device according to the bluetooth connection information, and receive the data by the second bluetooth module.
In the specific implementation process, the second bluetooth module 40 of the slave device establishes a bluetooth mode connection with the master device, and the slave device turns off the second bluetooth module 40. The second NFC module 41 establishes an NFC connection channel with the master device, the second NFC module 41 operates an NFC active mode, and the master device and the slave device communicate through the NFC connection channel. The second NFC module 41 acquires data identification information and data status information of the host device through the NFC connection channel. When the data identifier is greater than or equal to a preset data threshold value and the status information is transmittable data, the second NFC module 41 opens the second bluetooth module 40, and enables the host device to open its own bluetooth mode, and at the same time, the second NFC module 40 sends the bluetooth connection information of the device itself to the host device. The second bluetooth module 40 acquires the bluetooth connection information sent by the master device, and quickly establishes a bluetooth channel connection between the master device and the slave device according to the bluetooth connection information. After the bluetooth connection channel is established, the second bluetooth module 40 receives data sent by the master device. When the data reception is completed, the second bluetooth module 40 is turned off. According to the technical scheme, the slave device continuously reads the data identification information and the state information of the master device through the second NFC module, so that the energy consumption of the master device is low, and the power consumption of the master device is saved; data are transmitted by automatically switching the Bluetooth mode, user operation is not needed, and user experience is improved.
In summary, a data transmission method and system, a master device and a slave device can transmit data at a high rate and with low power consumption, so that the power consumption of the master device is greatly reduced, and the user experience is improved.
Modifications and variations can be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the present invention. Therefore, the scope of the invention should be determined from the following claims.