Data transmission method and electronic device
The electronic device's dual-antenna system simplifies and secures data transfer by switching antennas and using encryption, addressing the complexity and security issues of existing methods.
Patent Information
- Application Number
- CN202010899646.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-08-31
Smart Images

Figure CN114205812B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a data transmission method and electronic device. Background Art
[0002] In real life, there are many scenarios where data from one device needs to be transferred to another device. For example, when replacing a new device, the configuration information of the old device needs to be sent to the new device. For another example, when multiple IoT devices of the same model are newly purchased, the configuration information of the IoT device that has been set up needs to be cloned to other IoT devices.
[0003] At present, it is generally necessary to rely on a third-party device (such as a device with cloned application software installed, or a gateway device, or a server) to complete the data transmission between two devices. Specifically, the device sending data first establishes a connection with the third-party device and sends the data to be sent to the third-party device. Then, the third-party device establishes a connection with the device receiving the data, and then forwards the data to be sent to the device receiving the data. It can be seen that the user needs to perform multiple connections, export and import data on multiple devices, which is cumbersome. In addition, when the data to be transmitted is sensitive data such as network configuration information, device configuration information, and user data, there is a risk of leakage when the data to be transmitted is exported and cached on a third-party device. Summary of the invention
[0004] The present application provides a data transmission method that can simplify the complexity of user operations while improving the security of data transmission.
[0005] In the first aspect, an electronic device for data transmission is provided. The electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; and one or more computer programs, wherein the one or more computer programs are stored on the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: receiving an input; in response to the input, sending a first message through the first antenna in a first period; receiving a second message from another electronic device; in response to the second message, switching to the second antenna, and sending a third message through the second antenna in a second period; wherein the third message contains specific data; after receiving the message of the success of the specific data transmission from the other electronic device, or after sending the third message, prompting the success of the specific data transmission. In this way, the security of communication can be improved, the rapid transmission of specific data can be achieved, and the complexity of user operations can be reduced.
[0006] In the second aspect, an electronic device for data transmission is provided. The electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; and one or more computer programs, wherein the one or more computer programs are stored on the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: receiving an input; in response to the input, sending a first message in a first period through the first antenna; receiving a second message from another electronic device; in response to the second message, obtaining a first random number from the second message, generating a second random number, and switching to the second antenna, sending a third message containing the second random number through the second antenna; generating a session key according to the first random number and the second random number, using the session key to encrypt the specific data, and sending a fourth message to the other electronic device, the fourth message including the encrypted specific data. In this way, the security of communication can be improved, and the key negotiation process can be simplified, thereby realizing the rapid transmission of specific data. Furthermore, it can be noted that during the key negotiation process, the user does not need to manually enter information such as a verification code, which also reduces the complexity of user operations.
[0007] According to the second aspect, after receiving the message of the success of the transmission of the specific data from the other electronic device, or after sending the fourth message, the electronic device prompts that the specific data is successfully transmitted. In this way, the electronic device prompts, so that the user of the electronic device can learn that the transmission is successful.
[0008] According to the second aspect, or any implementation of the second aspect above, the using the session key to encrypt the specific data and sending the fourth message to the other electronic device specifically includes: switching to the first antenna of the electronic device and sending the fourth message through the first antenna of the electronic device. In this way, the user of the electronic device does not need to keep the electronic device and the other electronic device within a preset safe distance, and the specific data can be transmitted at a longer distance.
[0009] According to the second aspect, or any implementation of the second aspect above, the electronic device further executes: the fourth message also includes a first integrity check value of the specific data. In this way, by calculating the integrity check value for the specific data, it is further ensured that the specific data has not been tampered with, thereby improving the security of data transmission.
[0010] According to the second aspect, or any implementation of the second aspect above, the prompting of the successful transmission of the specific data includes: displaying a message of the successful transmission of the specific data, and / or playing a voice message of the successful transmission of the specific data. In this way, the specific form of prompting the specific data transmission project is refined.
[0011] According to the second aspect, or any implementation of the second aspect above, the specific data includes at least one of configuration information and user data; wherein the configuration information includes one or more of network configuration information, sensor alarm threshold setting information, alarm trigger action information, silent time setting information, timer setting information, firmware upgrade setting information, and power usage threshold setting information; the user data includes one or more of application installation data, photos, videos, recordings, and files stored on the electronic device, and operation logs of the electronic device. In this way, the specific information of some specific data is listed.
[0012] In a third aspect, an electronic device is provided. The electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, wherein the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; and one or more computer programs, wherein the one or more computer programs are stored on the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following operations: receiving an input; receiving a first message from another electronic device; in response to the first message, switching to the second antenna, generating a first random number, and sending a second message including the first random number through the second antenna in a second period; receiving a third message from the other electronic device; in response to the third message, obtaining the second random number from the third message, and generating a session key according to the first random number and the second random number; receiving a fourth message from the other electronic device; in response to the fourth message, obtaining encrypted specific data from the fourth message, and decrypting the specific data using the session key. In this way, from the perspective of the receiving electronic device, the security of communication can be improved, specific data can be transmitted quickly, and the complexity of user operations can be reduced.
[0013] According to the third aspect, or any implementation of the third aspect above, the electronic device further performs: receiving the first integrity check value of the specific data sent by the other electronic device, calculating the second integrity check value of the specific data; after the second integrity check value is equal to the first integrity check value, sending a message to the other electronic device indicating that the specific data has been successfully transmitted. Thus, by calculating the integrity check value for the specific data, it is further ensured that the specific data has not been tampered with, thereby improving the security of data transmission.
[0014] According to the third aspect, or any implementation of the third aspect above, sending the message that the specific data is successfully transmitted to the other electronic device specifically includes: switching to the first antenna and using the first antenna to send the message that the specific data is successfully transmitted. In this way, the specific transmission method is refined.
[0015] In a fourth aspect, an electronic device is provided. The electronic device is not connected to a routing device or a hotspot, and the electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, and the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; and one or more computer programs, wherein the one or more computer programs are stored on the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following operations: receiving an input; receiving a first message from another electronic device; in response to the first message, switching to the second antenna, and sending a second message through the second antenna; wherein the second message includes specific data of the electronic device; after receiving a message that the specific data transmission of the other electronic device is successful, or after sending the second message, prompting that the specific data transmission is successful. In this way, the security of communication can be improved, the specific data can be quickly transmitted, and the complexity of user operations can be reduced.
[0016] In a fifth aspect, an electronic device is provided. The electronic device is not connected to a routing device or a hotspot, and the electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, and the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; and one or more computer programs, wherein the one or more computer programs are stored on the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following operations: receiving an input; receiving a first message from another electronic device; in response to the first message, switching to the second antenna, and sending a second message through the second antenna; receiving a response message to the second message from the other electronic device; in response to the response message, switching to the first antenna, and sending a third message containing specific data through the first antenna; after receiving a message that the specific data transmission is successful from the other electronic device, or after sending the third message, prompting that the specific data transmission is successful. In this way, the security of communication can be improved, and it is also conducive to simplifying the process of key negotiation, thereby realizing the rapid transmission of specific data. Furthermore, it can be noted that during the key negotiation process, the user does not need to manually enter information such as a verification code, which also reduces the complexity of user operations.
[0017] According to the fifth aspect, the second message includes a session key, and the third message includes specific data encrypted by the session key. In this way, security is further increased by means of a key.
[0018] According to the fifth aspect, or any implementation of the fifth aspect, the session key is preset, and the specific data is a log of the electronic device. In this way, the specific form of the specific data is refined.
[0019] In a sixth aspect, a data transmission method is provided. The method is applied to an electronic device, the electronic device comprising: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method comprises: receiving an input; in response to the input, sending a first message through the first antenna in a first period; receiving a second message from another electronic device; in response to the second message, switching to the second antenna, and sending a third message through the second antenna in a second period; wherein the third message contains specific data; after receiving a message from the other electronic device indicating that the specific data transmission is successful, or after sending the third message, prompting that the specific data transmission is successful.
[0020] In a seventh aspect, a data transmission method is provided. The method is applied to an electronic device, the electronic device comprising: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method comprises: receiving an input; in response to the input, sending a first message in a first period through the first antenna; receiving a second message from another electronic device; in response to the second message, obtaining a first random number from the second message, generating a second random number, and switching to the second antenna, sending a third message including the second random number through the second antenna; generating a session key according to the first random number and the second random number, encrypting the specific data using the session key, and sending a fourth message to the other electronic device, the fourth message including the encrypted specific data.
[0021] According to the seventh aspect, after receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the fourth message, a prompt is given that the specific data transmission is successful.
[0022] According to the seventh aspect, or any implementation method of the seventh aspect above, the using the session key to encrypt the specific data and send the fourth message to the other electronic device specifically includes: switching to the first antenna of the electronic device, and sending the fourth message through the first antenna of the electronic device.
[0023] According to the seventh aspect, or any implementation of the seventh aspect above, the method further includes: the fourth message also includes a first integrity check value of the specific data.
[0024] According to the seventh aspect, or any implementation method of the seventh aspect above, the prompt that the specific data is successfully transmitted includes: displaying a message that the specific data is successfully transmitted, and / or playing a voice message that the specific data is successfully transmitted.
[0025] According to the seventh aspect, or any implementation method of the above seventh aspect, the specific data includes at least one item of configuration information and user data; wherein the configuration information includes one or more of network configuration information, sensor alarm threshold setting information, alarm trigger action information, silent time setting information, timer setting information, firmware upgrade setting information and power consumption threshold setting information; the user data includes one or more of the installation data of the application, photos, videos, recordings and files stored on the electronic device, and the operation log of the electronic device.
[0026] In an eighth aspect, a data transmission method is provided. The method is applied to an electronic device, the electronic device comprising: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method comprises: receiving an input; receiving a first message from another electronic device; in response to the first message, switching to the second antenna, generating a first random number, and sending a second message including the first random number through the second antenna in a second period; receiving a third message from the other electronic device; in response to the third message, obtaining the second random number from the third message, and generating a session key according to the first random number and the second random number; receiving a fourth message from the other electronic device; in response to the fourth message, obtaining the encrypted specific data from the fourth message, and decrypting the specific data using the session key.
[0027] According to the eighth aspect, the method also includes: receiving a first integrity check value of the specific data sent by the other electronic device, calculating a second integrity check value of the specific data; after the second integrity check value is equal to the first integrity check value, sending a message that the specific data has been successfully transmitted to the other electronic device.
[0028] According to the eighth aspect, or any implementation method of the eighth aspect above, sending a message that the specific data transmission is successful to the other electronic device specifically includes: switching to the first antenna, and using the first antenna to send the message that the specific data transmission is successful.
[0029] In the ninth aspect, a data transmission method is provided. The method is applied to an electronic device, the electronic device is not connected to a routing device or a hotspot, and the electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method includes: receiving an input; receiving a first message from another electronic device; in response to the first message, switching to the second antenna, and sending a second message through the second antenna; wherein the second message includes specific data of the electronic device; after receiving a message from the other electronic device indicating that the specific data transmission is successful, or after sending the second message, prompting that the specific data transmission is successful.
[0030] In the tenth aspect, a data transmission method is provided. The method is applied to an electronic device, the electronic device is not connected to a routing device or a hotspot, and the electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, and the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method includes: receiving an input; receiving a first message from another electronic device; in response to the first message, switching to the second antenna and sending a second message through the second antenna; receiving a response message from the other electronic device to the second message; in response to the response message, switching to the first antenna and sending a third message containing specific data through the first antenna; after receiving a message from the other electronic device indicating that the specific data transmission is successful, or after sending the third message, prompting that the specific data transmission is successful.
[0031] According to the tenth aspect, the second message includes a session key, and the third message contains specific data encrypted by the session key.
[0032] According to the tenth aspect, or any implementation of the tenth aspect above, the session key is pre-set; and the specific data is a log of the electronic device.
[0033] The sixth aspect and any one of its implementations, the seventh aspect and any one of its implementations, the eighth aspect and any one of its implementations, the ninth aspect and any one of its implementations, the tenth aspect and any one of its implementations and the corresponding technical effects can be found in the above-mentioned corresponding aspects and any one of the implementations in the corresponding aspects and the corresponding technical effects, which will not be repeated here.
[0034] In an eleventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes a computer program, and when the computer program is executed on an electronic device, the electronic device executes the method of the sixth aspect and any one of the implementations of the sixth aspect, the seventh aspect and any one of the implementations of the seventh aspect, the eighth aspect and any one of the implementations of the eighth aspect, the ninth aspect and any one of the implementations of the ninth aspect, and the tenth aspect and any one of the implementations of the tenth aspect.
[0035] In the twelfth aspect, a computer program product is provided, which, when running on a computer, enables the computer to execute a method such as the sixth aspect and any one of the implementations of the sixth aspect, the seventh aspect and any one of the implementations of the seventh aspect, the eighth aspect and any one of the implementations of the eighth aspect, the ninth aspect and any one of the implementations of the ninth aspect, and the tenth aspect and any one of the implementations of the tenth aspect.
[0036] The twelfth aspect and any one of the implementation methods and corresponding technical effects of the twelfth aspect can be found in the above-mentioned corresponding aspects and any one of the implementation methods and corresponding technical effects of the corresponding aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of a data transmission process provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of a data transmission process provided in an embodiment of the present application;
[0042] Figure 6 A schematic diagram of a data transmission process provided in an embodiment of the present application;
[0043] Figure 7 A schematic diagram of a data transmission process provided in an embodiment of the present application;
[0044] Figure 8 Schematic diagrams of some graphical user interfaces of electronic devices provided in embodiments of the present application;
[0045] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0046] Fig.10 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In the description of the embodiments of the present application, unless otherwise specified, " / " means or. For example, A / B can represent A or B. "And / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more. In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0048] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the first electronic device 100 and the second electronic device 200 can perform wireless communication.
[0049] Exemplarily, in the embodiment of the present application, the first electronic device 100 can be a mobile device, a household appliance or a sensor device. For example, the first electronic device 100 can be a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a netbook, a wearable device (such as a smart watch, a smart bracelet), an augmented reality (AR) device, a virtual reality (VR) device, a vehicle-mounted device, a smart screen, a smart speaker, a smart camera and other mobile devices. For another example, the first electronic device 100 can be a smart refrigerator, a smart TV, a smart lamp, a smart socket, a smart air purifier, a humidifier, a smart range hood, a smart door lock, a smart plug board, a smart induction cooker, a smart fan, a smart disinfection box, a smart aromatherapy machine and other smart home appliances. For another example, the first electronic device 100 can also be a smoke sensor, a gas sensor, a human body sensor, a temperature sensor, a humidity sensor, a door and window sensor, a PM2.5 air sensor, a door and window switch sensor, an emergency button, an alarm and other sensor devices. The second electronic device 200 may also be any one of a mobile device, a home appliance or a sensor device. The embodiment of the present application does not limit the specific forms of the first electronic device 100 and the second electronic device 200.
[0050] The structure of the first electronic device 100 is described below. It should be noted that the second electronic device 200 may also refer to the structure of the first electronic device 100, but the second electronic device 200 may include more or fewer components than the first electronic device 100, or combine some components, or split some components, or arrange the components differently. The second electronic device 200 may be an electronic device of the same form as the first electronic device 100, or may be an electronic device of a different form, which is not limited in the embodiments of the present application.
[0051] Please refer to Figure 2 , Figure 2 The first electronic device 100 is a schematic diagram of the structure of the first electronic device 100 provided in an embodiment of the present application. The first electronic device 100 may include one or more processors 110, one or more memories 120, one or more communication interfaces 130, a wireless communication module 140, and one or more antennas. The processor 110, the memory 120, the communication interface 130, and the wireless communication module 140 are connected via a bus.
[0052] The processor 110 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or an integrated circuit for controlling the execution of the program of the present application. In one example, the processor 110 may include multiple CPUs, and the processor 110 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor in a single-core processor or a multi-core processor may refer to one or more devices, circuits, or processing cores for processing data (e.g., computer program instructions).
[0053] The memory 120 may be used to store computer executable program codes, which may include instructions. The internal memory may include a program storage area and a data storage area. The program storage area may store an operating system and programs or instructions required to be used in the embodiments of the present application.
[0054] The communication interface 130 may be used to communicate with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc. In some examples, the first electronic device 100 may not include the communication interface 130, which is not limited in the embodiments of the present application.
[0055] The wireless communication module 140 can provide wireless communication solutions including WLAN (such as Wi-Fi network), Bluetooth, NFC, infrared technology, etc. applied to the first electronic device 100. The wireless communication module 140 can be one or more devices integrating at least one communication processing module. The wireless communication module 140 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 140 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna.
[0056] In some embodiments, Figure 2 As shown, the first electronic device 100 includes at least two antennas, such as antenna 1 (first antenna, also called strong antenna) and antenna 2 (second antenna, also called weak antenna). The wireless communication module 140 can switch between antenna 1 and antenna 2. The transmission power applied to antenna 1 or antenna 2 is the same. Among them, the transmission distance of antenna 1 is the first distance. The transmission distance of antenna 2 is the second distance. The second distance is less than the first distance. For example, when the wireless communication module 140 switches to antenna 1 to send a wireless signal, an electronic device located within a first distance (for example, the first distance is 6m, 8m, 10m) of the first electronic device 100 can receive the wireless signal. When the wireless communication module 140 switches to antenna 2 to send a wireless signal, an electronic device located within a second distance (for example, the second distance is 30cm) of the first electronic device 100 can receive the wireless signal. The second distance is less than or equal to a preset safety distance. The preset safety distance is less than the first distance. The first distance, the second distance, and the preset safety distance can all be adjusted and set by the user as needed. In one embodiment, the second distance can be a preset safety distance. In other words, when the first electronic device 100 needs to send an ultra-short-range wireless signal, the wireless communication module 140 can be controlled to be connected to the antenna 2 to send the ultra-short-range wireless signal. When the first electronic device 100 does not need to send an ultra-short-range wireless signal, the wireless communication module 140 can be controlled to be connected to the antenna 1 to send a normal wireless signal.
[0057] In other embodiments, Figure 3As shown, the first electronic device 100 may include a variable resistance circuit module 150 and an antenna. The variable resistance circuit module 150 can change the size of the resistance value under the control of the wireless communication module 140, thereby changing the transmission distance of the same antenna. That is, when the resistance value of the variable resistance circuit module 150 is adjusted to a resistance value of 1, the transmission power of the antenna is a first transmission power (a higher transmission power), and the transmission distance of the antenna is a first distance. At this time, electronic devices located within a first distance (for example, the first distance is 6m, 8m, 10m) of the first electronic device 100 can receive the wireless signal. When the resistance value of the variable resistance circuit module 150 is adjusted to a resistance value of 2, the transmission power of the antenna is a second transmission power (a lower transmission power), and the transmission distance of the antenna is a second distance. The second transmission power is less than the first transmission power. The second distance is less than or equal to a preset safety distance. The preset safety distance is less than the first distance. The first distance, the second distance, and the preset safety distance can all be adjusted and set by the user as needed. In one embodiment, the second distance can be a preset safety distance. In other words, when the first electronic device 100 needs to send an ultra-short-range wireless signal, the resistance value of the variable resistance circuit module 150 can be controlled to be adjusted to a resistance value of 2 to send an ultra-short-range wireless signal. When the first electronic device 100 does not need to send an ultra-short-range wireless signal, the resistance value of the variable resistance circuit module 150 can be controlled to be adjusted to a resistance value of 1 to send a normal wireless signal. In other words, in some other embodiments, when the resistance value of the variable resistance circuit module 150 is adjusted to a resistance value of 1, the first electronic device 100 is connected to the first antenna. When the resistance value of the variable resistance circuit module 150 is adjusted to a resistance value of 2, the first electronic device 100 is connected to the second antenna; wherein the first antenna and the second antenna are the same, but the transmission distance of the first antenna is greater than the transmission distance of the second antenna; the transmission distance of the second antenna is less than or equal to the preset safety distance, and the transmission distance of the first antenna is greater than the preset safety distance. The transmission distance of the first antenna and the transmission distance of the second antenna are the above-mentioned first distance and second distance, respectively.
[0058] Exemplarily, the wireless communication method adopted by the wireless communication module 140 can be specifically adopted by methods such as BLE, Wi-FiAware, etc. Among them, the wireless communication method is based on the computer network MAC (Medium Access Control, Media Access Control) layer, also known as the data link layer protocol extension for interaction, without involving the upper network communication of the MAC layer, and data interaction can be fully realized at the data link layer. Among them, BLE is an ultra-low power consumption short-range wireless communication solution for device B launched by the Bluetooth Special Interest Group in 2016, and communication can be achieved through the MAC layer. Wi-Fi Aware (Wi-Fi Neighborhood Aware Network, Wi-Fi Neighborhood Discovery Network, also known as Wi-Fi Neighborhood Aware Network, referred to as NAN) is a new type of low-power point-to-point interconnected Wi-Fi Mesh communication technology, which can bypass network infrastructure (such as access points (Access Point, AP) or cellular networks) to achieve one-to-one, one-to-many or many-to-many device connection communication, and communication can also be achieved through the MAC layer. It can be understood that the higher the number of layers of the computer network involved, the more difficult it is to ensure its security. The wireless MAC layer communication adopted in this embodiment enables data to interact based on data link layer protocol extension, which can significantly improve the security of data transmission.
[0059] The technical solutions involved in the following embodiments can be implemented in the first electronic device 100 and the second electronic device 200 having the above structure. The first electronic device and the second electronic device both include a first antenna and a second antenna. The technical solutions provided in the embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0060] Figure 4 A flow chart of a data transmission method provided in an embodiment of the present application. Figure 4 As shown, the method includes:
[0061] S401: A first electronic device receives an input.
[0062] S401': the second electronic device receives an input.
[0063] The first electronic device receives an input for instructing the first electronic device to send specific data. The input may be user input or an instruction sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc.
[0064] The second electronic device receives an input for instructing the second electronic device to receive specific data. The input may be user input or a command sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc.
[0065] In some embodiments, the first electronic device stores configuration information, including but not limited to network settings, sensor alarm threshold settings, alarm triggering actions, silent time settings, timer settings, firmware upgrade settings, power usage threshold settings, etc. The network configuration information includes, for example, the identifier of the Wi-Fi network (for example, service set identifier (SSID) and password information. It should be noted that the configuration information varies with the device type and model of the first electronic device. The second electronic device is a device that has not been set. The first electronic device receives an input, which can be an operation that instructs the first electronic device to send configuration information to the second electronic device. For example, the user performs a predefined operation 1 on the first electronic device. The predefined operation 1 is, for example, pressing a specific button (physical button or virtual button) on the first electronic device. In this embodiment, the configuration information of the first electronic device is specific data. The second electronic device receives an input, which can be a predefined operation 2 performed by the user on the second electronic device. The predefined operation 2 is, for example, turning on the device or indicating the operation of setting the second electronic device.
[0066] As an example, the first electronic device and the second electronic device are of the same device type, and the models are the same or close. Then, the configuration information of the first electronic device can be sent to the second electronic device, and the second electronic device can be set directly according to the received configuration information. As another example, the first electronic device and the second electronic device are of different device types. Part of the configuration information in the first electronic device can be sent to the second electronic device, and the second electronic device can be set directly according to the received part of the configuration information. For example, when the first electronic device and the second electronic device need to access the same network, the second electronic device can also directly use the network setting configuration information of the first electronic device.
[0067] In other embodiments, the first electronic device is an old device used by the user, and the second electronic device is a new device that the user is going to replace. The first electronic device receives an input, such as an operation to instruct the first electronic device to send configuration information and / or user data to the second electronic device. That is, the specific data is the configuration information and / or user data of the first electronic device. The user data includes but is not limited to information about applications installed on the first electronic device, basic settings of the installed applications, photos, videos, recordings, files stored on the first electronic device, and operation logs of the first electronic device. The second electronic device receives an input, such as an operation for the user to turn on the wireless function or an operation to instruct the reception of specific data.
[0068] It should be noted that the execution order of S401 and S401 ′ is not limited in the embodiment of the present application.
[0069] S402: The first electronic device sends a first message via a first antenna at a first period.
[0070] The first message is used to request to send specific data to the second electronic device so as to negotiate a session key with the second electronic device.
[0071] In some embodiments, the first electronic device may broadcast the request by wireless means such as Wi-Fi or Bluetooth. The following description is made by taking the example of the first electronic device using Wi-Fi Aware technology to send a service identifier for transmitting specific data.
[0072] First, the NAN mechanism is briefly described. The NAN mechanism is a standard developed by the Wi-Fi Alliance. This standard is that in the absence of a central node, all devices participating in the NAN mechanism (i.e., NAN devices, such as the first electronic device and the second electronic device) are synchronized. The maintenance work and service discovery work of the NAN mechanism are carried out in the discovery window (DW) agreed by the NAN mechanism. Among them, service discovery can be achieved by sending a service discovery frame (SDF) message. The server discovery frame message includes a query message or a broadcast message. Based on the information obtained in the service discovery message, the NAN device can establish a corresponding connection and then manage it based on NAN intelligence. Among them, the SDF message is an action frame specially defined for service discovery. According to different functions, the SDF message frame can be roughly divided into three types, SDF publish message, SDF subscription message and SDF follow-up message. Among them, the SDF publish message is used to publish the services that the NAN device can provide, or to reply to the NAN subscribe message sent by other NAN devices. The NAN subscribe message is used to find the services that need to be used. The SDF follow-up message is used to reply to a received SDF publish message or to negotiate more information. Generally, an indication is included in the SDF message to indicate which type of SDF message the message belongs to.
[0073] As an example, the first electronic device may carry information such as a service identifier for transmitting specific data and an identifier of the first electronic device in an SDF publish message. As another example, the first electronic device may carry information such as a service identifier for transmitting specific data and an identifier of the first electronic device in a BLE beacon.
[0074] In some other embodiments, the first electronic device can obtain the identification of the second electronic device or the address of the second electronic device, and can also send the first message in a point-to-point manner.
[0075] In some other embodiments, the first electronic device may send the first message at a first period within a preset time, or may send the first message a preset number of times within a preset time. This embodiment of the present application does not limit this.
[0076] S403: The second electronic device receives the first message and switches to the second antenna of the second electronic device.
[0077] S404: The second electronic device generates a first random number, and generates a second message according to the first random number.
[0078] Exemplarily, after receiving a request for transmitting specific data sent by the first electronic device, the second electronic device generates first random data for negotiating a session key with the second electronic device.
[0079] The embodiment of the present application does not limit the execution order of S403 and S404.
[0080] S405: The second electronic device sends a second message via the second antenna in a second period.
[0081] Exemplarily, the second electronic device has Figure 2 In the structure shown in FIG. 1 , the second electronic device can control the wireless communication module 140 to connect to the second antenna. Figure 3 In the structure shown, the second electronic device controls the resistance value of the variable resistance circuit module 150 to be a second resistance value (a larger resistance value), so that the antenna transmission power of the second electronic device is the second transmission power.
[0082] As an example, the second electronic device may carry the first random number in an SDF Follow-up message. As another example, the second electronic device may carry the first random number in a BLE beacon.
[0083] As described above, since the second message sent by the second electronic device via the second antenna can only be received by electronic devices within a very short distance (eg, 30 cm) from the second electronic device, it can be ensured that the electronic device receiving the second message is a trusted device of the second electronic device.
[0084] In some embodiments, before sending the second message, the second electronic device may use voice prompts or flashing lights to prompt the user to bring the first electronic device closer to the second electronic device. Of course, the second electronic device may also prompt the user at other times, such as after receiving the first message sent by the first electronic device. The first electronic device may also prompt the user to move closer to the second electronic device. The embodiments of the present application do not limit the prompting method, prompting timing, etc.
[0085] S406: Within the transmission range of the second antenna of the second electronic device, the first electronic device receives the second message and obtains the first random number.
[0086] S407: The first electronic device switches to the second antenna of the first electronic device.
[0087] S408: The first electronic device generates a second random number, and generates a third message according to the second random number.
[0088] S409: The first electronic device sends a third message via the second antenna.
[0089] Among them, in S407-S409, in addition, the process of the first electronic device sending the third message is the same or similar to the process of the second electronic device sending the second message, which will not be repeated here. For other contents, please refer to the relevant description in S405.
[0090] As an example, the first electronic device may carry the second random number in an SDF Follow-up message. As another example, the first electronic device may carry the second random number in a BLE beacon.
[0091] S410: The first electronic device generates a session key according to the first random number and the second random number.
[0092] Exemplarily, the first electronic device may use a predefined algorithm or a key derivation function (KDF) in cryptography to calculate the session key. The predefined algorithm includes, but is not limited to, data concatenation, data encoding format conversion, data position conversion, hash (HASH) operation (such as MD5 / SHA-1, etc.). KDF algorithms include, for example, PBKDF2, bcrypt, scrypt, HKDF (HMAC-based KDF), etc. The embodiment of the present application does not limit the specific method for generating a session key based on the first random number and the second random number.
[0093] S411: The first electronic device switches to the first antenna of the first electronic device.
[0094] Specifically, for example, the first electronic device has Figure 2 In the structure shown in FIG. 1 , the first electronic device can control the wireless communication module 140 to connect to the first antenna. Figure 3 In the structure shown, the first electronic device controls the resistance value of the variable resistance circuit module 150 to be a first resistance value (a smaller resistance value), so that the antenna transmission power of the first electronic device is the first transmission power.
[0095] In some other embodiments, the first electronic device may also switch to the first antenna at other times. For example, after executing S409, that is, after sending the third message, the first electronic device switches back to the first antenna. For another example, before executing S413, that is, before sending the fourth message to the second electronic device via the first antenna to the first electronic device, the first electronic device switches back to the first antenna. This embodiment of the present application does not limit this.
[0096] S412: The first electronic device encrypts specific data of the first electronic device using the session key to obtain encrypted data, and generates a fourth message according to the encrypted data.
[0097] The first electronic device adopts a certain encryption algorithm to encrypt specific data using a session key, and generates a signature or integrity check information for the specific data to ensure the security of transmitting the specific data and avoid leakage of the specific data.
[0098] During the process of the first electronic device executing S410-S412, the second electronic device executes S410'-S412'. Specifically, as follows:
[0099] S410': within the transmission range of the second antenna of the first electronic device, the second electronic device receives the third message and obtains a second random number.
[0100] S411': The second electronic device switches to the first antenna of the second electronic device.
[0101] Specifically, for example, the second electronic device has Figure 2 In the structure shown in FIG. 1 , the second electronic device can control the wireless communication module 140 to connect to the first antenna. Figure 3 In the structure shown, the second electronic device controls the resistance value of the variable resistance circuit module 150 to be the first resistance value (smaller resistance value), so that the antenna transmission power of the second electronic device is the first transmission power.
[0102] In some other embodiments, the second electronic device may also switch to the first antenna at other times. For example, after executing S405, that is, after sending the second message, the second electronic device switches back to the first antenna. For another example, before executing S416, that is, before the second electronic device sends a message of successful transmission of specific data to the first electronic device through the first antenna, the second electronic device switches back to the first antenna. This embodiment of the present application is not limited to this.
[0103] S412': The second electronic device generates a session key according to the first random number and the second random number.
[0104] It should be noted that the algorithm used by the second electronic device to generate the session key is the same as the algorithm used by the first electronic device to generate the session key, so that the session keys generated by the two electronic devices are the same. Furthermore, the generated session key can be used to decrypt data sent by the peer electronic device.
[0105] S413: The first electronic device sends a fourth message via the first antenna.
[0106] Exemplarily, the first electronic device may broadcast the encrypted specific data via a wireless connection (such as Wi-Fi or Bluetooth). For example, the second electronic device may carry the encrypted specific data in an SDF Follow-up message or in a BLE beacon. Alternatively, the first electronic device establishes a point-to-point wireless connection (such as Wi-Fi or Bluetooth) with the second electronic device, and sends the encrypted specific data to the second electronic device via the wireless connection.
[0107] S414: The second electronic device receives the fourth message and obtains the encrypted data.
[0108] S415: The second electronic device decrypts the encrypted data using the session key to obtain specific data of the first electronic device.
[0109] The second electronic device uses the session key to decrypt the encrypted specific data, and verifies the signature or integrity verification information of the specific data.
[0110] S416. The second electronic device sends a message indicating that specific data transmission is successful via the first antenna.
[0111] S417: The first electronic device receives a specific data transmission success message, displays the specific data transmission success message, and / or plays a specific data transmission success voice message.
[0112] S417': The second electronic device displays a message that the specific data has been successfully transmitted and / or plays a voice message that the specific data has been successfully transmitted.
[0113] The execution order of S417 and S417' is not limited in this embodiment. In addition, the embodiment of the present application can execute any one of S417 and S417', or both steps, or neither step.
[0114] It can be seen that in the data transmission method provided in the embodiment of the present application, the first electronic device and the second electronic device negotiate the session key by switching to the second antenna to send an ultra-short-range wireless signal to complete the authentication of both parties. Since the first electronic device and the second electronic device can only receive the ultra-short-range wireless signal sent by the opposite electronic device if they are within the transmission distance of the second antenna (the transmission distance of the second antenna is less than or equal to the preset safety distance). Therefore, by sending an ultra-short-range wireless signal to negotiate the session key, the security of the communication can be improved, and it is also helpful to simplify the process of key negotiation, thereby realizing the rapid transmission of specific data. In addition, it can be noted that the user does not need to manually enter information such as a verification code during the key negotiation process, which also reduces the complexity of the user's operation.
[0115] Figure 5A flow chart of a method for data transmission provided in an embodiment of the present application. Figure 5 As shown, the method includes:
[0116] S501: A first electronic device receives an input.
[0117] S501': the second electronic device receives an input.
[0118] The first electronic device receives an input for instructing the first electronic device to send specific data. The input may be user input or an instruction sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc.
[0119] The second electronic device receives an input for instructing the second electronic device to receive specific data. The input may be user input or a command sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc.
[0120] It should be noted that the execution order of S501 and S501 ′ is not limited in the embodiment of the present application.
[0121] S502: The first electronic device sends a first message via a first antenna at a first period.
[0122] The first message is used to request sending specific data to the second electronic device.
[0123] S503: The second electronic device receives the first message and switches to the second antenna of the second electronic device.
[0124] S504: The second electronic device generates a first random number, and generates a second message according to the first random number.
[0125] Exemplarily, after receiving a request for transmitting specific data sent by the first electronic device, the second electronic device generates first random data for negotiating a session key with the second electronic device.
[0126] The embodiment of the present application does not limit the execution order of S503 and S504.
[0127] S505: The second electronic device sends a second message via the second antenna in a second period.
[0128] S506: Within the transmission range of the second antenna of the second electronic device, the first electronic device receives the second message and obtains the first random number.
[0129] S507: The first electronic device switches to the second antenna of the first electronic device.
[0130] S508: The first electronic device generates a second random number, and generates a third message according to the second random number.
[0131] S509: The first electronic device sends a third message through the second antenna.
[0132] S510: The first electronic device generates a session key according to the first random number and the second random number.
[0133] S511: The first electronic device switches to the first antenna of the first electronic device.
[0134] S512. The first electronic device uses the session key to encrypt specific data of the first electronic device to obtain encrypted data; uses an integrity check algorithm for the specific data of the first electronic device to obtain a first integrity check value; and generates a fourth message based on the encrypted data and the first integrity check value.
[0135] Among them, the integrity check algorithm, for example, can use a hash algorithm and a key to hash the encrypted data to obtain a hash value of the data (i.e., a first integrity check value), and then send the hash value and the encrypted data together to the second electronic device, so that after the second electronic device receives the hash value and the encrypted data, it uses the same integrity check algorithm to calculate another hash value (i.e., a second integrity check value) for the encrypted data. When the second integrity check value is equal to the first integrity check value, it means that the encrypted data is complete and has not been tampered with. Then, specific data that has not been tampered with is obtained based on the complete encrypted data. Of course, other integrity check algorithms can also be used, and the embodiments of the present application are not limited to this.
[0136] During the process of the first electronic device executing S510-S512, the second electronic device executes S510'-S512'. Specifically, as follows:
[0137] S510': within the transmission range of the second antenna of the first electronic device, the second electronic device receives the third message and obtains a second random number.
[0138] S511': The second electronic device switches to the first antenna of the second electronic device.
[0139] S512': The second electronic device generates a session key according to the first random number and the second random number.
[0140] S513: The first electronic device sends a fourth message via the first antenna.
[0141] S514: The second electronic device receives the fourth message and obtains the encrypted data and the first integrity check value.
[0142] S515. The second electronic device decrypts the encrypted data using the session key to obtain the specific data of the first electronic device; and uses an integrity check algorithm for the specific data of the first electronic device to obtain a second integrity check value.
[0143] S516: The second electronic device determines whether the first integrity check value is equal to the second integrity check value.
[0144] S517: If the first integrity check value is equal to the second integrity check value, the second electronic device sends a message indicating successful transmission of specific data through the first antenna.
[0145] S518: The first electronic device receives a specific data transmission success message, displays the specific data transmission success message and / or plays a specific data transmission success voice message.
[0146] S518': The second electronic device displays a message that the specific data has been successfully transmitted and / or plays a voice message that the specific data has been successfully transmitted.
[0147] Other content can be referenced Figure 4 The description of the relevant contents in S410-S417' will not be repeated here.
[0148] In the above embodiment, the first electronic device and the second electronic device first negotiate a session key through the second antenna, and then transmit specific data encrypted with the session key through the first antenna. In some other embodiments, the first electronic device and the second electronic device can directly transmit specific data through the second antenna by utilizing the second antenna's safe transmission distance.
[0149] Figure 6 A flow chart of a method for data transmission provided in an embodiment of the present application. Figure 6 As shown, the method includes:
[0150] S601: A first electronic device receives an input.
[0151] S601': the second electronic device receives an input.
[0152] The first electronic device receives an input for instructing the first electronic device to send specific data. The input may be user input or an instruction sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc.
[0153] The second electronic device receives an input for instructing the second electronic device to receive specific data. The input may be user input or a command sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc.
[0154] It should be noted that the execution order of S601 and S601 ′ is not limited in the embodiment of the present application.
[0155] S602: The first electronic device sends a first message via a first antenna at a first period.
[0156] The first message is used to request transmission of specific data to the second electronic device.
[0157] S603: The second electronic device receives the first message and switches to the second antenna of the second electronic device.
[0158] Optionally, after receiving the first message, the second electronic device may prompt the user of the second electronic device to approach the first electronic device so as to receive specific data subsequently sent by the first electronic device. Alternatively, after the first electronic device executes S601 or S602, it prompts the user of the first electronic device to approach the second electronic device so that the second electronic device can receive specific data subsequently sent by the first electronic device. This embodiment of the application is not limited to this.
[0159] S604: The second electronic device sends a response message via the second antenna in a second period.
[0160] S605: The first electronic device receives a response message within the transmission range of the second antenna of the second electronic device.
[0161] In other words, when the first electronic device receives the response message, it indicates that the first electronic device is within the transmission range of the second antenna of the second electronic device. Correspondingly, the second electronic device is also within the transmission range of the second antenna of the first electronic device. Then, when the first electronic device sends specific data through the second antenna, the second electronic device determines that it can receive the specific data.
[0162] In some other embodiments, S602 to S605 may not be executed, that is, after S601, S606 is executed.
[0163] S606: The first electronic device generates a second message according to the specific data of the first electronic device, and switches to the second antenna of the first electronic device.
[0164] S607: The first electronic device sends a second message via the second antenna.
[0165] In other words, in this embodiment, the first electronic device and the second electronic device do not need to negotiate a session key, but directly send the specific data through the second antenna. In this way, only electronic devices within the transmission range of the second antenna of the first electronic device can receive the specific data, thereby ensuring the security of sending the specific data.
[0166] S608: The second electronic device receives the second message and obtains specific data.
[0167] S609: The second electronic device determines whether the specific data of the first electronic device has been received.
[0168] In some examples, the end of the specific data may carry a specific identifier, and the second electronic device may determine whether the specific data of the first electronic device has been received by detecting the specific identifier. In other examples, the beginning or end of the specific data may also carry the size of the specific data, and the second electronic device may also determine whether the specific data of the first electronic device has been received by detecting the size of the specific data received from the first electronic device, which is not limited in the embodiments of the present application.
[0169] S610: When the second electronic device determines that it has received the specific data from the first electronic device, it sends a message of successful transmission of the specific data through the second antenna.
[0170] S611: The first electronic device receives a message about successful transmission of specific data, displays the message about successful transmission of specific data and / or plays a voice message about successful transmission of specific data, and switches to the first antenna.
[0171] S611': The second electronic device displays a message that specific data is successfully transmitted and / or plays a voice message that specific data is successfully transmitted, and switches to the first antenna.
[0172] The embodiment of the present application does not limit the execution order of S611 and S611'. In addition, the embodiment of the present application can execute any one of S611 and S611', or both steps, or neither step.
[0173] For other contents, please refer to the description of the relevant contents in the above embodiments, which will not be repeated here.
[0174] In some scenarios, due to some special reasons, the second electronic device cannot be connected to the Internet. For example, the second electronic device cannot connect to the routing device, and the data of the second electronic device cannot be transmitted through the Wi-Fi of the routing device. In order to find out the reason, it is necessary to obtain the historical log recorded by the second electronic device from the second electronic device, so that the maintenance personnel can analyze the specific reasons for maintenance. At this time, it is necessary to easily and conveniently read the log information stored by the second electronic device from the second electronic device. Figure 7A data transmission method for such a scenario is provided. Figure 7 A flow chart of a method for data transmission provided in an embodiment of the present application. Figure 7 As shown, the method includes:
[0175] S701: A first electronic device receives an input.
[0176] S701': the second electronic device receives an input.
[0177] The first electronic device receives an input for instructing the first electronic device to collect specific data. The input may be user input or an instruction sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc. The specific data may be, for example, an operation log.
[0178] The second electronic device receives an input for instructing the second electronic device to send specific data. The input may be user input or an instruction sent by another device. The user input includes a user operating a specific key, inputting a voice command, a specific touch operation, a specific air gesture, etc. The second electronic device may not be connected to the Internet or a mobile communication network.
[0179] It should be noted that the execution order of S701 and S701 ′ is not limited in the embodiment of the present application.
[0180] S702: The first electronic device sends a first message via a first antenna at a first period.
[0181] The first message is used to request the first electronic device to collect specific data of the second electronic device. For example, the first electronic device requests to collect the operation log of the second electronic device.
[0182] As an example, the first electronic device may carry information such as a service identifier for collecting device operation logs and an identifier of the first electronic device in an SDF publish message. As another example, the first electronic device may carry information such as a service identifier for collecting device operation logs and an identifier of the first electronic device in a BLE beacon.
[0183] S703: The second electronic device receives the first message and switches to the second antenna of the second electronic device.
[0184] S704: The second electronic device sends a second message via the second antenna in a second period.
[0185] The second message may carry information about the second electronic device, such as the device type (e.g., product ID), device name, login account information, etc. of the second electronic device. Optionally, the second message may also carry a session key (e.g., AES 128Key) randomly generated by the second electronic device, which may be used to subsequently decrypt specific data encrypted by the first electronic device. In other words, the second electronic device transmits the session key through the second antenna, thereby ensuring secure transmission of the session key.
[0186] S705: The first electronic device receives the second message within the transmission range of the second antenna of the second electronic device.
[0187] S706: The first electronic device sends a response message to the second message.
[0188] S707: After receiving a response message to the second message, the second electronic device switches to the first antenna.
[0189] S708. The second electronic device sends a third message containing specific data through the first antenna.
[0190] In some examples, the second electronic device may encrypt specific data using the session key generated in S704.
[0191] S709: The first electronic device receives a third message.
[0192] In some examples, the first electronic device decrypts the third message based on the received session key to obtain specific data.
[0193] S710. The first electronic device sends a response message indicating successful reception of the third message to the second electronic device.
[0194] S711. The first electronic device displays a message about successful transmission of specific data and / or plays a voice message about successful transmission of specific data, and switches to the first antenna.
[0195] S711': The second electronic device displays a message that specific data is successfully transmitted and / or plays a voice message that specific data is successfully transmitted, and switches to the first antenna.
[0196] The embodiment of the present application does not limit the execution order of S711 and S711'. In addition, the embodiment of the present application can execute any one of S711 and S711', or both steps, or neither step.
[0197] For other contents, please refer to the description of the relevant contents in the above embodiments, which will not be repeated here.
[0198] The following describes several application scenarios of the technical solutions provided in the embodiments of the present application.
[0199] Scenario 1: A user purchases a large number of devices of the same or similar device types. The setting information of these devices is the same or similar. Therefore, the user can first set up one of the electronic devices through, for example, a mobile phone. The set up electronic device is the first electronic device. Then, the configuration information of the set up electronic device is directly cloned to other electronic devices (i.e., the second electronic device) to complete the setting of the other electronic devices.
[0200] For example, if you have purchased multiple smart lighting devices (smart desk lamps, ceiling lamps, smart light strips, aromatherapy lamps, etc.), the user can first establish a wireless connection with lighting device A through a mobile phone, and use "Smart Life" or other applications to configure the lighting device, set lighting parameters such as brightness and color temperature, whether to delay shutdown, the length of delayed shutdown, whether to automatically upgrade the firmware, and set the power consumption threshold. That is, lighting device A stores configuration information. Then, the user can clone the configuration information of lighting device A to other lighting devices (such as lighting device B, lighting device C, etc.).
[0201] In one implementation, after lighting device A and lighting device B receive an input respectively, when lighting device A and lighting device B are brought close to each other within a range of 30 cm, the configuration data of lighting device A is transmitted to lighting device B. In this way, the user only needs to trigger an input to lighting device A and lighting device B, and then bring the two close to each other within a preset safe distance, and the two can achieve the transmission of specific data. The user's operation is very simple, especially suitable for people with weak understanding and operation abilities such as the elderly and children, and is easy to master.
[0202] In one embodiment, the specific data may be pre-set by a control device or a binding device of the electronic device. For example, the owner's mobile phone may pre-set the specific data of the IoT light as configuration data.
[0203] It should be noted that the embodiment of the present application utilizes the secure distance transmission key of ultra-short-range wireless communication. When the first antenna is working, the data encrypted by the transmission key is transmitted and decrypted at another electronic device, thereby physically ensuring the security of transmission between lighting device A and lighting device B and eliminating the risk of attacks from intermediate devices and data leakage.
[0204] Then, the same method can be used to clone the configuration information of lighting device A to other devices such as lighting device C. Alternatively, the same method can be used to clone the configuration information of lighting device B to other devices such as lighting device C.
[0205] As can be seen from the above, when the same configuration information needs to be set for multiple electronic devices, one of the electronic devices can be set first. Then, the configuration information in the set electronic device is directly cloned to other electronic devices. This simplifies the process of users setting up multiple electronic devices separately and improves the efficiency of setting up multiple electronic devices.
[0206] For another example, in smart home life, a large number of sensors usually need to be set up. For example, smoke sensors, gas sensors, water detectors, abnormal sound sensors, etc. Although these sensors are of different types, the configuration information is generally the same or similar. The configuration information includes, for example, network information for accessing the network, alarm triggering actions, silent time, timer settings, firmware upgrade settings, etc. Therefore, the method of the embodiment of the present application can also be used to first set up one of the sensors, and then use the set sensor to clone the configuration information to other sensors to avoid repeated settings for similar sensors, simplify user operations, and improve setting efficiency.
[0207] In addition, since the method provided in the embodiment of the present application rarely involves user interface operations, the method provided in the embodiment of the present application is more user-friendly and easy to implement for a large number of devices without display screens in smart homes.
[0208] Scenario 2: The user replaces the old electronic device with a new one. The new electronic device is usually of the same type as the old electronic device and has a similar model. Then, the configuration information and / or user data on the old electronic device can be directly cloned to the new electronic device. This avoids exporting the configuration information and / or user data on the old electronic device to an intermediate device and then importing it back to the new electronic device from the intermediate device, which improves data security and simplifies user operations.
[0209] Scenario three: An IoT device in the home that cannot access the Internet or fails to configure the network has an operational failure. Generally, when an IoT device fails, the operation log will be sent to a mobile phone or computer through the network. Alternatively, the IoT device prints the operation log to a mobile phone or computer through a communication interface such as a serial port, so that the user can perform fault analysis and problem location. In this solution, the operation log of the IoT device can be sent to other electronic devices via an ultra-short distance, and the operation log of the electronic device can be viewed through other electronic devices, which facilitates fault analysis of the electronic device for maintenance of the electronic device. This solves the maintenance problem of IoT devices that cannot access the Internet or fail to configure the network or do not have an external communication interface.
[0210] For example, Figure 8As shown in (1), the user can open the "Smart Life" APP in the mobile phone and enter the home device list interface 801. It can be seen that the mobile phone is bound to three devices: air conditioner, smart desk lamp and smart speaker. Among them, the smart desk lamp is not connected to the Internet. Further, in response to the user operating control 802, the mobile phone sends a message to the smart desk lamp to collect the operation log of the smart desk lamp, that is, execute S702 and the subsequent steps. In the process of the mobile phone collecting the smart desk lamp, the mobile phone also displays the following Figure 8 The prompt interface 803 shown in (2). The prompt information 804 in the prompt interface 803 is used to prompt the user that the operation log of the smart desk lamp is being collected. After the mobile phone successfully receives the operation log of the smart desk lamp, the mobile phone can display a prompt interface 805, wherein the prompt information 806 is used to prompt the user that the operation log of the smart desk lamp has been successfully collected. Optionally, the prompt information 806 also includes a viewing control 807. In response to the user operating the control 807, the mobile phone displays the operation log of the smart desk lamp, so that the user can perform fault analysis on the operation of the smart desk lamp. It should be noted that in other embodiments, the mobile phone and the smart desk lamp may not be bound in advance, and the mobile phone may also request to collect the operation log of the smart desk lamp, which is not limited to this in the present application.
[0211] Fig. 9 A schematic diagram of the structure of an electronic device is provided in an embodiment of the present application. Fig. 9 As shown, the electronic device includes: one or more processors 910, one or more memories 920, and one or more computer programs. The one or more computer programs are stored in the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the operations performed by the first electronic device or the second electronic device in the above-mentioned embodiment.
[0212] like Fig.10 As shown, an embodiment of the present application also provides a chip system, which includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (such as a memory of the first electronic device 100, or a memory of the second electronic device 200). For another example, the interface circuit 1002 can be used to send signals to other devices (such as the processor 1001). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instruction is executed by the processor 1001, the electronic device can execute the various steps performed by the first electronic device 100 or the second electronic device 200 in the above-mentioned embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0213] The present application also provides a device, which is included in an electronic device, and has the function of implementing the behavior of the electronic device in any of the methods in the above embodiments. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above function. For example, a detection module or unit, a display module or unit, a determination module or unit, and a calculation module or unit, etc.
[0214] An embodiment of the present application further provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes any of the methods in the above embodiments.
[0215] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is enabled to execute any of the methods in the above embodiments.
[0216] An embodiment of the present application also provides a graphical user interface on an electronic device, wherein the electronic device has a display screen, a camera, a memory, and one or more processors, wherein the one or more processors are used to execute one or more computer programs stored in the memory, and the graphical user interface includes a graphical user interface displayed when the electronic device executes any of the methods in the above embodiments.
[0217] It is understandable that, in order to realize the above functions, the above-mentioned electronic devices, etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0218] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0219] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0220] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0221] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
[0222] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An electronic device, characterized in that: The electronic device comprises: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna being less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured for the second antenna is less than the transmission power configured for the first antenna; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: An input is received; In response to the input, sending a first message with a first period through the first antenna; receiving a second message from another electronic device; In response to the second message, switch to the second antenna, and send a third message through the second antenna in a second period; wherein the third message contains specific data, and the specific data includes at least one of configuration information and user data; After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the third message, a prompt is given indicating that the specific data transmission is successful.
2. An electronic device, characterized in that: The electronic device comprises: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna being less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured for the second antenna is less than the transmission power configured for the first antenna; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: An input is received; In response to the input, sending a first message with a first period through the first antenna; receiving a second message from another electronic device; In response to the second message, obtaining a first random number from the second message, generating a second random number, switching to the second antenna, and sending a third message including the second random number through the second antenna; A session key is generated according to the first random number and the second random number, specific data is encrypted using the session key, and a fourth message is sent to the other electronic device, wherein the fourth message includes the encrypted specific data, and the specific data includes at least one of configuration information and user data.
3. The electronic device according to claim 2, characterized in that: After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the fourth message, a prompt is given that the specific data transmission is successful.
4. The electronic device according to claim 3, characterized in that: The using the session key to encrypt the specific data and sending a fourth message to the other electronic device specifically includes: Switch to the first antenna of the electronic device, and send the fourth message through the first antenna of the electronic device.
5. The electronic device according to any one of claims 2 to 4, characterized in that: The electronic device further performs: The fourth message also includes a first integrity check value for the specific data.
6. The electronic device according to claim 3 or 4, characterized in that: The prompting that the specific data is successfully transmitted includes: displaying a message that the specific data is successfully transmitted, and / or playing a voice message indicating that the specific data is successfully transmitted.
7. The electronic device according to any one of claims 2 to 4, characterized in that: The configuration information includes one or more of network configuration information, sensor alarm threshold setting information, alarm trigger action information, silent time setting information, timer setting information, firmware upgrade setting information and power consumption threshold setting information; the user data includes one or more of application installation data, photos, videos, recordings and files stored on the electronic device, and operation logs of the electronic device.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna being less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured for the second antenna is less than the transmission power configured for the first antenna; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following operations: An input is received; receiving a first message from another electronic device; In response to the first message, switch to the second antenna, generate a first random number, and send a second message including the first random number through the second antenna in a second period; receiving a third message from the other electronic device; In response to the third message, obtaining a second random number from the third message, and generating a session key according to the first random number and the second random number; receiving a fourth message from the other electronic device; In response to the fourth message, encrypted specific data is obtained from the fourth message, and the specific data is decrypted using the session key to obtain the specific data, where the specific data includes at least one of configuration information and user data.
9. The electronic device according to claim 8, characterized in that: The electronic device further performs: Receiving a first integrity check value of the specific data sent by the other electronic device, and calculating a second integrity check value of the specific data; After the second integrity check value is equal to the first integrity check value, a message that the specific data transmission is successful is sent to the other electronic device.
10. The electronic device according to claim 9, characterized in that: Sending a message that the specific data transmission is successful to the other electronic device specifically includes: Switch to the first antenna, and use the first antenna to send a message that the specific data is successfully transmitted.
11. An electronic device, the electronic device is not connected to a routing device or a hotspot, characterized in that: The electronic device comprises: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna being less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured for the second antenna is less than the transmission power configured for the first antenna; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following operations: An input is received; receiving a first message from another electronic device; In response to the first message, switch to the second antenna and send a second message through the second antenna; wherein the second message includes specific data of the electronic device, and the specific data is a log of the electronic device; After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the second message, a prompt is given indicating that the specific data transmission is successful.
12. An electronic device for data transmission, the electronic device is not connected to a routing device or a hotspot, characterized in that: The electronic device comprises: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna being less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured for the second antenna is less than the transmission power configured for the first antenna; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and when the computer programs are executed by the one or more processors, the electronic device performs the following operations: An input is received; receiving a first message from another electronic device; In response to the first message, switch to the second antenna and send a second message through the second antenna; receiving a response message from the other electronic device to the second message; In response to the response message, switch to the first antenna, and send a third message containing specific data through the first antenna, where the specific data is a log of the electronic device; After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the third message, a prompt is given indicating that the specific data transmission is successful.
13. The electronic device according to claim 12, characterized in that: The second message includes a session key, and the third message contains specific data encrypted by the session key.
14. The electronic device according to claim 13, characterized in that: The session key is preset.
15. A data transmission method, characterized in that: The method is applied to an electronic device, which includes: one or more processors; one or more memories; a first antenna; and a second antenna, wherein the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured for the second antenna is less than the transmission power configured for the first antenna; the method includes: An input is received; In response to the input, sending a first message with a first period through the first antenna; receiving a second message from another electronic device; In response to the second message, switch to the second antenna, and send a third message through the second antenna in a second period; wherein the third message contains specific data, and the specific data includes at least one of configuration information and user data; After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the third message, a prompt is given indicating that the specific data transmission is successful.
16. A data transmission method, characterized in that: The method is applied to an electronic device, the electronic device comprising: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method comprises: An input is received; In response to the input, sending a first message with a first period through the first antenna; receiving a second message from another electronic device; In response to the second message, obtaining a first random number from the second message, generating a second random number, switching to the second antenna, and sending a third message including the second random number through the second antenna; A session key is generated according to the first random number and the second random number, specific data is encrypted using the session key, and a fourth message is sent to the other electronic device, wherein the fourth message includes the encrypted specific data, and the specific data includes at least one of configuration information and user data.
17. The method according to claim 16, characterized in that After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the fourth message, a prompt is given that the specific data transmission is successful.
18. The method according to claim 17, characterized in that The using the session key to encrypt the specific data and sending a fourth message to the other electronic device specifically includes: Switch to the first antenna of the electronic device, and send the fourth message through the first antenna of the electronic device.
19. The method according to any one of claims 16 to 18, characterized in that: The method further includes: the fourth message further includes a first integrity check value of the specific data.
20. The method according to claim 17 or 18, characterized in that The prompting that the specific data is successfully transmitted includes: displaying a message that the specific data is successfully transmitted, and / or playing a voice message indicating that the specific data is successfully transmitted.
21. The method according to any one of claims 16 to 18, characterized in that: The configuration information includes one or more of network configuration information, sensor alarm threshold setting information, alarm trigger action information, silent time setting information, timer setting information, firmware upgrade setting information and power consumption threshold setting information; the user data includes one or more of application installation data, photos, videos, recordings and files stored on the electronic device, and operation logs of the electronic device.
22. A data transmission method, characterized in that: The method is applied to an electronic device, the electronic device comprising: one or more processors; one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method comprises: receiving an input; receiving a first message from another electronic device; In response to the first message, switch to the second antenna, generate a first random number, and send a second message including the first random number through the second antenna in a second period; receiving a third message from the other electronic device; In response to the third message, obtaining a second random number from the third message, and generating a session key according to the first random number and the second random number; receiving a fourth message from the other electronic device; In response to the fourth message, encrypted specific data is obtained from the fourth message, and the specific data is decrypted using the session key to obtain the specific data, where the specific data includes at least one of configuration information and user data.
23. The method according to claim 22, characterized in that The method further comprises: Receiving a first integrity check value of the specific data sent by the other electronic device, and calculating a second integrity check value of the specific data; After the second integrity check value is equal to the first integrity check value, a message that the specific data transmission is successful is sent to the other electronic device.
24. The method according to claim 23, characterized in that Sending a message that the specific data transmission is successful to the other electronic device specifically includes: Switch to the first antenna, and use the first antenna to send a message that the specific data is successfully transmitted.
25. A data transmission method, characterized in that: The method is applied to an electronic device, which is not connected to a routing device or a hotspot, and the electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, and the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method includes: An input is received; receiving a first message from another electronic device; In response to the first message, switch to the second antenna and send a second message through the second antenna; wherein the second message includes specific data of the electronic device, and the specific data is a log of the electronic device; After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the second message, a prompt is given indicating that the specific data transmission is successful.
26. A data transmission method, characterized in that: The method is applied to an electronic device, which is not connected to a routing device or a hotspot, and the electronic device includes: one or more processors; one or more memories; a first antenna; a second antenna, and the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein the first antenna and the second antenna are different antennas, and the transmission distance of the second antenna is less than the transmission distance of the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power configured by the second antenna is less than the transmission power configured by the first antenna; the method includes: An input is received; receiving a first message from another electronic device; In response to the first message, switch to the second antenna and send a second message through the second antenna; receiving a response message from the other electronic device to the second message; In response to the response message, switch to the first antenna, and send a third message containing specific data through the first antenna, where the specific data is a log of the electronic device; After receiving the message indicating that the specific data transmission is successful from the other electronic device, or after sending the third message, a prompt is given indicating that the specific data transmission is successful.
27. The method according to claim 26, characterized in that The second message includes a session key, and the third message contains specific data encrypted by the session key.
28. The method according to claim 27, characterized in that The session key is preset.
29. A computer-readable storage medium, characterized in that: The method comprises a computer program, which, when executed on an electronic device, enables the electronic device to execute the method according to any one of claims 15 to 28.
