CN109067984B - Data transmission method, electronic device and computer readable storage medium - Google Patents

Data transmission method, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN109067984B
CN109067984B CN201810789122.1A CN201810789122A CN109067984B CN 109067984 B CN109067984 B CN 109067984B CN 201810789122 A CN201810789122 A CN 201810789122A CN 109067984 B CN109067984 B CN 109067984B
Authority
CN
China
Prior art keywords
electronic device
collision
data transmission
pairing request
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810789122.1A
Other languages
Chinese (zh)
Other versions
CN109067984A (en
Inventor
罗培伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810789122.1A priority Critical patent/CN109067984B/en
Publication of CN109067984A publication Critical patent/CN109067984A/en
Application granted granted Critical
Publication of CN109067984B publication Critical patent/CN109067984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones
    • H04M1/72502Cordless telephones with one base station connected to a single line
    • H04M1/72505Radio link set-up procedures
    • H04B5/45
    • H04B5/72
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones
    • H04M1/72502Cordless telephones with one base station connected to a single line
    • H04M1/72505Radio link set-up procedures
    • H04M1/72511Searching for available channels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/02Details of telephonic subscriber devices including a Bluetooth interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/04Details of telephonic subscriber devices including near field communication means, e.g. RFID
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Abstract

The embodiment of the application provides a data transmission method, an electronic device and a computer readable storage medium, and relates to the technical field of communication, wherein the method comprises the following steps: when a first electronic device collides, sending a pairing request to a second electronic device in a preset sending mode, wherein the pairing request comprises time information of collision, and the time information is used for assisting the second electronic device to determine whether response information is returned or not; when response information returned by the second electronic device is received, establishing data transmission connection with the second electronic device; and sending the target data to the second electronic device based on the established data transmission connection, wherein the target data can be used for improving the convenience of data transmission.

Description

Data transmission method, electronic device and computer readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, an electronic device, and a computer-readable storage medium.
Background
With the development of computer technology, the popularity of computer terminal devices such as mobile phones, tablet computers, and portable computers is increasing. Due to the fact that the technology development is changing day by day, the storage and updating speed of the terminal equipment is higher and higher. After a new mobile phone is purchased, since a large amount of personal information of a user is stored in the old mobile phone, in order to send the information to the new mobile phone, the new mobile phone generally needs to be manually controlled to search the old mobile phone, then the selected other party is clicked, and after the other party confirms, file transmission can be carried out, so that the operation is complicated.
Disclosure of Invention
The embodiment of the application provides a data transmission method, an electronic device and a computer-readable storage medium, which are used for triggering file transmission through collision and can improve the convenience of data transmission.
An aspect of the present application provides a data transmission method, including: when a first electronic device collides, sending a pairing request to a second electronic device in a preset sending mode, wherein the pairing request comprises time information of the collision, and the time information is used for assisting the second electronic device to determine whether response information is returned or not; when response information returned by the second electronic device is received, establishing data transmission connection with the second electronic device; and sending the target data to the second electronic device based on the established data transmission connection.
An aspect of the present embodiment further provides a data transmission method, including: when the second electronic device collides, recording the time information of the collision; when a pairing request sent by a first electronic device is received, acquiring the time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision of the first electronic device contained in the pairing request; if the time difference is within a preset time range, returning response information to the first electronic device, wherein the response information is used for establishing data transmission connection with the first electronic device; and receiving target data sent by the first electronic device through the data transmission connection, and storing the target data in the second electronic device.
An aspect of the embodiments of the present application further provides an electronic device, which is applied to a first electronic device as a data sender, and includes: the system comprises a pairing module, a sending module and a sending module, wherein the pairing module is used for sending a pairing request to a second electronic device in a preset sending mode when collision occurs, the pairing request comprises time information of the collision, and the time information is used for assisting the second electronic device to determine whether response information is returned or not; the establishing module is used for establishing data transmission connection with the second electronic device when response information returned by the second electronic device is received; and the data transmission module is used for transmitting the target data to the second electronic device based on the established data transmission connection.
An aspect of the embodiments of the present application further provides an electronic apparatus, which is applied to a second electronic apparatus as a data receiving party, and includes: the recording module is used for recording the time information of collision when the collision occurs; the system comprises an analysis module, a first electronic device and a second electronic device, wherein the analysis module is used for obtaining the time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision of the first electronic device contained in the pairing request when receiving the pairing request sent by the first electronic device, and analyzing whether the time difference is within a preset time range; the sending module is used for returning response information to the first electronic device if the time difference is within a preset time range, wherein the response information is used for establishing data transmission connection with the first electronic device; and the receiving module is used for receiving the target data sent by the first electronic device through the data transmission connection and storing the target data in the second electronic device.
An aspect of an embodiment of the present application further provides an electronic apparatus, including: memory, processor and computer program stored on the memory and operable on the processor, characterized in that the processor implements the data transmission method as provided in the above embodiments when executing the computer program.
An aspect of the embodiments of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the data transmission method provided in the above embodiments is implemented.
In the embodiments, when a collision occurs, the first electronic device sends a pairing request to the second electronic device according to a preset sending mode, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device included in the pairing request, and when the response information returned by the second electronic device is received, the first electronic device establishes data transmission connection with the second electronic device, and then sends target data to the second electronic device based on the established data transmission connection, so that data transmission based on the collision is realized.
Drawings
Fig. 1 is a schematic application environment diagram of a data transmission method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic flow chart illustrating an implementation of a data transmission method according to another embodiment of the present application;
fig. 4 is a schematic flow chart illustrating an implementation of a data transmission method according to another embodiment of the present application;
fig. 5 is a schematic flow chart illustrating an implementation of a data transmission method according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to another embodiment of the present application;
fig. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
fig. 9 is a schematic diagram of a hardware structure of an electronic device.
Detailed Description
In order to make the objects, features and advantages of the present invention more apparent and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Please refer to fig. 1, which is a schematic diagram of an application environment of a data transmission method according to an embodiment of the present application. As shown in fig. 1, the first electronic device 101 and the second electronic device 102 are in a wireless network, which may be bluetooth, Wi-Fi (wireless fidelity), or NFC (Near Field Communication).
The first electronic device 101 and the second electronic device 102 may be mobile phones, for example, and both have the collision data transmission function turned on. When a user needs to transmit target data in the first electronic device 101 to the second electronic device 102, the first electronic device 101 collides with the second electronic device 102, and the first electronic device 101 sends a pairing request to the second electronic device 102 when sensing a collision event through a motion sensor. The pairing request includes time information of the first electronic device 101 at which the collision occurred.
The second electronic device 102 compares the time information of the collision of the first electronic device 101 and the time information of the collision of the second electronic device 102 included in the pairing request, and obtains the time difference between the two. When the time difference is within the preset time range, it is confirmed that the second electronic device 102 is the collision object of the first electronic device 101, and then the second electronic device 102 sends the response information to the first electronic device 101. Further, to avoid data mistransmission, after receiving the pairing request, the second electronic device 102 determines whether the signal strength of the first electronic device 101 is greater than a preset strength, and if the signal strength is greater than the preset strength, it indicates that the distance between the first electronic device 101 and the second electronic device 102 is very close, the possibility that the first electronic device 101 is a transmission party of the target data is very high, and then determines whether the time difference between the time when the first electronic device 101 collides and the time when the second electronic device 102 collides is within a preset time range.
The first electronic device 101 establishes a data transmission connection with the second electronic device 102 according to the response information, and transmits the target data to the second electronic device 102 based on the established data transmission connection. Then, the second electronic device 102 receives the target data transmitted by the first electronic device 101 and stores the target data in the local device. Further, to avoid data mistransmission and improve the security of data transmission, the first electronic device may also obtain the signal strength of the second electronic device 102 when receiving the response information, and if the signal strength of the second electronic device 102 is greater than the preset strength, establish a data transmission connection with the second electronic device 102 according to the response information.
It is understood that, in practical applications, the first electronic device 101 and the second electronic device 102 are not limited to two mobile phones, but may also be two other electronic devices of different types, such as a mobile phone and a tablet computer, a mobile phone and a smart tv, a tablet computer and a desktop computer, and the like. When the first electronic device 101 and the second electronic device 102 are two different kinds of electronic devices, the process of implementing data transmission by collision is the same as the scenario where the first electronic device 101 and the second electronic device 102 are two mobile phones, and reference may be specifically made to the following embodiments.
Please refer to fig. 2, which is a schematic flow chart illustrating an implementation of a data transmission method according to an embodiment of the present application. The method can be applied to an electronic terminal for configuring a motion sensor and a wireless radio frequency module, such as: the mobile electronic terminal can be used for mobile data processing in the mobile process, such as a mobile phone, a tablet personal computer, a laptop, an intelligent wearable device (such as an intelligent bracelet, an intelligent watch and the like), or the non-mobile electronic terminal can be used for mobile data processing, such as a liquid crystal television, an all-in-one machine, a desktop computer and the like. This embodiment is explained from the perspective of a data sender, and as shown in fig. 2, the method mainly includes:
201. when the first electronic device collides, sending a pairing request to the second electronic device in a preset sending mode;
the first electronic device acquires own motion data through the motion sensor and judges whether collision occurs according to the acquired motion data. Motion sensors may include, for example, but are not limited to, including, for example: gravity sensors, gyroscopes, or acceleration sensors, among others.
It will be appreciated that in the event of a collision there will be a sudden change of direction of the electronic device, i.e. the value of the electronic device in the X or Y axis as sensed by the motion sensor will be reversed, for example by 180 °.
When collision occurs, the first electronic device sends a pairing request to the second electronic device in a preset sending mode. The preset sending mode corresponds to the type of the data transmission connection which needs to be established between the first electronic device and the second electronic device. If the Bluetooth data connection is established, the preset sending mode can be a broadcasting mode; if the Wi-Fi or NFC data connection is established, the preset sending mode may be a point-to-point sending mode.
The pairing request contains time information of the first electronic device collision, and the time information is used for assisting the second electronic device to determine whether response information needs to be returned or not.
In practical applications, the time information of the first electronic device collision may be included in the pairing request information, or may be included in the pairing request packet.
202. When response information returned by the second electronic device is received, establishing data transmission connection with the second electronic device;
the second electronic device includes a collision object of the first electronic device. The second electronic device records collision time information when the second electronic device collides with the second electronic device, compares the collision time information of the first electronic device contained in the pairing request with the recorded collision time information of the second electronic device when receiving the pairing request sent by the first electronic device, judges whether the time difference between the collision time information and the recorded collision time information is within a preset time range, and returns response information to the first electronic device if the time difference is within the preset time range.
It can be understood that the occurrence of the collision is synchronous for both collision parties, and the time when both collision parties detect the collision is not too long, so that only the collision object will return the response information.
And the first electronic device completes pairing with the collision object according to the response information returned by the collision object and establishes data transmission connection with the collision object. The data transmission connection may include, but is not limited to: bluetooth, Wi-Fi, or NFC connection.
203. And sending the target data to the second electronic device based on the established data transmission connection.
The first electronic device transmits the target data to the second electronic device as the collision object based on the established data transmission connection. The target data may include, but is not limited to, for example: picture data in the album, address book data, installed software parameter data, system configuration parameter data, and the like. The specific setting can be preset according to the user-defined operation of the user.
According to the data transmission method provided by the embodiment, when a first electronic device collides, a pairing request is sent to a second electronic device according to a preset sending mode, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device contained in the pairing request, when the response information returned by the second electronic device is received, the first electronic device and the second electronic device establish data transmission connection, then target data are sent to the second electronic device based on the established data transmission connection, data transmission based on collision is realized, and a user can complete data interaction only by colliding the two electronic devices, so that the operation is simplified, the convenience of data transmission is improved, the user experience can be enhanced, and the product viscosity is improved.
Please refer to fig. 3, which is a schematic flow chart illustrating an implementation of a data transmission method according to another embodiment of the present application. The method can be applied to an electronic terminal for configuring a motion sensor and a wireless radio frequency module, such as: the mobile electronic terminal can be used for mobile data processing in the mobile process, such as a mobile phone, a tablet personal computer, a laptop, an intelligent wearable device (such as an intelligent bracelet, an intelligent watch and the like), or the non-mobile electronic terminal can be used for mobile data processing, such as a liquid crystal television, an all-in-one machine, a desktop computer and the like. This embodiment is explained from the perspective of a data sender, and as shown in fig. 3, the method mainly includes:
301. when a preset event is monitored, the first electronic device starts a collision data transmission function;
specifically, the preset event may include, but is not limited to, for example: a click event for triggering a shortcut icon or button or menu for turning on the collision data transmission function, a pressing event of a shortcut physical key, a device shaking event, etc. The first electronic device monitors the preset event through a preset event monitor, and starts a collision data transmission function when the preset event is monitored.
It can be understood that after the collision data transmission function is started, the subsequent steps are executed to realize data transmission through collision. Before the collision data transmission function is started, subsequent steps are not executed, and a user cannot realize data transmission by colliding the first electronic device with other electronic devices.
302. Acquiring motion data of the first electronic device through the motion sensor in real time, and analyzing whether the first electronic device collides or not according to the motion data;
motion sensors may include, but are not limited to, for example, gravity sensors, gyroscopes, or acceleration sensors, among others. It will be appreciated that in the event of a collision there will be a sudden change of direction of the electronic device, i.e. the value of the electronic device in the X or Y axis as sensed by the motion sensor will be reversed, for example by 180 °.
303. When collision occurs, if the first electronic device is a wireless hotspot, the first electronic device sends a pairing request to a second electronic device accessed to the wireless hotspot;
it can be understood that the first electronic device needs to turn on the wireless hotspot function in advance, and the second electronic device needs to access the first electronic device. At this time, the first electronic apparatus is a master as an initiator of data transmission and a data transmitting side, and the second electronic apparatus is a slave as a data receiving side. The second electronic device includes a collision object of the first electronic device.
It can be understood that, in a wireless hotspot scenario, the data receiving party may also be set as the data transmission initiating party according to the customization of the user. At this time, after the data transmission connection is established, the target data is sent to the data transmission initiator by the initiator which is not data transmission.
When collision occurs, if the first electronic device is a wireless hotspot, the first electronic device sends pairing requests to all second electronic devices accessing the wireless hotspot through a network (such as a Wi-Fi network) provided by the wireless hotspot. The pairing request includes time information of the first electronic device collision.
It can be understood that, if the collision data transmission function is also turned on, the second electronic device records collision time information when the second electronic device collides with the second electronic device, and when receiving the pairing request sent by the first electronic device, compares the collision time information of the first electronic device included in the pairing request with the recorded collision time information of the second electronic device, and determines whether a time difference between the collision time information and the recorded collision time information is within a preset time range, and if the time difference is within the preset time range, returns response information to the first electronic device.
If the collision data transmission function is not started, the second electronic device does not record the time information of the collision when the second electronic device collides, and the second electronic device cannot analyze the collision time information and return response information because no time information is recorded. Or, if the collision data transmission function is not started, the second electronic device directly ignores the pairing request sent by the first electronic device.
Optionally, in another embodiment of the present application, when the data transmission task is triggered, the first electronic device broadcasts the pairing request to the surrounding second electronic devices based on the bluetooth protocol when the first electronic device collides.
Specifically, in a scenario of data transmission by bluetooth, there is no master device or slave device between the first electronic device and the second electronic device. The data transmission task is triggered at which electronic device, which electronic device is a data sender, which electronic device is a first electronic device, and the first electronic device initiates pairing. In practical applications, the data transmission task may be triggered based on a user clicking or pressing a preset shortcut button, menu, icon or physical shortcut key. When a data transmission task is triggered in a first electronic device, if a collision event is detected, the first electronic device broadcasts a pairing request to surrounding second electronic devices based on a Bluetooth protocol. In the process, if the first electronic device does not turn on the bluetooth, the bluetooth is turned on first, and then the broadcast of the pairing request is performed.
Optionally, in order to avoid data mistransmission and improve the safety of data transmission, in another embodiment of the present application, when a collision occurs, the first electronic device analyzes whether a collision object is an electronic device according to the motion data, and if the collision object is an electronic device, the step of sending a pairing request to the second electronic device in a preset sending manner is performed.
Specifically, the motion data may include, but is not limited to, for example: motion trajectory data and motion velocity data. And calculating the movement direction and speed of the first electronic device when the first electronic device collides according to the movement track data and the movement speed data, and comparing the calculated movement direction and speed with the preset direction and speed to judge whether the collision object is the electronic device. If the collision object is an electronic device and the collision data transmission function is started, the first electronic device sends a pairing request to the second electronic device in a preset sending mode.
Optionally, in order to avoid data mistransmission and improve the safety of data transmission, in another embodiment of the present application, when a collision occurs, the first electronic device analyzes whether the motion direction of the first electronic device is the preset motion direction according to the motion data, and if the motion direction of the first electronic device is the preset motion direction, the step of sending the pairing request to the second electronic device through a preset sending method is performed. That is, the user can trigger the pairing connection and the data transmission between the first electronic device and the second electronic device by colliding the first electronic device with the second electronic device along the preset direction.
304. When response information returned by the second electronic device is received, acquiring the signal intensity of the second electronic device, and analyzing whether the acquired signal intensity is greater than the preset intensity;
305. if the signal intensity is greater than the preset intensity, establishing data transmission connection with a second electronic device;
306. and sending the target data to the second electronic device based on the established data transmission connection.
Specifically, the response information includes identification information of the second electronic device, the signal strength of the second electronic device is obtained according to the identification information, whether the obtained signal strength is greater than a preset strength (for example, -50dBm), and if the obtained signal strength is greater than the preset strength, it indicates that the distance between the second electronic device returning the response information and the first electronic device is relatively close, and the second electronic device should be a collision object of the first electronic device, that is, a correct data receiving party, and then establishes a data transmission connection with the second electronic device. And transmitting the target data to the second electronic device based on the established data transmission connection.
Wherein the target data may include, but is not limited to, for example: picture data in the album, address book data, installed software parameter data, system configuration parameter data, and the like. The specific setting can be preset according to the user-defined operation of the user.
According to the data transmission method provided by the embodiment, when a first electronic device collides, a pairing request is sent to a second electronic device according to a preset sending mode, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device contained in the pairing request, when the response information returned by the second electronic device is received, the first electronic device and the second electronic device establish data transmission connection, then target data are sent to the second electronic device based on the established data transmission connection, data transmission based on collision is realized, and a user can complete data interaction only by colliding the two electronic devices, so that the operation is simplified, the convenience of data transmission is improved, the user experience can be enhanced, and the product viscosity is improved.
Please refer to fig. 4, which is a schematic flow chart illustrating an implementation of a data transmission method according to another embodiment of the present application. The method can be applied to an electronic terminal for configuring a motion sensor and a wireless radio frequency module, such as: the mobile electronic terminal can be used for mobile data processing in the mobile process, such as a mobile phone, a tablet personal computer, a laptop, an intelligent wearable device (such as an intelligent bracelet, an intelligent watch and the like), or the non-mobile electronic terminal can be used for mobile data processing, such as a liquid crystal television, an all-in-one machine, a desktop computer and the like. The present embodiment is explained from the perspective of a data receiving side, and as shown in fig. 4, the method mainly includes:
401. when the second electronic device collides, recording the time information of the collision;
402. when a pairing request sent by a first electronic device is received, acquiring the time difference of collision between a second electronic device and the first electronic device according to the recorded time information and the time information of collision between the first electronic device and the first electronic device contained in the pairing request;
403. if the time difference is within the preset time range, returning response information to the first electronic device, wherein the response information is used for establishing data transmission connection with the first electronic device;
404. and receiving target data sent by the first electronic device through the data transmission connection, and storing the target data in the second electronic device.
The manner of detecting whether the second electronic device collides with the first electronic device is the same as that of the first electronic device, and reference may be specifically made to the related description in the embodiments shown in fig. 2 and fig. 3, which is not repeated herein.
Specifically, the second electronic device records the time information of the collision of the second electronic device when the collision occurs. When a pairing request sent by a first electronic device is received, calculating the time difference of the collision of the second electronic device and the first electronic device according to the recorded time information of the collision of the first electronic device and the time information of the collision of the first electronic device contained in the pairing request. Then, it is analyzed whether the time difference is within a preset time range (e.g., + -1 second). If the time difference is within the preset time range, it indicates that the first electronic device and the second electronic device are mutual collision objects, and then the second electronic device returns response information to the first electronic device, so that the first electronic device completes pairing according to the response information and establishes data transmission connection with the second electronic device.
The first electronic device transmits the target data to the second electronic device based on the established data transmission connection after establishing the data transmission connection with the second electronic device. The second electronic device receives the target data sent by the first electronic device and stores the target data in the second electronic device. Wherein the target data may include, but is not limited to, for example: picture data in the album, address book data, installed software parameter data, system configuration parameter data, and the like. The specific setting can be preset according to the user-defined operation of the user.
According to the data transmission method provided by the embodiment, when a first electronic device collides, a pairing request is sent to a second electronic device according to a preset sending mode, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device contained in the pairing request, when the response information returned by the second electronic device is received, the first electronic device and the second electronic device establish data transmission connection, then target data are sent to the second electronic device based on the established data transmission connection, data transmission based on collision is realized, and a user can complete data interaction only by colliding the two electronic devices, so that the operation is simplified, the convenience of data transmission is improved, the user experience can be enhanced, and the product viscosity is improved.
Please refer to fig. 5, which is a schematic flow chart illustrating an implementation of a data transmission method according to another embodiment of the present application. The method can be applied to an electronic terminal for configuring a motion sensor and a wireless radio frequency module, such as: the mobile electronic terminal can be used for mobile data processing in the mobile process, such as a mobile phone, a tablet personal computer, a laptop, an intelligent wearable device (such as an intelligent bracelet, an intelligent watch and the like), or the non-mobile electronic terminal can be used for mobile data processing, such as a liquid crystal television, an all-in-one machine, a desktop computer and the like. The present embodiment is explained from the perspective of a data receiving side, and as shown in fig. 5, the method mainly includes:
501. when a preset event is monitored, the second electronic device starts a collision data transmission function;
502. acquiring motion data of the second electronic device through the motion sensor in real time, and analyzing whether the second electronic device collides or not according to the motion data;
503. when the second electronic device collides, recording the time information of the collision;
specifically, the preset event may include, but is not limited to, for example: a click event for triggering a shortcut icon or button or menu for turning on the collision data transmission function, a pressing event of a shortcut physical key, a device shaking event (e.g., the second electronic device is shaken 3 times at a preset angle and direction), and the like. And the second electronic device monitors the preset event through a preset event monitor, and starts a collision data transmission function when the preset event is monitored.
Motion sensors may include, but are not limited to, for example, gravity sensors, gyroscopes, or acceleration sensors, among others. It will be appreciated that in the event of a collision there will be a sudden change of direction of the electronic device, i.e. the value of the electronic device in the X or Y axis as sensed by the motion sensor will be reversed, for example by 180 °.
Optionally, when the second electronic device collides, the second electronic device determines whether the collision data transmission function is activated, and if the collision data transmission function is activated, records collision time information, otherwise, ignores the collision and does not record the collision time information.
504. When a pairing request sent by a first electronic device is received, acquiring the signal intensity of the first electronic device, and analyzing whether the acquired signal intensity is greater than a preset intensity;
505. if the signal intensity is greater than the preset intensity, acquiring a time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision between the first electronic device and the first electronic device, wherein the time information is contained in the pairing request;
when a pairing request sent by a first electronic device is received, the signal strength of the first electronic device is obtained, whether the obtained signal strength is greater than a preset strength (such as-50 dBm) or not is analyzed, and if the obtained signal strength is greater than the preset strength, the fact that the first electronic device is closer to a second electronic device is indicated, and the second electronic device is likely to collide with the first electronic device. Then, the time difference between the second electronic device and the first electronic device is calculated according to the previously recorded time information of the collision of the second electronic device at the last time and the time information of the collision of the first electronic device included in the pairing request, and whether the time difference is within the preset time range or not is analyzed. Through the judgment of the signal intensity, the data mistransmission can be avoided, and the safety of data transmission is further improved.
Optionally, when the collision data transmission function is started, the second electronic device defaults to automatically process the pairing request when receiving the pairing request sent by the first electronic device. When the collision data transmission function is not turned on, the pairing request is ignored. Alternatively, in another embodiment of the present application, when receiving the pairing request sent by the first electronic device, the second electronic device outputs a selection prompt box, and then selects to return response information or not to return response information according to an operation of the user in the selection prompt box, so as to improve flexibility of the pairing operation.
Optionally, to further ensure the security of data transmission, in another embodiment of the present application, in a Wi-Fi network scenario, it is required to use a first electronic device as a wireless hotspot to which a second electronic device is accessed as a premise, when a pairing request sent by the first electronic device is received, besides determining signal strength, it is also determined whether the first electronic device is a wireless hotspot to which the second electronic device is accessed, and if the first electronic device is an accessed wireless hotspot, a time difference between the second electronic device and the first electronic device in a collision is obtained according to the recorded time information of the last collision of the second electronic device and the time information of the collision of the first electronic device included in the pairing request.
Optionally, in another embodiment of the present application, in a bluetooth scenario, when a pairing request broadcasted by a first electronic device based on a bluetooth protocol is received, a time difference between a collision of the second electronic device and a collision of the first electronic device is obtained according to recorded time information of a last collision of the second electronic device and time information of a collision of the first electronic device included in the pairing request.
It can be understood that, in practical applications, the execution sequence of the signal strength determination, the time difference analysis and the wireless hotspot determination is not in order.
506. If the time difference is within the preset time range, returning response information to the first electronic device, wherein the response information is used for establishing data transmission connection with the first electronic device;
507. and receiving target data sent by the first electronic device through the data transmission connection, and storing the target data in the second electronic device.
Specifically, if the time difference between the time when the first electronic device collides and the time when the second electronic device collides is within the preset time range, it indicates that the time when the first electronic device collides and the time when the second electronic device collides are very close to each other and should be the objects of collision with each other, and then the second electronic device returns a response message to the first electronic device.
And the first electronic device completes pairing with the second electronic device according to response information returned by the second electronic device, establishes data transmission connection with the second electronic device, and then sends the target data to the second electronic device based on the established data transmission connection. Wherein the target data may include, but is not limited to, for example: picture data in the album, address book data, installed software parameter data, system configuration parameter data, and the like. The specific setting can be preset according to the user-defined operation of the user.
And the second electronic device receives the target data sent by the first electronic device through the established data transmission connection and stores the target data in the second electronic device. Optionally, if the target data includes system configuration parameter data, the current system configuration parameter is adjusted to the system configuration parameter in the target data.
Taking a key switch as an example, after a user purchases a new machine, the collision data transmission function is simultaneously started in the new machine and an old machine, and then the old machine is taken as a wireless hotspot, and the new machine is accessed to the wireless hotspot, wherein at this moment, the old machine is taken as a master device, and the new machine is taken as a slave device. Then, the new machine collides with the old machine, the old machine as a main device sends pairing information containing collision time information recorded by the old machine to the new machine, the new machine acquires the signal intensity of the old machine, if the signal intensity of the old machine is greater than the preset intensity, the old machine determines that the old machine collides with the new machine according to the collision time information, then response information is returned to the old machine, the old machine completes pairing with the new machine according to the response information and establishes data transmission connection with the new machine, and then the established data transmission connection sends user personal data in the old machine to the new machine. And the new machine receives and stores the user personal data sent by the old machine, thereby completing the one-key-change.
According to the data transmission method provided by the embodiment, when a first electronic device collides, a pairing request is sent to a second electronic device according to a preset sending mode, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device contained in the pairing request, when the response information returned by the second electronic device is received, the first electronic device and the second electronic device establish data transmission connection, then target data are sent to the second electronic device based on the established data transmission connection, data transmission based on collision is realized, and a user can complete data interaction only by colliding the two electronic devices, so that the operation is simplified, the convenience of data transmission is improved, the user experience can be enhanced, and the product viscosity is improved.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device can be used to implement the data transmission method provided by the embodiment shown in fig. 2, and is applied to a first electronic device as a data sender. As shown in fig. 6, the electronic device mainly includes: a pairing module 601, an establishing module 602, and a data transmission module 603.
The pairing module 601 is configured to send a pairing request to a second electronic device in a preset sending manner when a collision occurs, where the pairing request includes time information of the collision, and the time information is used to assist the second electronic device in determining whether to return response information;
an establishing module 602, configured to establish a data transmission connection with the second electronic device when receiving a response message returned by the second electronic device;
a data transmission module 603, configured to send the target data to the second electronic device based on the established data transmission connection.
Further, the pairing module 601 includes:
the first sending module is used for sending a pairing request to a second electronic device accessed to a wireless hotspot if the first electronic device is the wireless hotspot when collision occurs;
and the second sending module is used for broadcasting the pairing request to the surrounding second electronic devices based on the Bluetooth protocol when the first electronic device collides when the data transmission task is triggered.
Optionally, the electronic device further includes an access module, configured to access a second electronic device to the wireless hotspot when the first electronic device is used as the wireless hotspot.
Further, the electronic device further includes:
the control module is used for starting a collision data transmission function in the first electronic device when a preset event is monitored;
the first analysis module is used for acquiring the motion data of the first electronic device through the motion sensor in real time and analyzing whether the first electronic device collides or not according to the motion data.
Further, the electronic device further includes:
the second analysis module is used for analyzing whether the collision object is the electronic device or not according to the motion data when the first electronic device collides;
the pairing module 601 is further configured to send a pairing request to the second electronic device in a preset sending manner if the collision object is the electronic device.
Further, the electronic device further includes:
the third analysis module is used for analyzing whether the motion direction of the first electronic device is a preset motion direction or not when the first electronic device collides according to the motion data;
the pairing module 601 is further configured to send a pairing request to the second electronic device in a preset sending manner if the moving direction of the first electronic device is the preset moving direction during collision.
Further, the establishing module 602 includes:
the signal analysis module is used for acquiring the signal intensity of the second electronic device returning the response information when receiving the response information returned by the second electronic device, and analyzing whether the acquired signal intensity is greater than the preset intensity;
and the connection module is used for establishing data transmission connection with the second electronic device if the signal intensity is greater than the preset intensity.
It should be noted that, in the embodiment of the electronic device illustrated in fig. 6, the division of the functional modules is only an example, and in practical applications, the above functions may be distributed by different functional modules according to needs, for example, configuration requirements of corresponding hardware or convenience of implementation of software, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above. In practical applications, the corresponding functional modules in this embodiment may be implemented by corresponding hardware, or may be implemented by corresponding hardware executing corresponding software. The above description principles can be applied to various embodiments provided in the present specification, and are not described in detail below.
For a specific process of each function module in the electronic device provided in this embodiment to implement each function, please refer to the specific contents described in the embodiments shown in fig. 2 and fig. 3, which is not described herein again.
The electronic device provided by this embodiment sends a pairing request to the second electronic device according to a preset sending method when a collision occurs through the first electronic device, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device included in the pairing request, and when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then sends target data to the second electronic device based on the established data transmission connection, so that data transmission based on the collision is realized, and a user can complete data interaction only by colliding the two electronic devices, thereby simplifying operation, improving convenience of data transmission, further enhancing user experience, and improving product viscosity.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device can be used to implement the data transmission method provided by the embodiment shown in fig. 4, and is applied to a second electronic device as a data receiver. As shown in fig. 7, the electronic device mainly includes: a recording module 701, an analyzing module 702, a sending module 703 and a receiving module 704.
A recording module 701, configured to record time information of a collision when the collision occurs;
an analysis module 702, configured to, when a pairing request sent by a first electronic device is received, obtain a time difference between a collision of the second electronic device and the first electronic device according to recorded time information and time information of the collision of the first electronic device included in the pairing request, and analyze whether the time difference is within a preset time range;
a sending module 703, configured to return response information to the first electronic apparatus if the time difference is within a preset time range, where the response information is used to establish a data transmission connection with the first electronic apparatus;
a receiving module 704, configured to receive target data sent by the first electronic device through the data transmission connection, and store the target data in the second electronic device.
Further, the electronic device further includes:
the signal analysis module is used for acquiring the signal intensity of the first electronic device when receiving a pairing request sent by the first electronic device and analyzing whether the acquired signal intensity is greater than preset intensity;
the analyzing module 702 is further configured to, if the signal strength is greater than the preset strength, obtain a time difference between the second electronic device and the first electronic device according to the recorded time information and the time information of the collision of the first electronic device included in the pairing request.
Further, the electronic device further includes:
the control module is used for starting a collision data transmission function in the second electronic device when a preset event is monitored;
and the collision analysis module is used for acquiring the motion data of the second electronic device through the motion sensor in real time and analyzing whether the second electronic device collides or not according to the motion data.
Further, the analysis module 702 includes:
the hotspot analysis module is used for judging whether the first electronic device is a wireless hotspot accessed by a second electronic device when receiving a pairing request sent by the first electronic device;
the first computing module is used for obtaining the time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision between the first electronic device and the first electronic device, wherein the time information is contained in the pairing request;
and the second calculating module is used for obtaining the time difference of the collision between the second electronic device and the first electronic device according to the recorded time information and the time information of the collision between the first electronic device and the first electronic device, which is contained in the pairing request, when the pairing request broadcasted by the first electronic device based on the Bluetooth protocol is received.
Optionally, the electronic device further includes an access module, configured to access the wireless hotspot when the first electronic device is used as the wireless hotspot.
For a specific process of each function module in the electronic device provided in this embodiment to implement each function, please refer to the specific contents described in the embodiments shown in fig. 4 and fig. 5, which is not described herein again.
The electronic device provided by this embodiment sends a pairing request to the second electronic device according to a preset sending method when a collision occurs through the first electronic device, the second electronic device determines whether to return response information according to time information of the collision of the first electronic device included in the pairing request, and when receiving the response information returned by the second electronic device, the first electronic device establishes a data transmission connection with the second electronic device, and then sends target data to the second electronic device based on the established data transmission connection, so that data transmission based on the collision is realized, and a user can complete data interaction only by colliding the two electronic devices, thereby simplifying operation, improving convenience of data transmission, further enhancing user experience, and improving product viscosity.
Referring to fig. 8, fig. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
The electronic apparatus described in this embodiment includes:
a memory 801, a processor 802 and a computer program stored on the memory 801 and operable on the processor 802, which when executed by the processor 802, implement the data transmission method described in the embodiments of fig. 2 to 5.
Further, the electronic device further includes:
at least one input device 803 and at least one output device 804.
The memory 801, the processor 802, the input device 803, and the output device 804 are connected by a bus 805.
The input device 803 may be a camera, a touch panel, a physical button, or the like. The output device 804 may specifically be a display screen.
The Memory 801 may be a high-speed Random Access Memory (RAM) Memory or a non-volatile Memory (non-volatile Memory), such as a disk Memory. The memory 801 is used to store a set of executable program code, and the processor 802 is coupled to the memory 801.
Further, an embodiment of the present application also provides a computer-readable storage medium, where the computer-readable storage medium may be provided in an electronic device in the foregoing embodiments, and the computer-readable storage medium may be the memory in the foregoing embodiment shown in fig. 8. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the data transmission method described in the embodiments of fig. 2 to 5.
For example, the electronic device may be any of various types of computer system apparatuses that are mobile or portable and perform wireless communication. In particular, the electronic apparatus may be a mobile phone or a smart phone (e.g., iPhone-based, Android-based phone), a portable game device (e.g., Nintendo DS, playstatio portable, Gameboy Advance, iPhone), a laptop, a PDA, a portable internet appliance, a music player, and a data storage device, other handheld devices, and a head-mounted device (HMD) such as a watch, a headset, a pendant, a headset, etc., and other wearable devices (e.g., electronic glasses, electronic clothes, an electronic bracelet, an electronic necklace, an electronic tattoo, an electronic device, or a smart watch).
The electronic apparatus may also be any of a number of electronic devices including, but not limited to, cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, video recorders, cameras, other media recorders, radios, medical devices, vehicle transportation equipment, calculators, programmable remote controllers, pagers, laptop computers, desktop computers, printers, netbook computers, Personal Digital Assistants (PDAs), Portable Multimedia Players (PMPs), moving picture experts group (MPEG-1 or MPEG-2) audio layer 3(MP3) players, portable medical devices, and digital cameras and combinations thereof.
In some cases, the electronic device may perform a variety of functions (e.g., playing music, displaying video, storing pictures, and receiving and sending telephone calls). If desired, the electronic apparatus may be a portable device such as a cellular telephone, media player, other handheld device, wristwatch device, pendant device, earpiece device, or other compact portable device.
As shown in fig. 9, the electronic device 10 may include control circuitry, which may include storage and processing circuitry 30. The storage and processing circuitry 30 may include memory, such as hard drive memory, non-volatile memory (e.g., flash memory or other electronically programmable erase limit memory used to form solid state drives, etc.), volatile memory (e.g., static or dynamic random access memory, etc.), and so forth, although the embodiments of the present application are not limited thereto. Processing circuitry in the storage and processing circuitry 30 may be used to control the operation of the electronic device 10. The processing circuitry may be implemented based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
The storage and processing circuitry 30 may be used to run software within the electronic device 10 such as, for example, an Internet browsing application, a Voice Over Internet Protocol (VOIP) telephone call application, an email application, a media playing application, operating system functions, etc. Such software may be used to perform control operations such as, for example, camera-based image capture, ambient light measurement based on an ambient light sensor, proximity sensor measurement based on a proximity sensor, information display functionality based on status indicators such as status indicator lights of light emitting diodes, touch event detection based on a touch sensor, functionality associated with displaying information on multiple (e.g., layered) displays, operations associated with performing wireless communication functions, operations associated with collecting and generating audio signals, control operations associated with collecting and processing button press event data, and other functions in the electronic device 10, and the like, without limitation of the embodiments of the present application.
The electronic device 10 may also include input-output circuitry 42. The input-output circuitry 42 may be used to enable the electronic device 10 to enable input and output of data, i.e., to allow the electronic device 10 to receive data from external devices and also to allow the electronic device 10 to output data from the electronic device 10 to external devices. The input-output circuitry 42 may further include the sensor 32. The sensors 32 may include ambient light sensors, optical and capacitive based proximity sensors, touch sensors (e.g., optical based touch sensors and/or capacitive touch sensors, where the touch sensors may be part of a touch display screen or may be used independently as a touch sensor structure), acceleration sensors, and other sensors, among others.
Input-output circuitry 42 may also include one or more displays, such as display 14. The display 14 may include one or a combination of liquid crystal displays, organic light emitting diode displays, electronic ink displays, plasma displays, displays using other display technologies. The display 14 may include an array of touch sensors (i.e., the display 14 may be a touch display screen). The touch sensor may be a capacitive touch sensor formed by a transparent touch sensor electrode (e.g., an Indium Tin Oxide (ITO) electrode) array, or may be a touch sensor formed using other touch technologies, such as acoustic wave touch, pressure sensitive touch, resistive touch, optical touch, and the like, and the embodiments of the present application are not limited thereto.
The electronic device 10 may also include an audio component 36. The audio component 36 may be used to provide audio input and output functionality for the electronic device 10. Audio components 36 in electronic device 10 may include speakers, microphones, buzzers, tone generators, and other components for generating and detecting sound.
The communication circuitry 38 may be used to provide the electronic device 10 with the ability to communicate with external devices. The communication circuit 38 may include analog and digital input-output interface circuits, and wireless communication circuits based on radio frequency signals and/or optical signals. The wireless communication circuitry in communication circuitry 38 may include radio-frequency transceiver circuitry, power amplifier circuitry, low noise amplifiers, switches, filters, and antennas. For example, the wireless Communication circuitry in Communication circuitry 38 may include circuitry to support Near Field Communication (NFC) by transmitting and receiving Near Field coupled electromagnetic signals. For example, the communication circuitry 38 may include a near field communication antenna and a near field communication transceiver. The communications circuitry 38 may also include a cellular telephone transceiver and antenna, a wireless local area network transceiver circuit and antenna, and the like.
The electronic device 10 may further include a battery, power management circuitry, and other input-output units 40. The input-output unit 40 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, etc.
A user may enter commands through input-output circuitry 42 to control the operation of electronic device 10, and may use output data of input-output circuitry 42 to enable receipt of status information and other outputs from electronic device 10.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a readable storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned readable storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In view of the above description of the data transmission method, the electronic device and the computer-readable storage medium provided by the present application, those skilled in the art will recognize that the embodiments of the present application can be modified in different ways.

Claims (12)

1. A method of data transmission, the method comprising:
when a first electronic device collides, sending a pairing request to a second electronic device in a preset sending mode, wherein the pairing request comprises time information of the collision, and the time information is used for assisting the second electronic device to determine whether response information is returned or not;
when response information returned by the second electronic device is received, establishing data transmission connection with the second electronic device;
transmitting target data to the second electronic device based on the established data transmission connection;
when the first electronic device collides, before sending a pairing request to the second electronic device in a preset sending mode, the method includes:
when a preset event is monitored, the first electronic device starts a collision data transmission function;
acquiring motion data of the first electronic device through a motion sensor in real time, and analyzing whether the first electronic device collides or not according to the motion data;
when the first electronic device collides, analyzing whether a collision object is an electronic device or not according to the motion data;
and if the collision object is the electronic device, executing the step of sending a pairing request to a second electronic device in a preset sending mode.
2. The method of claim 1, wherein the first electronic device sends a pairing request to a second electronic device in a preset sending manner when a collision occurs, and the method comprises:
when collision occurs, if the first electronic device is a wireless hotspot, the first electronic device sends the pairing request to a second electronic device accessed to the wireless hotspot; alternatively, the first and second electrodes may be,
when the data transmission task is triggered, the first electronic device broadcasts the pairing request to the surrounding second electronic devices based on the Bluetooth protocol when a collision occurs.
3. The method of claim 1, wherein before sending the pairing request to the second electronic device by a preset sending manner, the method further comprises:
when the first electronic device collides, analyzing whether the movement direction of the first electronic device is a preset movement direction or not according to the movement data;
and if the motion direction of the first electronic device is the preset motion direction when the collision occurs, executing the step of sending a pairing request to a second electronic device through a preset sending mode.
4. The method according to claim 1, wherein the establishing a data transmission connection with the second electronic device when receiving the response message returned by the second electronic device specifically includes:
when response information returned by the second electronic device is received, acquiring the signal intensity of the second electronic device returning the response information, and analyzing whether the acquired signal intensity is greater than preset intensity;
and if the signal intensity is greater than the preset intensity, establishing data transmission connection with the second electronic device.
5. A method of data transmission, the method comprising:
when the second electronic device collides, recording the time information of the collision;
when a pairing request sent by a first electronic device is received, acquiring the time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision of the first electronic device contained in the pairing request;
if the time difference is within a preset time range, returning response information to the first electronic device, wherein the response information is used for establishing data transmission connection with the first electronic device;
receiving target data sent by the first electronic device through the data transmission connection, and storing the target data in the second electronic device;
when the second electronic device collides, before recording the time information of the collision, the method comprises the following steps:
when a preset event is monitored, the second electronic device starts a collision data transmission function;
and acquiring the motion data of the second electronic device through a motion sensor in real time, and analyzing whether the second electronic device collides or not according to the motion data.
6. The method according to claim 5, wherein before obtaining the time difference between the collision of the second electronic device and the first electronic device according to the recorded time information and the time information of the collision of the first electronic device included in the pairing request, the method further comprises:
when a pairing request sent by a first electronic device is received, acquiring the signal intensity of the first electronic device, and analyzing whether the acquired signal intensity is greater than a preset intensity;
and if the signal intensity is greater than the preset intensity, executing the step of obtaining the time difference of the collision between the second electronic device and the first electronic device according to the recorded time information and the time information of the collision between the first electronic device and the first electronic device contained in the pairing request.
7. The method of claim 5, wherein the second electronic device, prior to recording the time information of the collision at the time of the collision, comprises:
when a preset event is monitored, the second electronic device starts a collision data transmission function;
and acquiring the motion data of the second electronic device through a motion sensor in real time, and analyzing whether the second electronic device collides or not according to the motion data.
8. The method according to any one of claims 5 to 7, wherein when receiving a pairing request sent by a first electronic device, obtaining a time difference between a collision of the second electronic device and the first electronic device according to the recorded time information and the time information of the collision of the first electronic device included in the pairing request comprises:
when a pairing request sent by a first electronic device is received, if the first electronic device is an accessed wireless hotspot, obtaining the time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision between the first electronic device and the first electronic device contained in the pairing request; alternatively, the first and second electrodes may be,
when a pairing request broadcasted by the first electronic device based on a Bluetooth protocol is received, the time difference of the collision between the second electronic device and the first electronic device is obtained according to the recorded time information and the time information of the collision between the first electronic device and the first electronic device contained in the pairing request.
9. An electronic apparatus, applied to a first electronic apparatus as a data sender, comprising:
the system comprises a pairing module, a sending module and a sending module, wherein the pairing module is used for sending a pairing request to a second electronic device in a preset sending mode when collision occurs, the pairing request comprises time information of the collision, and the time information is used for assisting the second electronic device to determine whether response information is returned or not;
the establishing module is used for establishing data transmission connection with the second electronic device when response information returned by the second electronic device is received;
the data transmission module is used for transmitting the target data to the second electronic device based on the established data transmission connection;
in the pairing module, before the first electronic device sends a pairing request to the second electronic device in a preset sending mode when the first electronic device collides, the pairing module includes:
when a preset event is monitored, the first electronic device starts a collision data transmission function;
acquiring motion data of the first electronic device through a motion sensor in real time, and analyzing whether the first electronic device collides or not according to the motion data;
when the first electronic device collides, analyzing whether a collision object is an electronic device or not according to the motion data;
and if the collision object is the electronic device, executing the step of sending a pairing request to a second electronic device in a preset sending mode.
10. An electronic device, applied to a second electronic device as a data receiver, comprising:
the recording module is used for recording the time information of collision when the collision occurs;
the system comprises an analysis module, a first electronic device and a second electronic device, wherein the analysis module is used for obtaining the time difference of collision between the second electronic device and the first electronic device according to the recorded time information and the time information of collision of the first electronic device contained in the pairing request when receiving the pairing request sent by the first electronic device, and analyzing whether the time difference is within a preset time range;
the sending module is used for returning response information to the first electronic device if the time difference is within a preset time range, wherein the response information is used for establishing data transmission connection with the first electronic device;
the receiving module is used for receiving target data sent by the first electronic device through the data transmission connection and storing the target data in the second electronic device;
in the recording module, before the second electronic device records the time information of the collision when the collision occurs, the method includes:
when a preset event is monitored, the second electronic device starts a collision data transmission function;
and acquiring the motion data of the second electronic device through a motion sensor in real time, and analyzing whether the second electronic device collides or not according to the motion data.
11. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the data transmission method according to any of claims 1 to 4 or according to any of claims 5 to 8 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a data transmission method according to any one of claims 1 to 4 or according to any one of claims 5 to 8.
CN201810789122.1A 2018-07-18 2018-07-18 Data transmission method, electronic device and computer readable storage medium Active CN109067984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810789122.1A CN109067984B (en) 2018-07-18 2018-07-18 Data transmission method, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810789122.1A CN109067984B (en) 2018-07-18 2018-07-18 Data transmission method, electronic device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109067984A CN109067984A (en) 2018-12-21
CN109067984B true CN109067984B (en) 2020-08-28

Family

ID=64817115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810789122.1A Active CN109067984B (en) 2018-07-18 2018-07-18 Data transmission method, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109067984B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333276B (en) * 2020-11-09 2021-09-14 珠海格力电器股份有限公司 Network access method, system, storage medium and electronic device
CN112867175A (en) * 2021-02-23 2021-05-28 Oppo广东移动通信有限公司 Device connection method, device, electronic device and storage medium
CN115250376A (en) * 2021-04-27 2022-10-28 华为技术有限公司 Collision interaction method between electronic equipment and electronic equipment
CN113194417B (en) * 2021-04-30 2022-03-15 深圳市欢太科技有限公司 Device connection method and device, computer device and storage medium
CN113472945B (en) * 2021-07-12 2022-08-02 交互未来(北京)科技有限公司 Data transmission method and system based on collision detection and mobile equipment
CN115529576B (en) * 2022-01-13 2023-07-25 荣耀终端有限公司 Collision connection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003152861A (en) * 2001-11-08 2003-05-23 Namco Ltd Mobile terminal, mobile communication controller, program, and information storage medium
CN102545964A (en) * 2010-12-16 2012-07-04 国民技术股份有限公司 Communication method and system for triggering information interaction by collision
CN102869121A (en) * 2012-09-24 2013-01-09 东莞宇龙通信科技有限公司 Method and device for automatically establishing wireless connection
CN107135476A (en) * 2017-06-27 2017-09-05 飞天诚信科技股份有限公司 A kind of Bluetooth adapter and its method of work

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003152861A (en) * 2001-11-08 2003-05-23 Namco Ltd Mobile terminal, mobile communication controller, program, and information storage medium
CN102545964A (en) * 2010-12-16 2012-07-04 国民技术股份有限公司 Communication method and system for triggering information interaction by collision
CN102869121A (en) * 2012-09-24 2013-01-09 东莞宇龙通信科技有限公司 Method and device for automatically establishing wireless connection
CN107135476A (en) * 2017-06-27 2017-09-05 飞天诚信科技股份有限公司 A kind of Bluetooth adapter and its method of work

Also Published As

Publication number Publication date
CN109067984A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109067984B (en) Data transmission method, electronic device and computer readable storage medium
CN109271121B (en) Application display method and mobile terminal
TWI663541B (en) Mobile terminal, fingerprint identification control method and device, computer-readable storage medium and computer program product
CN109495871B (en) Bluetooth connection control method, electronic device and computer readable storage medium
CN108279948B (en) Application program starting method and mobile terminal
CN106921791B (en) Multimedia file storage and viewing method and device and mobile terminal
US20220159777A1 (en) Method for network control and related products
CN109240551B (en) Method for controlling electronic device by using gestures and related product
CN110109759B (en) Catton optimization method, server, electronic device and computer-readable storage medium
CN108834132B (en) Data transmission method and equipment and related medium product
CN108958593B (en) Method for determining communication object and mobile terminal
CN108616772B (en) Bullet screen display method, terminal and server
CN110475020B (en) Equipment control method and related product
CN110865745A (en) Screen capturing method and terminal equipment
CN103813127A (en) Video call method, terminal and system
CN110908728B (en) Authority configuration method and related product
CN109032732B (en) Notification display method and device, storage medium and electronic equipment
US11520841B2 (en) Information recommendation method, terminal device, and server
CN109348062B (en) Emergency call implementation method, electronic device and computer-readable storage medium
CN109684011B (en) Interface display control method, electronic device and computer readable storage medium
CN111131607A (en) Information sharing method, electronic equipment and computer readable storage medium
CN109067975B (en) Contact person information management method and terminal equipment
US11327639B2 (en) Split view exiting method, split view exiting device, and electronic device
CN111309392B (en) Equipment control method and electronic equipment
CN108966290B (en) Network connection method and related product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant