Data transmission method, electronic device and computer program product

By using different channels of different near-field media for information exchange and verification between devices, the problems of low security of Bluetooth authentication and high power consumption of NFC authentication are solved, and device authentication with higher security and lower power consumption is achieved, which is suitable for various devices.

CN120676350APending Publication Date: 2025-09-19HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510294388.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Among existing device authentication methods, Bluetooth authentication has low security and is prone to information leakage, while NFC authentication requires chip configuration and increasing power consumption when the function is enabled, making it unable to meet the authentication requirements of all devices.

Method used

Requests and target information are sent through different channels of different near-field media, such as Bluetooth broadcast combined with Wi-Fi or Bluetooth broadcast combined with Star Flash unicast, to authenticate the device and send sensitive information only after verification to avoid leakage through a single channel.

Benefits of technology

It improves the security and reliability of device authentication, reduces the possibility of information leakage, avoids the increase in power consumption caused by turning on the NFC function, supports authentication of non-NFC devices, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120676350A_ABST
    Figure CN120676350A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of terminals, and provides a data transmission method, electronic equipment and a computer program product. According to the method, when data transmission needs to be carried out between devices, request sending and target information acquisition can be carried out between the devices based on different channels of different near-field media, and device authentication can be carried out based on the acquired target information, so that the difficulty of information interception is improved through the different channels of the different near-field media; the possibility of information leakage is reduced, and the security of equipment authentication is improved, so that the security of data transmission can be improved, and the user experience is improved. Besides, equipment authentication can be carried out between the equipment without an NFC function, equipment authentication between non-NFC equipment or equipment without starting the NFC function or equipment inconvenient to use NFC interaction can be realized, and power consumption increase caused by starting of the NFC function of the equipment can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and in particular relates to a data transmission method, electronic equipment, and computer program product. Background Art

[0002] When data needs to be transmitted between devices, device authentication is generally required. After the device authentication is passed, a connection is established for data transmission. Currently, there are generally two methods for device authentication. One is device authentication based on Bluetooth technology. That is, devices can obtain information based on Bluetooth and perform device authentication based on the obtained information. The other is device authentication based on near field communication (NFC) technology. That is, NFC tags can be set in the devices. Devices can obtain information by touching the NFC tags and perform device authentication based on the obtained information. Among them, when device authentication is based on Bluetooth technology, information is generally sent between devices through Bluetooth broadcasts. Bluetooth broadcasts are generally broadcast in plain text, making information easily leaked, resulting in lower security for device authentication. When device authentication is based on NFC technology, the device needs to be equipped with an NFC chip and the NFC function needs to be enabled on the device. For devices that are not equipped with an NFC chip, the NFC function is not enabled, or the NFC chip is located in a location that is not convenient for interaction with other devices, device authentication based on NFC technology is impossible or inconvenient. In addition, enabling the NFC function will increase the power consumption of the device. Summary of the Invention

[0003] The embodiments of the present application provide a data transmission method, electronic device, and computer program product that can send requests and obtain target information based on different channels of different near-field media, and can perform device authentication based on the obtained target information, thereby reducing the possibility of information leakage, improving the security of device authentication, and thus improving the security of data transmission. In addition, device authentication can be performed without relying on NFC functionality, enabling device authentication between non-NFC devices, devices that do not have NFC functionality enabled, or devices that are inconvenient to use NFC interaction, and avoiding the increase in power consumption caused by the activation of the NFC function of the device.

[0004] In a first aspect, an embodiment of the present application provides a data transmission method, applied to a first electronic device, the method comprising:

[0005] In response to a preset operation, the first electronic device sends a data transmission request through a first channel of a first near-field medium;

[0006] The first electronic device obtains second target information of the second electronic device through a second channel of the second near-field medium; the second target information is sent by the second electronic device to the first electronic device based on the data transmission request;

[0007] After determining, according to the second target information, that the second electronic device has passed verification, the first electronic device sends the first target information of the first electronic device to the second electronic device through a third channel of the second near-field medium;

[0008] After the second electronic device determines that the first electronic device has passed verification based on the first target information, the first electronic device establishes a connection channel with the second electronic device; the connection channel is used for data transmission between the first electronic device and the second electronic device.

[0009] In the data transmission method provided above, when data needs to be transmitted between a first electronic device and a second electronic device, the first electronic device and the second electronic device do not transmit the request and target information through the same channel, but rather transmit the request and target information through different channels of different near-field media, thereby increasing the difficulty of information interception through different channels of different near-field media and reducing the possibility of information leakage. In addition, when the first electronic device transmits the first target information of the first electronic device to the second electronic device, it can first verify the second electronic device based on the second target information of the second electronic device, so that the first target information of the first electronic device will be transmitted to the second electronic device only after the second electronic device passes the verification. If the second electronic device fails the verification, the first target information of the first electronic device will not be transmitted to the second electronic device, which can further reduce the possibility of leakage of the first target information and improve the security and reliability of the authentication between the first electronic device and the second electronic device. After the first electronic device verifies the second electronic device and the second electronic device verifies the first electronic device, the established connection channel has a higher security, thereby improving the security of data transmission and enhancing the user experience. In addition, the embodiments of the present application may not perform device authentication based on the NFC function, and may implement device authentication between non-NFC devices or devices that do not have the NFC function enabled or devices that are not convenient to use NFC interaction, thereby avoiding increased power consumption due to the activation of the NFC function of the device.

[0010] In some embodiments, after the first electronic device determines that the second electronic device has passed verification based on the second target information, the first electronic device sends the first target information of the first electronic device to the second electronic device through the third channel of the second near-field medium, including: after the first electronic device determines that the second electronic device has passed verification based on the second target information, the first electronic device encrypts the first target information of the first electronic device according to the second target information to obtain first encrypted information; the first electronic device sends the first encrypted information to the second electronic device through the third channel of the second near-field medium.

[0011] In the data transmission method provided in this embodiment, after the first electronic device determines that the second electronic device has passed verification, the first electronic device can encrypt the first target information of the first electronic device based on the second target information sent by the second electronic device, and can transmit the first encrypted information through the third channel of the second near-field medium to perform encrypted transmission of the first target information, which can reduce the possibility of the first target information of the first electronic device being leaked and improve the security of data transmission.

[0012] In some embodiments, the first near-field medium is Bluetooth, and the second near-field medium is Wireless Fidelity (Wi-Fi) or StarFlash.

[0013] In one embodiment, the first channel is a Bluetooth broadcast channel, the second channel and the third channel are Wi-Fi unicast channels, or the second channel and the third channel are StarFlash unicast channels.

[0014] In the data transmission method provided in this embodiment, the first electronic device can quickly send a data transmission request through Bluetooth broadcast. The second electronic device can quickly obtain the data transmission request of the first electronic device based on Bluetooth broadcast, and can send the second target information of the second electronic device to the first electronic device point-to-point through Wi-Fi unicast or Star Flash unicast, which can increase the transmission speed of the second target information, so that the first electronic device can quickly verify the second electronic device based on the second target information, thereby improving the verification speed. After the first electronic device verifies the second electronic device, the first electronic device can also send the first target information of the first electronic device to the second electronic device point-to-point through Wi-Fi unicast or Star Flash unicast, which can increase the transmission speed of the first target information, so that the second electronic device can quickly verify the first electronic device based on the first target information, thereby improving the verification speed, thereby improving the efficiency of data transmission between the first electronic device and the second electronic device and enhancing the user experience.

[0015] In one possible implementation, in response to a preset operation, the first electronic device sends a data transmission request through a first channel of a first near-field medium, including: in response to the preset operation, the first electronic device sends a Bluetooth broadcast, and the Bluetooth broadcast includes the data transmission request.

[0016] Exemplarily, the Bluetooth broadcast further includes address information of a first Wi-Fi unicast channel corresponding to the first electronic device; or, the Bluetooth broadcast further includes address information of a first StarFlash unicast channel corresponding to the first electronic device.

[0017] In some embodiments, the first electronic device obtains the second target information of the second electronic device through the second channel of the second near-field medium, including: the first electronic device obtains the second target information of the second electronic device through the first Wi-Fi unicast channel; or, the first electronic device obtains the second target information of the second electronic device through the first StarFlash unicast channel.

[0018] In the data transmission method provided in this embodiment, in order to enable the second electronic device to quickly send the second target information of the second electronic device to the first electronic device through Wi-Fi unicast or Star Flash unicast, the first electronic device can add the MAC address (for example, MAC address A1) or Star Flash address (for example, Star Flash address B1) corresponding to the first electronic device in the Bluetooth broadcast when broadcasting a Bluetooth broadcast containing a data transmission request. After the second electronic device obtains the Bluetooth broadcast sent by the first electronic device, it can obtain the MAC address A1 or Star Flash address B1 corresponding to the first electronic device according to the Bluetooth broadcast, and when determining to respond to the data transmission request of the first electronic device, it can send the second target information to the first electronic device point-to-point through the Wi-Fi unicast channel (for example, the unicast channel corresponding to MAC address A1) or Star Flash unicast channel (for example, the unicast channel corresponding to Star Flash address B1) according to the MAC address A1 or Star Flash address B1, thereby improving the transmission speed of the second target information.

[0019] In other embodiments, the method further includes: the first electronic device obtaining, through the second channel of the second near-field medium, the address information of the second Wi-Fi unicast channel corresponding to the second electronic device; or, the first electronic device obtaining, through the second channel of the second near-field medium, the address information of the second StarFlash unicast channel corresponding to the second electronic device.

[0020] In one embodiment, the first electronic device sending the first target information of the first electronic device to the second electronic device through the third channel of the second near-field medium includes: the first electronic device sending the first target information of the first electronic device to the second electronic device through the second Wi-Fi unicast channel; or the first electronic device sending the first target information of the first electronic device to the second electronic device through the second StarFlash unicast channel.

[0021] In the data transmission method provided in this embodiment, in order to enable the first electronic device to quickly send the first target information of the first electronic device to the second electronic device through Wi-Fi unicast or Star Flash unicast, the second electronic device can also send the MAC address (for example, MAC address A2) or Star Flash address B2 corresponding to the second electronic device to the first electronic device through the second channel of the second near-field medium when sending the second target information to the first electronic device through the second channel of the second near-field medium. After the first electronic device determines that the second electronic device has passed the verification based on the second target information, it can send the first target information to the second electronic device point-to-point through the Wi-Fi unicast channel (for example, the unicast channel corresponding to MAC address A2) or the Star Flash unicast channel (for example, the unicast channel corresponding to Star Flash address B2) based on the MAC address A2 or the Star Flash address B2, which can increase the transmission speed of the first target information, thereby increasing the speed at which the second electronic device verifies the first electronic device.

[0022] In some embodiments, after the second electronic device determines that the first electronic device has passed verification based on the first target information, the first electronic device establishes a connection channel with the second electronic device, including: the first electronic device obtains second encrypted information sent by the second electronic device through the fourth channel of the second near-field medium; the second encrypted information is obtained by the second electronic device encrypting the response information according to the first target information after the second electronic device determines that the first electronic device has passed verification based on the first target information; the response information is used to indicate that the second electronic device has passed verification of the first electronic device; the first electronic device decrypts the second encrypted information according to the first target information to obtain the response information, and establishes a connection channel with the second electronic device based on the response information.

[0023] In the data transmission method provided in this embodiment, when a first electronic device needs to send data to a second electronic device, after the second electronic device determines that the first electronic device has passed verification based on the first target information, that is, after determining that data can be transmitted with the first electronic device, the second electronic device can send a response message to the first electronic device. The response message can be used to indicate that the second electronic device has passed verification of the first electronic device, that is, the response message can be used to inform the first electronic device that it can transmit data to the second electronic device. To ensure the security of data transmission, when sending the response message to the first electronic device, the second electronic device can encrypt the response message based on the first target information of the first electronic device to obtain second encrypted information, and can send the second encrypted information to the first electronic device. After the first electronic device obtains the second encrypted information, it can decrypt the second encrypted information based on the first target information of the first electronic device to obtain the response information, and can establish a connection channel with the second electronic device based on the response information. That is, the second electronic device can perform encrypted transmission of the response information, which can reduce the possibility of the response information being leaked, improve the security of the connection channel established between the first electronic device and the second electronic device, and thus improve the security of data transmission.

[0024] In one embodiment, the method further includes: the first electronic device sending address information of a third Wi-Fi unicast channel corresponding to the first electronic device to the second electronic device through a third channel of the second near-field medium; or, the first electronic device sending address information of a third StarFlash unicast channel corresponding to the first electronic device to the second electronic device through the third channel of the second near-field medium.

[0025] In another embodiment, the first electronic device obtains the second encrypted information sent by the second electronic device through the fourth channel of the second near-field medium, including: the first electronic device obtains the second encrypted information sent by the second electronic device through the third Wi-Fi unicast channel; or, the first electronic device obtains the second encrypted information sent by the second electronic device through the third Star Flash unicast channel.

[0026] In the data transmission method provided in this embodiment, in order to enable the second electronic device to quickly send the second encrypted information to the first electronic device through Wi-Fi unicast or Star Flash unicast, the first electronic device can also send the MAC address (for example, MAC address A3) or Star Flash address (for example, Star Flash address B3) corresponding to the first electronic device to the second electronic device through the third channel of the second near-field medium. When the second electronic device needs to send the second encrypted information to the first electronic device, it can send the second encrypted information point-to-point to the first electronic device through the Wi-Fi unicast channel (for example, the unicast channel corresponding to MAC address A3) or Star Flash unicast channel (for example, the unicast channel corresponding to Star Flash address B3) based on MAC address A3 or Star Flash address B3, thereby increasing the transmission speed of the second encrypted information, thereby increasing the speed of establishing a connection channel between the first electronic device and the second electronic device.

[0027] In some embodiments, the first electronic device determines that the second electronic device has passed verification based on the second target information, including: the first electronic device determines a first distance between the first electronic device and the second electronic device; when the first distance is less than or equal to a first preset distance threshold, the first electronic device determines that the second electronic device has passed verification based on the second target information.

[0028] In the data transmission method provided in this embodiment, data transmission based on the bump operation is generally performed between electronic devices at close range. To ensure the security of data transmission, after the first electronic device obtains the second target information sent by the second electronic device, it can determine the first distance (e.g., distance B) between the first electronic device and the second electronic device, and can first perform a preliminary check on the second electronic device based on the first distance to determine whether the second electronic device is likely to be an electronic device that collides with the first electronic device. When it is determined that the first distance is less than or equal to a preset distance threshold (e.g., preset distance threshold B), that is, when it is determined that the second electronic device is likely to be an electronic device that collides with the first electronic device, the first electronic device can check the second electronic device based on the second target information, so that after the second electronic device passes the check, the first target information is sent to the second electronic device. When it is determined that the distance B is greater than the preset distance threshold B, that is, when it is determined that the second electronic device is unlikely to be an electronic device that collides with the first electronic device, the first electronic device may not respond to the second target information sent by the second electronic device, that is, the first electronic device may not check the second electronic device based on the second target information, and thus may not send the first target information to the second electronic device.

[0029] Exemplarily, the preset operation includes a tap operation.

[0030] In the data transmission method provided in this embodiment, when data needs to be transmitted between a first electronic device and a second electronic device, the user only needs to touch the first electronic device to the second electronic device, and device authentication can be performed between the first electronic device and the second electronic device. After the device authentication is passed, a connection channel can be established between the first electronic device and the second electronic device to securely transmit data based on the established connection channel. Device authentication does not need to be based on the NFC function, and device authentication can be achieved between non-NFC devices or devices that do not have the NFC function turned on or devices that are not convenient to use NFC interaction, and the increase in power consumption due to the activation of the NFC function of the device can be avoided.

[0031] It should be understood that the embodiments of the present application do not restrict the location of the collision between the first and second electronic devices. For example, a user can collide any area of ​​the first electronic device with any area of ​​the second electronic device to perform device authentication between the first and second electronic devices based on the collision. After the device authentication is successful, a secure connection channel is established between the first and second electronic devices for data transmission.

[0032] In some embodiments, the second target information includes device information and / or service information of the second electronic device, and the service information of the second electronic device is information of a second service that requires data transmission in the second electronic device.

[0033] In some other embodiments, the first target information includes device information and / or service information of the first electronic device, and the service information of the first electronic device is information of a first service that requires data transmission in the first electronic device.

[0034] Exemplarily, the device information includes a device certificate, a device account certificate, a compilation signature certificate of the device operating system, an identity identifier of the device, or a device account; and the service information includes a software signature certificate of the service.

[0035] In a second aspect, an embodiment of the present application provides a data transmission method, applied to a second electronic device, the method comprising:

[0036] The second electronic device obtains, through the first channel of the first near-field medium, a data transmission request sent by the first electronic device;

[0037] The second electronic device sends second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request;

[0038] The second electronic device obtains the first target information sent by the first electronic device through the third channel of the second near-field medium; the first target information is sent by the first electronic device to the second electronic device after the first electronic device determines that the second electronic device has passed verification based on the second target information;

[0039] After determining that the first electronic device has passed verification according to the first target information, the second electronic device establishes a connection channel with the first electronic device; the connection channel is used for data transmission between the first electronic device and the second electronic device.

[0040] In some embodiments, the second electronic device obtains the first target information sent by the first electronic device through the third channel of the second near-field medium, including: the second electronic device obtains the first encrypted information sent by the first electronic device through the third channel of the second near-field medium; the first encrypted information is obtained by the first electronic device encrypting the first target information of the first electronic device according to the second target information after the first electronic device determines that the second electronic device has passed verification according to the second target information; the second electronic device decrypts the first encrypted information according to the second target information to obtain the first target information of the first electronic device.

[0041] In some embodiments, the first near-field medium is Bluetooth, and the second near-field medium is Wireless Fidelity (Wi-Fi) or StarFlash.

[0042] In one embodiment, the first channel is a Bluetooth broadcast channel, the second channel and the third channel are Wi-Fi unicast channels, or the second channel and the third channel are StarFlash unicast channels.

[0043] In a possible implementation, the second electronic device obtains the data transmission request sent by the first electronic device through the first channel of the first near-field medium, including: the second electronic device obtains the Bluetooth broadcast broadcast by the first electronic device, and the Bluetooth broadcast includes the data transmission request.

[0044] Exemplarily, the Bluetooth broadcast further includes address information of a first Wi-Fi unicast channel corresponding to the first electronic device; or, the Bluetooth broadcast further includes address information of a first StarFlash unicast channel corresponding to the first electronic device.

[0045] In some embodiments, the second electronic device sends the second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request, including: the second electronic device sends the second target information to the first electronic device through the first Wi-Fi unicast channel according to the data transmission request; or, the second electronic device sends the second target information to the first electronic device through the first StarFlash unicast channel according to the data transmission request.

[0046] In some other embodiments, the method further includes: the second electronic device sending address information of a second Wi-Fi unicast channel corresponding to the second electronic device to the first electronic device through the second channel of the second near-field medium; or, the second electronic device sending address information of a second StarFlash unicast channel corresponding to the second electronic device to the first electronic device through the second channel of the second near-field medium.

[0047] In one embodiment, the second electronic device obtains the first target information sent by the first electronic device through the third channel of the second near-field medium, including: the second electronic device obtains the first target information sent by the first electronic device through the second Wi-Fi unicast channel; or, the second electronic device obtains the first target information sent by the first electronic device through the second Star Flash unicast channel.

[0048] In some embodiments, after the second electronic device determines that the first electronic device has passed verification based on the first target information, the second electronic device establishes a connection channel with the first electronic device, including: after the second electronic device determines that the first electronic device has passed verification based on the first target information, the second electronic device encrypts the response information according to the first target information to obtain second encrypted information; the response information is used to indicate that the second electronic device has passed the verification of the first electronic device; the second electronic device sends the second encrypted information to the first electronic device through the fourth channel of the second near-field medium, and the second encrypted information is used to indicate that the first electronic device can establish a connection channel with the second electronic device.

[0049] In one embodiment, the method further includes: the second electronic device obtaining, through the third channel of the second near-field medium, the address information of the third Wi-Fi unicast channel corresponding to the first electronic device sent by the first electronic device; or, the second electronic device obtaining, through the third channel of the second near-field medium, the address information of the third Star Flash unicast channel corresponding to the first electronic device sent by the first electronic device.

[0050] In another embodiment, the second electronic device sends the second encrypted information to the first electronic device through the fourth channel of the second near-field medium, including: the second electronic device sends the second encrypted information to the first electronic device through the third Wi-Fi unicast channel; or, the second electronic device sends the second encrypted information to the first electronic device through the third Star Flash unicast channel.

[0051] In some embodiments, the second electronic device sends second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request, including: the second electronic device determines a second distance between the second electronic device and the first electronic device; when the second distance is less than or equal to a second preset distance threshold, the second electronic device sends the second target information to the first electronic device through the second channel of the second near-field medium according to the data transmission request.

[0052] In some embodiments, the second target information includes device information and / or service information of the second electronic device, and the service information of the second electronic device is information of a second service that requires data transmission in the second electronic device.

[0053] In some other embodiments, the first target information includes device information and / or service information of the first electronic device, and the service information of the first electronic device is information of a first service that requires data transmission in the first electronic device.

[0054] Exemplarily, the device information includes a device certificate, a device account certificate, a compilation signature certificate of the device operating system, an identity identifier of the device, or a device account; and the service information includes a software signature certificate of the service.

[0055] In a third aspect, an embodiment of the present application provides a data transmission device, which is applied to a first electronic device. The data transmission device may include one or more modules, and each module may correspond to implement each step of the data transmission method described in any one of the first aspects above.

[0056] In a fourth aspect, an embodiment of the present application provides a data transmission device, which is applied to a second electronic device. The data transmission device may include one or more modules, and each module may correspond to implement each step of the data transmission method described in any one of the second aspects above.

[0057] In a fifth aspect, an embodiment of the present application provides a data transmission system, comprising a first electronic device and a second electronic device; the first electronic device is used to execute the steps of the data transmission method described in any one of the first aspects above; the second electronic device is used to execute the steps of the data transmission method described in any one of the second aspects above.

[0058] In the sixth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the electronic device implements the data transmission method described in any one of the first aspects above, or implements the data transmission method described in any one of the second aspects above.

[0059] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by an electronic device, the electronic device implements the data transmission method described in any one of the first aspects above, or implements the data transmission method described in any one of the second aspects above.

[0060] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by an electronic device, the electronic device implements the data transmission method described in any one of the first aspects above, or implements the data transmission method described in any one of the second aspects above.

[0061] It can be understood that the beneficial effects of the second to eighth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flow chart of a data transmission method;

[0063] Figure 2 is a structural diagram of an electronic device provided in an embodiment of the present application;

[0064] Figure 3 Schematic diagram of the software architecture of the electronic device provided in the embodiment of the present application;

[0065] Figure 4 This is a flow diagram of the data transmission method provided in the embodiment of the present application. Figure 1 ;

[0066] Figure 5 This is a flow diagram of the data transmission method provided in the embodiment of the present application. Figure 2 ;

[0067] Figure 6This is a flow diagram of the data transmission method provided in the embodiment of the present application. Figure 3 ;

[0068] Figure 7 This is a flow diagram of the data transmission method provided in the embodiment of the present application. Figure 4 . DETAILED DESCRIPTION

[0069] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0070] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0071] In the description of this application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0072] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of the present application include a particular feature, structure, or characteristic described in conjunction with the embodiment. Therefore, phrases such as "in one embodiment," "in some embodiments," "in another embodiment," and "in other embodiments" that appear in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0073] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.

[0074] The steps involved in the data transmission method provided in the embodiments of the present application are merely examples. Not all steps are mandatory, nor are all information or messages required. These steps can be added or removed as needed during use. In the embodiments of the present application, the same step or steps or messages with the same function can be referenced and learned from each other in different embodiments.

[0075] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0076] When data needs to be transmitted between devices, device authentication is generally required. After successful authentication, a connection can be established for data transmission. There are generally two methods for device authentication. One is based on Bluetooth technology. Devices can acquire information via Bluetooth and authenticate each other based on the acquired information. The other is based on NFC technology. Devices can be equipped with NFC tags. Devices can acquire information by touching the NFC tag together and authenticate each other based on the acquired information. When using Bluetooth technology for device authentication, information is typically transmitted between devices via Bluetooth broadcasts. Bluetooth broadcasts are typically broadcast in plain text, making information vulnerable to leakage and reducing the security of device authentication. When using NFC technology for device authentication, the device must be equipped with an NFC chip and have the NFC function enabled. For devices without an NFC chip, or with the NFC function disabled, or whose NFC chip is located in a location that is inconvenient for interaction with other devices, device authentication based on NFC technology is impossible or inconvenient. Furthermore, enabling the NFC function increases the device's power consumption.

[0077] For example, see Figure 1 , Figure 1 A flow chart of a data transmission method is shown.

[0078] like Figure 1 As shown, when electronic device A needs to transmit data to electronic device B, the user can touch electronic device A to electronic device B. After detecting the touch operation, electronic device A can send a data transmission request through a channel (such as channel A). Electronic device B can obtain the data transmission request of electronic device A through channel A. After obtaining the data transmission request of electronic device A, electronic device B can determine whether a touch operation is detected. After determining that the touch operation is detected, electronic device B can send response information to electronic device A through channel A, such as sending an identifier such as the device name corresponding to electronic device B. After receiving the response information, electronic device A can verify the response information, for example, it can verify an identifier such as the device name corresponding to electronic device B. After the response information is verified, another channel (such as channel B) can be established between electronic device A and electronic device B for data transmission.

[0079] In the above-mentioned data transmission method, electronic devices A and B generally use a channel (i.e., channel A) to send data transmission requests and reply to response information. Channel A is generally a channel based on Bluetooth technology, such as a Bluetooth broadcast channel. That is, the amount of data that channel A can carry is generally small, usually a few bytes, and can only carry identifiers such as device names in plain text. An attacker only needs to obtain channel A to obtain all information about electronic devices A and B, resulting in low authentication security between electronic devices A and B, and thus low data transmission security between electronic devices A and B. To address the above-mentioned problems, embodiments of the present application provide a data transmission method, electronic device, and computer program product. In this method, when data transmission is required between a first electronic device and a second electronic device, the first electronic device can, in response to a preset operation, send a data transmission request via a first channel of a first near-field medium. The second electronic device can obtain the data transmission request sent by the first electronic device and, based on the data transmission request, send second target information of the second electronic device to the first electronic device via a second channel of a second near-field medium. After the first electronic device obtains the second target information, it can verify the second electronic device based on the second target information. When it is determined that the second electronic device has passed the verification based on the second target information, the first electronic device can send the first target information of the first electronic device to the second electronic device. After the second electronic device obtains the first target information, it can verify the first electronic device according to the first target information. After determining that the first electronic device has passed the verification according to the first target information, a connection channel can be established between the first electronic device and the second electronic device for data transmission.

[0080] That is, in the embodiment of the present application, when data needs to be transmitted between the first electronic device and the second electronic device, the first electronic device and the second electronic device do not transmit the request and target information through the same channel, but rather transmit the request and target information through different channels of different near-field media, so as to increase the difficulty of information interception through different channels of different near-field media and reduce the possibility of information leakage. In addition, when the first electronic device transmits the first target information of the first electronic device to the second electronic device, it can first verify the second electronic device based on the second target information of the second electronic device, so that the first target information of the first electronic device will be transmitted to the second electronic device only after the second electronic device passes the verification. If the second electronic device fails the verification, the first target information of the first electronic device will not be transmitted to the second electronic device. This can further reduce the possibility of leakage of the first target information, improve the security and reliability of the authentication between the first electronic device and the second electronic device, and ensure that the connection channel established after the first electronic device verifies the second electronic device and the second electronic device verifies the first electronic device has a higher security, thereby improving the security of data transmission and enhancing the user experience. In addition, the embodiments of the present application can perform device authentication without relying on the NFC function, and can implement device authentication between non-NFC devices or devices that do not have the NFC function enabled or devices that are not convenient to use NFC interaction. It can avoid the increase in power consumption caused by the activation of the NFC function of the device, and has strong ease of use and practicality.

[0081] In the embodiments of the present application, the electronic device (for example, the first electronic device or the second electronic device) can be a mobile phone, a tablet computer, a wearable device (for example, a smart watch or a smart bracelet), a smart home device (for example, a smart TV or a smart speaker), a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or a desktop computer, etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.

[0082] The following first introduces the electronic device involved in the embodiment of this application. Figure 2 , Figure 2 A structural diagram of an electronic device 200 provided in an embodiment of the present application is shown.

[0083] The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a camera 291, and a display 292. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, and the like.

[0084] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0085] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0086] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0087] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0088] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0089] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0090] The charging management module 240 is configured to receive charging input from a charger. The power management module 241 is configured to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 and provides power to the processor 210, the internal memory 221, the display 292, the camera 291, and the wireless communication module 260. The wireless communication function of the electronic device 200 is implemented through antenna 1, antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor.

[0091] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0092] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 200. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0093] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 292. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.

[0094] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0095] In some embodiments, antenna 1 of electronic device 200 is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, so that electronic device 200 can communicate with a network and other devices via wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0096] Electronic device 200 implements display functionality through a GPU, display screen 292, and an application processor. The GPU is a microprocessor for image processing that connects display screen 292 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0097] Display screen 292 is used to display images, videos, and the like. Display screen 292 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 200 may include one or N display screens 292, where N is a positive integer greater than one.

[0098] The electronic device 200 can implement a shooting function through an ISP, a camera 291, a video codec, a GPU, a display screen 292, and an application processor.

[0099] The ISP is used to process data fed back by the camera 291 .

[0100] The camera 291 is used to capture still images or videos. In some embodiments, the electronic device 200 may include 1 or N cameras 291, where N is a positive integer greater than 1.

[0101] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0102] Video codecs are used to compress or decompress digital video. Electronic device 200 may support one or more video codecs. This allows electronic device 200 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0103] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 200, such as image recognition, face recognition, speech recognition, and text comprehension.

[0104] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0105] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.

[0106] The electronic device 200 can implement audio functions such as music playback and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

[0107] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 270 can also be used to encode and decode audio signals.

[0108] The buttons 290 include a power button, a volume button, and the like. The buttons 290 may be mechanical buttons or touch buttons. The electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200.

[0109] The software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. For example, the software system of the electronic device 200 may adopt an Android operating system (OS), a Harmony OS, or an IOS operating system with a layered architecture. The embodiment of the present application takes a layered architecture as an example to illustrate the software structure of the electronic device 200.

[0110] Figure 3It is a software structure block diagram of the electronic device 200 according to an embodiment of the present application.

[0111] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, an operating system is divided into four layers: the application layer, the application framework layer, the runtime and system libraries layer, and the kernel layer.

[0112] The application layer can include a series of application packages.

[0113] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0114] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0115] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0116] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0117] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0118] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0119] The phone manager is used to provide communication functions of the electronic device 200, such as management of call status (including answering, hanging up, etc.).

[0120] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0121] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0122] The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the operating system.

[0123] The core library consists of two parts: one is the function that the Java language needs to call, and the other is the core library of the operating system.

[0124] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0125] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0126] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0127] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0128] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0129] A 2D graphics engine is a drawing engine for 2D drawings.

[0130] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0131] The data transmission method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings and specific application scenarios.

[0132] See also Figure 4 , Figure 4 The data transmission method provided in this embodiment is shown in FIG. Figure 1 The method can be applied to a transmission system including a first electronic device and a second electronic device. Figure 4 As shown, the method may include:

[0133] S401: The first electronic device detects a preset operation.

[0134] It should be noted that the preset operation can be determined according to the actual scenario, and the embodiments of the present application do not limit this. For example, the preset operation can be determined as a bump operation according to the actual scenario. Among them, the bump operation can refer to an operation in which the first electronic device collides with the second electronic device. The following will be exemplified by taking the preset operation as an example of the bump operation. It should be understood that the embodiments of the present application do not limit the specific method for the first electronic device to detect the bump operation, and it can be determined specifically according to the actual scenario.

[0135] For example, when a first electronic device collides with a second electronic device, motion data of the first electronic device may change. Specifically, the first electronic device may include a motion sensor. The first electronic device may detect the motion data of the first electronic device via the motion sensor and determine whether a bump operation has been detected based on the motion data of the first electronic device.

[0136] For example, the motion data may include acceleration. The first electronic device may include an acceleration sensor. That is, the first electronic device may detect the acceleration of the first electronic device through the acceleration sensor, for example, detecting the acceleration of the first electronic device in various directions (generally three axes, i.e., the x, y, and z axes), and may determine whether a bump operation is detected based on the acceleration.

[0137] For example, the motion data may also include angular velocity. The first electronic device may also include a gyroscope sensor. That is, the first electronic device may further detect the angular velocity of the first electronic device using the gyroscope sensor, for example, detecting the angular velocity of the first electronic device around three axes (i.e., the x, y, and z axes). The first electronic device may determine whether a bump operation is detected based on the acceleration detected by the acceleration sensor and the angular velocity detected by the gyroscope sensor.

[0138] S402: The first electronic device sends a data transmission request through a first channel of a first near-field medium in response to a preset operation.

[0139] Exemplarily, a data transmission request can be used to request data transmission. For example, it can be used to request data to be sent to another electronic device, or it can be used to request data to be retrieved from another electronic device. The content included in the data transmission request can be determined based on the actual scenario and is not limited in this embodiment of the present application. For example, the data transmission request can include a message code of 1 to 2 bytes. The message code can be used to indicate the type of data to be transmitted. That is, the data transmission request can include the type of data to be transmitted, but may not include device information and / or service information of the first electronic device, thereby reducing the amount of data in the data transmission request and reducing the possibility of leakage of device information and / or service information. It should be understood that the type of data and the message code corresponding to the data type can be determined in advance by the first and second electronic devices through negotiation. For example, the first and second electronic devices can determine in advance that the data type includes one or more of text, images, audio, or video. For example, the first and second electronic devices can determine in advance that the message code corresponding to text is 6, the message code corresponding to images is 7, the message code corresponding to audio is 8, and the message code corresponding to video is 9, etc. Alternatively, the type of data and the message code corresponding to the data type can be pre-set by the producers (or manufacturers) of the first and second electronic devices and pre-set at the factory.

[0140] It should be noted that device information may refer to information related to the device. For example, device information may include a device certificate, a device account certificate, a compilation signature certificate of the device operating system, a device identification (ID) or a device account, etc. Business information may refer to information related to a certain business (such as a first business) in the device. The first business may be a business that requires data transmission. For example, business information may include a software signature certificate for the business, etc. Among them, the device account may be the account itself, or it may be a hash value of the account.

[0141] Exemplarily, the first near-field medium may be Bluetooth. The first channel may be a Bluetooth channel. For example, the first channel may be a Bluetooth broadcast channel. That is, the first electronic device and the second electronic device may be electronic devices that support Bluetooth functionality. Before the first electronic device collides with the second electronic device, the first electronic device and the second electronic device may turn on the Bluetooth functionality. After the first electronic device detects the bump operation, the first electronic device may broadcast a Bluetooth broadcast containing a data transmission request to send the data transmission request via the Bluetooth broadcast. Other electronic devices that support Bluetooth functionality around the first electronic device, such as a second electronic device that supports Bluetooth functionality, may obtain the Bluetooth broadcast broadcast by the first electronic device, thereby obtaining the data transmission request of the first electronic device.

[0142] In some embodiments, after the first electronic device detects the bump operation, the first electronic device may determine that the first electronic device needs to perform data transmission. At this time, the first electronic device may send a data transmission request through a first channel (e.g., a Bluetooth broadcast channel) of the first near-field medium.

[0143] In other embodiments, after the first electronic device detects the bump operation, the first electronic device may determine whether the first electronic device is in a state where data transmission is pending. When it is determined that the first electronic device is in a state where data transmission is pending, the first electronic device may determine that the first electronic device needs to perform data transmission. At this time, the first electronic device may send a data transmission request via a first channel of the first near-field medium (e.g., a Bluetooth broadcast channel). When it is determined that the first electronic device is not in a state where data transmission is pending, the first electronic device may not send the data transmission request.

[0144] It should be understood that the first electronic device being in a state of waiting for data transmission may refer to a service (e.g., a first service) in the first electronic device being in a state of waiting for data transmission. Whether the first service in the first electronic device is in a state of waiting for data transmission can be determined based on actual scenarios.

[0145] For example, when the first service of the first electronic device (such as a gallery application) is in a state of displaying a certain picture, or in a state of selecting one or more pictures, it can be considered that the gallery application of the first electronic device is in a state of waiting for data transmission, that is, it can be considered that the first electronic device is in a state of waiting for data transmission.

[0146] For example, when the first service of the first electronic device (such as a music application or a video application, etc.) is in a playback state, or in a state in which one or more files are selected, it can be considered that the music application or video application of the first electronic device is in a state of waiting for data transmission, that is, the first electronic device can be considered to be in a state of waiting for data transmission.

[0147] It should be noted that the above-mentioned sending of a data transmission request by the first electronic device through the first channel of the first near-field medium after the first electronic device detects the bump operation is only explained as an example and should not be understood as a limitation on the embodiments of the present application. In the embodiments of the present application, after the first electronic device collides with the second electronic device, the second electronic device may also detect the bump operation. After the second electronic device detects the bump operation, the second electronic device may also send a data transmission request through the first channel of the first near-field medium (such as a Bluetooth broadcast channel). Alternatively, after the second electronic device detects the bump operation, the second electronic device may determine whether the second electronic device is in a state where data transmission is to be performed. When it is determined that the second electronic device is in a state where data transmission is to be performed, the second electronic device may send a data transmission request through the first channel of the first near-field medium.

[0148] That is, after the first electronic device collides with the second electronic device, both the first electronic device and the second electronic device can detect the bump operation. After the first electronic device detects the bump operation, the first electronic device sends a data transmission request to the second electronic device via the first channel of the first near-field medium, or the first electronic device can determine whether the first electronic device is in a state where data transmission is pending. If it is determined that the first electronic device is in a state where data transmission is pending, the first electronic device can send a data transmission request to the second electronic device via the first channel of the first near-field medium.

[0149] Similarly, after the second electronic device detects the bump operation, the second electronic device sends a data transmission request to the first electronic device via the first channel of the first near-field medium, or the second electronic device can determine whether the second electronic device is in a state where data transmission is pending. When it is determined that the second electronic device is in a state where data transmission is pending, the second electronic device can send a data transmission request to the first electronic device via the first channel of the first near-field medium.

[0150] It should be understood that the second electronic device may also determine whether a bump operation is detected based on the motion data of the second electronic device. That is, the second electronic device may include a motion sensor. The second electronic device may detect the motion data of the second electronic device via the motion sensor and determine whether a bump operation is detected based on the motion data of the second electronic device.

[0151] For example, the second electronic device may include an acceleration sensor. The second electronic device may detect the acceleration of the second electronic device through the acceleration sensor, for example, detecting the acceleration of the second electronic device in various directions (generally three axes, i.e., x, y, and z axes), and may determine whether a bump operation is detected based on the acceleration.

[0152] For example, the second electronic device may further include a gyroscope sensor. The second electronic device may detect the angular velocity of the second electronic device using the gyroscope sensor, for example, detecting the angular velocity of the second electronic device around three axes (i.e., the x, y, and z axes). The second electronic device may determine whether a bump operation is detected based on the acceleration detected by the acceleration sensor and the angular velocity detected by the gyroscope sensor.

[0153] In addition, the second electronic device being in a state of waiting for data transmission may refer to a service (such as a second service) in the second electronic device being in a state of waiting for data transmission. Whether the second service in the second electronic device is in a state of waiting for data transmission can be determined according to actual scenarios.

[0154] For example, when the second service of the second electronic device (such as a gallery application) is in a state of displaying a certain picture, or in a state of selecting one or more pictures, it can be considered that the gallery application of the second electronic device is in a state of waiting for data transmission, that is, it can be considered that the second electronic device is in a state of waiting for data transmission.

[0155] For example, when the second service of the second electronic device (such as a music application or a video application, etc.) is in a playback state, or in a state in which one or more files are selected, it can be considered that the music application or video application of the second electronic device is in a state of waiting for data transmission, that is, the second electronic device can be considered to be in a state of waiting for data transmission.

[0156] It should be noted that when the first electronic device and the second electronic device respectively send data transmission requests based on the detected touch operation, device authentication can be performed according to one of the data transmission requests (for example, the data transmission request sent by the first electronic device or the data transmission request sent by the second electronic device) to establish a connection channel between the first electronic device and the second electronic device. After the connection channel between the first electronic device and the second electronic device is established, the first electronic device can transmit data to the second electronic device through the established connection channel. Similarly, the second electronic device can also transmit data to the first electronic device through the established connection channel. The embodiment of the present application will be exemplified by taking the first electronic device sending a data transmission request and performing device authentication according to the data transmission request sent by the first electronic device as an example.

[0157] S403: The second electronic device obtains a data transmission request sent by the first electronic device through the first channel of the first near-field medium.

[0158] It should be understood that the second electronic device can be an electronic device that supports Bluetooth functionality. Before the first electronic device collides with the second electronic device, the second electronic device can enable Bluetooth functionality. When data is transmitted between the first and second electronic devices based on a bump operation, the second electronic device is generally located near the first electronic device. Therefore, when the first electronic device broadcasts Bluetooth, the second electronic device can obtain the Bluetooth broadcast broadcast by the first electronic device, and thus can obtain the data transmission request of the first electronic device based on the Bluetooth broadcast broadcast by the first electronic device.

[0159] S404: The second electronic device sends second target information to the first electronic device through the second channel of the second near-field medium based on the data transmission request.

[0160] In some embodiments, after the second electronic device obtains the data transmission request sent by the first electronic device based on Bluetooth broadcast, it can identify the message code in the data transmission request, that is, it can determine whether the message code is a pre-agreed message code. When it is determined that the message code is not a pre-agreed message code, the second electronic device can determine that the message code cannot be identified. At this time, the second electronic device may not respond to the data transmission request sent by the first electronic device. When it is determined that the message code is a pre-agreed message code, the second electronic device can respond to the data transmission request sent by the first electronic device. That is, the second electronic device can send the second target information of the second electronic device to the first electronic device through the second channel of the second near-field medium, so that the first electronic device can verify the second electronic device based on the second target information of the second electronic device.

[0161] Exemplarily, the second target information may include device information and / or service information of the second electronic device. For example, the second target information may include one or more of the following: a device certificate corresponding to the second electronic device, a device account certificate, a compilation signature certificate of the device operating system, a device ID, a device account, or a software signature certificate of a service.

[0162] In some embodiments, the second near-field medium may be Wi-Fi. The second channel may be a Wi-Fi channel. That is, both the first electronic device and the second electronic device may be Wi-Fi-enabled electronic devices. Before the first electronic device collides with the second electronic device, both the first electronic device and the second electronic device may enable Wi-Fi to acquire target information based on the Wi-Fi, thereby performing device authentication based on the acquired target information.

[0163] In one embodiment, to increase verification speed and improve data transmission efficiency, the second channel can be a Wi-Fi unicast channel. That is, after the second electronic device obtains the data transmission request sent by the first electronic device based on the Bluetooth broadcast of the first electronic device, it can send the second target information of the second electronic device to the first electronic device via Wi-Fi unicast. By directly sending the second target information to the first electronic device in a Wi-Fi point-to-point manner, the transmission speed of the second target information can be increased, allowing the first electronic device to quickly verify the second electronic device based on the second target information, thereby improving verification speed.

[0164] In one possible implementation, in order to enable the second electronic device to quickly send the second target information of the second electronic device to the first electronic device via Wi-Fi unicast, the first electronic device may add the media access control address (MAC address) corresponding to the first electronic device in the Bluetooth broadcast when broadcasting a Bluetooth broadcast containing a data transmission request. That is, the Bluetooth broadcast broadcast by the first electronic device may include the data transmission request and the MAC address corresponding to the first electronic device (for ease of understanding, it may be referred to as MAC address A1). After the second electronic device obtains the Bluetooth broadcast sent by the first electronic device, it may obtain the MAC address A1 corresponding to the first electronic device based on the Bluetooth broadcast, and when determining to respond to the data transmission request of the first electronic device, it may send the second target information to the first electronic device point-to-point through a Wi-Fi unicast channel (e.g., a unicast channel corresponding to MAC address A1) based on the MAC address A1 corresponding to the first electronic device, thereby improving the transmission speed of the second target information.

[0165] For example, the MAC address A1 may be the real hardware MAC address of the first electronic device, that is, the second electronic device may send the second target information of the second electronic device to the first electronic device in a point-to-point manner based on the real hardware MAC address of the first electronic device.

[0166] For example, to reduce the possibility of MAC address A1 being counterfeited and improve the security of data transmission, the MAC address A1 corresponding to the first electronic device can be a randomized MAC address temporarily generated by the first electronic device. A randomized MAC address is a dynamically generated MAC address that can be used to replace the actual hardware MAC address of the electronic device. A randomized MAC address allows the electronic device to use different MAC addresses for communication in different communications, thereby reducing the possibility of the electronic device being tracked and improving the security of data transmission.

[0167] For example, after detecting the bump operation, the first electronic device can temporarily generate a MAC address A1 corresponding to the first electronic device (i.e., a random MAC address), and can send the MAC address A1 corresponding to the first electronic device to the second electronic device via Bluetooth broadcast. When the second electronic device determines to respond to the data transmission request sent by the first electronic device, it can send the second target information to the first electronic device in a point-to-point manner based on the MAC address A1 corresponding to the first electronic device.

[0168] In some other embodiments, the second near-field medium may be a NearLink. The second channel may be a NearLink channel.

[0169] In one embodiment, to increase verification speed and improve data transmission efficiency, the second channel can be a Star Flash unicast channel. That is, after the second electronic device obtains the data transmission request sent by the first electronic device based on the Bluetooth broadcast of the first electronic device, it can send the second target information of the second electronic device to the first electronic device via Star Flash unicast. By directly sending the second target information to the first electronic device in a Star Flash point-to-point manner, the transmission speed of the second target information can be increased, so that the first electronic device can quickly verify the second electronic device based on the second target information, thereby improving the verification speed.

[0170] In one possible implementation, in order to enable the second electronic device to quickly send the second target information of the second electronic device to the first electronic device through Star Flash unicast, the first electronic device can add the Star Flash communication address corresponding to the first electronic device (for ease of understanding, it can be called Star Flash address B1) in the Bluetooth broadcast when broadcasting a Bluetooth broadcast containing a data transmission request. That is, the Bluetooth broadcast broadcast by the first electronic device can include a data transmission request and the Star Flash address B1 corresponding to the first electronic device. After the second electronic device obtains the Bluetooth broadcast sent by the first electronic device, it can obtain the Star Flash address B1 corresponding to the first electronic device according to the Bluetooth broadcast, and when determining to respond to the data transmission request of the first electronic device, it can send the second target information of the second electronic device to the first electronic device point-to-point through the Star Flash unicast channel (for example, the unicast channel corresponding to the Star Flash address B1) according to the Star Flash address B1 corresponding to the first electronic device to improve the transmission speed of the second target information.

[0171] It should be noted that, in order to reduce the possibility of the Star Flash communication address being counterfeited and improve the security of data transmission, the Star Flash address B1 corresponding to the first electronic device can be a random Star Flash address temporarily generated by the first electronic device. For example, after detecting a tap operation, the first electronic device can temporarily generate the Star Flash address B1 corresponding to the first electronic device (i.e., a random Star Flash address) and can send the Star Flash address B1 corresponding to the first electronic device to the second electronic device via Bluetooth broadcast.

[0172] In some embodiments, data transmission based on the bump operation is generally carried out between electronic devices at a close distance. In order to ensure the security of data transmission, after the second electronic device obtains the data transmission request of the first electronic device, it can determine the distance between the second electronic device and the first electronic device (for example, it can be called distance A), and can determine whether to respond to the data transmission request of the first electronic device based on the distance A, that is, determine whether to send the second target information to the first electronic device. When it is determined that the distance A is less than or equal to a preset distance threshold (for example, the preset distance threshold A), the second electronic device can send the second target information to the first electronic device. When it is determined that the distance A is greater than the preset distance threshold A, the second electronic device may not respond to the data transmission request of the first electronic device, that is, the second electronic device may not send the second target information to the first electronic device.

[0173] For example, a distance measuring device (such as a distance sensor) may be provided in the second electronic device. After the second electronic device receives the data transmission request sent by the first electronic device, the second electronic device may measure the distance A between the second electronic device and the first electronic device through the distance sensor in the second electronic device, and may determine whether to respond to the data transmission request sent by the first electronic device based on whether the distance A is less than or equal to a preset distance threshold A.

[0174] It should be noted that the preset distance threshold A can be determined based on the actual scenario, and the embodiments of the present application are not limited thereto. For example, the preset distance threshold A can be determined to be 10 cm based on the actual scenario. For example, the preset distance threshold A can be determined to be 15 cm based on the actual scenario, and so on.

[0175] In other embodiments, after the second electronic device obtains the data transmission request from the first electronic device, it can determine whether there is a service in the second electronic device that supports the data requested to be transmitted by the data transmission request. When it is determined that there is a service in the second electronic device that supports the data requested to be transmitted by the data transmission request, the second electronic device can send the second target information to the first electronic device. When it is determined that there is no service in the second electronic device that supports the data requested to be transmitted by the data transmission request, the second electronic device can determine that the second electronic device cannot perform data transmission with the first electronic device. At this time, the second electronic device may not respond to the data transmission request of the first electronic device, that is, the second electronic device may not send the second target information to the first electronic device.

[0176] S405: The first electronic device obtains second target information through the second channel of the second near-field medium, and verifies the second electronic device according to the second target information.

[0177] It should be understood that after the second electronic device sends the second target information to the first electronic device through the second channel of the second near-field medium, the first electronic device can obtain the second target information of the second electronic device. After obtaining the second target information, the first electronic device can verify the second electronic device based on the second target information to determine whether the second electronic device is a trusted device. When it is determined that the second electronic device is a trusted device, the first electronic device can determine that the second electronic device has passed the verification. When it is determined that the second electronic device is not a trusted device, the first electronic device can determine that the second electronic device has failed the verification. A trusted device may refer to a device that has undergone identity authentication, authorization, and trust evaluation and is considered to be safe, reliable, and trustworthy. Among them, the unique identity of the trusted device can be accurately identified and tracked.

[0178] In some embodiments, when the second electronic device and the first electronic device are devices of the same producer (or manufacturer), for example, when both are Huawei devices, the second electronic device can be determined to be a trusted device. That is, the first electronic device can determine whether the second electronic device and the first electronic device are devices of the same producer (or manufacturer) based on the second target information. When it is determined that the second electronic device and the first electronic device are devices of the same producer (or manufacturer), the first electronic device can determine that the second electronic device is a trusted device, that is, it can be determined that the second electronic device has passed the verification. When it is determined that the second electronic device and the first electronic device do not belong to devices of the same producer (or manufacturer), the first electronic device can determine that the second electronic device is not a trusted device, that is, it can be determined that the second electronic device has failed the verification.

[0179] In one embodiment, when the second target information includes a certificate corresponding to the second electronic device (such as a device certificate, a device account certificate, a compilation signature certificate of the device operating system, or a software signature certificate of a business, etc.), the first electronic device can verify the certificate corresponding to the second electronic device to determine whether the second electronic device and the first electronic device belong to the same producer (or manufacturer). Among them, the certificate corresponding to the second electronic device can be a certificate issued by an intermediate certificate, and the intermediate certificate can be a certificate issued by a root certificate. Devices belonging to the same producer (or manufacturer) generally can have the same root certificate, and the root certificate can be pre-stored in each device. Therefore, the first electronic device can verify the certificate corresponding to the second electronic device based on the root certificate in the first electronic device to determine whether the second electronic device and the first electronic device belong to the same producer (or manufacturer).

[0180] Exemplarily, after obtaining the certificate corresponding to the second electronic device, the first electronic device can determine the intermediate certificate based on the certificate corresponding to the second electronic device, and can determine the root certificate corresponding to the second electronic device (for ease of understanding, hereinafter referred to as root certificate R2) based on the intermediate certificate. After determining the root certificate R2 corresponding to the second electronic device, the first electronic device can determine whether the root certificate R2 is the same as the root certificate corresponding to the first electronic device (for ease of understanding, hereinafter referred to as root certificate R1). When it is determined that the root certificate R2 is the same as the root certificate R1, the first electronic device can determine that the second electronic device and the first electronic device belong to the same producer (or manufacturer), that is, it can be determined that the second electronic device has passed the verification. When it is determined that the root certificate R2 is not the same as the root certificate R1, the first electronic device can determine that the second electronic device and the first electronic device do not belong to the same producer (or manufacturer), that is, it can be determined that the second electronic device has failed the verification.

[0181] It should be noted that a certificate generally includes plaintext information such as the certificate public key, relevant identification information, issuer information, and validity period, and may also include a signature. The signature can be a digital signature generated by the issuer of the certificate using the issuer's certificate private key. For example, the issuer can calculate the information digest of the plaintext information in the certificate, and then use the issuer's certificate private key to encrypt the information digest to obtain ciphertext, which can be the signature. It should be understood that the first electronic device can determine the intermediate certificate based on the issuer information in the certificate corresponding to the second electronic device, and can determine the root certificate based on the issuer information in the intermediate certificate.

[0182] Exemplarily, after obtaining the certificate corresponding to the second electronic device, the first electronic device can determine the intermediate certificate based on the certificate corresponding to the second electronic device, and can verify the signature in the certificate corresponding to the second electronic device (for ease of understanding, it can be referred to as the device signature hereinafter) through the certificate public key of the intermediate certificate. In addition, the first electronic device can also obtain the certificate public key of the root certificate R1 (i.e., the root certificate in the first electronic device), and can verify the signature in the intermediate certificate (for ease of understanding, it can be referred to as the intermediate signature) through the certificate public key of the root certificate R1. When it is determined that the device signature verification is passed and the intermediate signature verification is passed, the first electronic device can determine that the second electronic device and the first electronic device belong to the same producer (or manufacturer) of the device, that is, it can be determined that the second electronic device has passed the verification. When it is determined that the device signature verification fails, or the intermediate signature verification fails, the first electronic device can determine that the second electronic device and the first electronic device do not belong to the same producer (or manufacturer) of the device, that is, it can be determined that the second electronic device has failed the verification.

[0183] Among them, the process of verifying the device signature can be as follows: after obtaining the certificate corresponding to the second electronic device, the first electronic device can obtain the plaintext information in the certificate corresponding to the second electronic device, and can calculate the information digest of the plaintext information. The calculation method used by the first electronic device to calculate the information digest of the plaintext information is the same as the calculation method used to generate the signature in the certificate corresponding to the second electronic device. In addition, the first electronic device can use the certificate public key in the intermediate certificate to decrypt the signature in the certificate corresponding to the second electronic device, obtain the decrypted information digest, and compare the calculated information digest with the decrypted information digest. When the calculated information digest is consistent with the decrypted information digest, the first electronic device can determine that the device signature verification is successful. When the calculated information digest is inconsistent with the decrypted information digest, the first electronic device can determine that the device signature verification is unsuccessful.

[0184] It should be understood that the specific content of verifying the intermediate signature can refer to the relevant content of verifying the device signature. For the sake of brevity, it will not be repeated here.

[0185] In another embodiment, when the second target information includes an identity identifier or account number corresponding to the second electronic device (e.g., a device ID or device account number, etc.), the first electronic device can determine through the cloud whether the second electronic device and the first electronic device are devices of the same producer (or manufacturer). Devices of the same producer (or manufacturer) can generally register with the same cloud (e.g., a cloud provided by the producer (or manufacturer)), and the registration information may include the device ID and / or device account number, as well as the device type, etc. Therefore, after the first electronic device obtains the second target information of the second electronic device (i.e., the device ID or device account number corresponding to the second electronic device), it can send the device ID or device account number corresponding to the second electronic device to the cloud so that the cloud can match the device ID or device account number corresponding to the second electronic device. When the cloud matches the device ID or device account number corresponding to the second electronic device, the first electronic device can determine that the second electronic device and the first electronic device are devices of the same producer (or manufacturer), that is, it can determine that the second electronic device has passed the verification. When the cloud does not match the device ID or device account number corresponding to the second electronic device, the first electronic device can determine that the second electronic device and the first electronic device are not devices of the same producer (or manufacturer), that is, it can determine that the second electronic device has failed the verification.

[0186] It should be noted that the above-mentioned determination by the first electronic device of whether the second electronic device and the first electronic device belong to the same producer (or manufacturer) based on the certificate, device ID or device account is only an exemplary explanation and should not be understood as a limitation on the embodiments of the present application. In the embodiments of the present application, the first electronic device may also determine whether the second electronic device and the first electronic device belong to the same producer (or manufacturer) based on other methods.

[0187] S406: After determining that the second electronic device has passed verification, the first electronic device sends the first target information to the second electronic device through the third channel of the second near-field medium.

[0188] Exemplarily, the first target information of the first electronic device may include device information and / or service information of the first electronic device. For example, the first target information of the first electronic device may include one or more of the following: a device certificate corresponding to the first electronic device, a device account certificate, a compilation signature certificate of the device operating system, a device ID, a device account, or a software signature certificate of a service.

[0189] In one embodiment, the first target information of the first electronic device may include a software signature certificate and a device account number for a service requiring data transmission.

[0190] In some embodiments, after the first electronic device obtains the second target information sent by the second electronic device, it can verify the second electronic device based on the second target information to determine whether the second electronic device is a trusted device. After determining that the second electronic device has passed the verification based on the second target information, that is, after determining that the second electronic device is a trusted device, the first electronic device can send the first target information of the first electronic device to the second electronic device through the third channel of the second near-field medium, so that the second electronic device can verify the first electronic device based on the first target information to determine whether to transmit data with the first electronic device.

[0191] In other embodiments, after the first electronic device obtains the second target information sent by the second electronic device, it can verify the second electronic device based on the second target information to determine whether the second electronic device is a trusted device. After determining that the second electronic device has passed the verification based on the second target information, that is, after determining that the second electronic device is a trusted device, the first electronic device can encrypt the first target information of the first electronic device based on the second target information to obtain first encrypted information, and can send the first encrypted information to the second electronic device via the third channel of the second near-field medium. That is, after the first electronic device determines that the second electronic device has passed the verification, the first electronic device can encrypt the first target information of the first electronic device based on the second target information sent by the second electronic device, and can transmit the first encrypted information via the third channel of the second near-field medium, which can reduce the possibility of the first target information of the first electronic device being leaked and improve the security of data transmission. After the second electronic device obtains the first encrypted information sent by the first electronic device, it can decrypt the first encrypted information based on the second target information to obtain the first target information of the first electronic device, and can verify the first electronic device based on the first target information of the first electronic device to determine whether to transmit data with the first electronic device.

[0192] In one embodiment, when the second target information includes a certificate corresponding to the second electronic device (such as a device certificate, a device account certificate, a compilation signature certificate of the device operating system, or a software signature certificate for a business, etc.), the second target information may include a certificate public key. The first encrypted information can be obtained by encrypting the certificate public key included in the second target information. That is, after determining that the second electronic device has passed the verification based on the second target information, the first electronic device can encrypt the first target information of the first electronic device based on the certificate public key included in the second target information to obtain the first encrypted information. After the second electronic device obtains the first encrypted information, it can decrypt the first encrypted information based on the certificate public key included in the second target information to obtain the first target information of the first electronic device.

[0193] In another embodiment, when the second target information includes an identity or account number corresponding to the second electronic device (such as the device ID or device account number, etc.), the identity or account number may be associated with a corresponding encryption method. The first encrypted information may be encrypted based on the encryption method associated with the identity or account number included in the second target information. That is, after determining that the second electronic device has passed the verification based on the second target information, the first electronic device may determine the encryption method associated with the identity or account number included in the second target information, and may encrypt the first target information of the first electronic device according to the determined encryption method to obtain the first encrypted information. After the second electronic device obtains the first encrypted information, it may determine the corresponding decryption method according to the encryption method associated with the identity or account number included in the second target information, and may decrypt the first encrypted information according to the determined decryption method to obtain the first target information of the first electronic device, and may verify the first electronic device according to the first target information of the first electronic device to determine whether the first electronic device is a trusted device, thereby determining whether to transmit data with the first electronic device.

[0194] It should be understood that the encryption method associated with the identity identifier or account of the first electronic device (for ease of understanding, it can be referred to as encryption method A) and the decryption method corresponding to encryption method A (for ease of understanding, it can be referred to as decryption method A) can be agreed upon in advance by the first electronic device and the second electronic device. Similarly, the encryption method associated with the identity identifier or account of the second electronic device described later (for ease of understanding, it can be referred to as encryption method B) and the decryption method corresponding to encryption method B (for ease of understanding, it can be referred to as decryption method B) can also be agreed upon in advance by the first electronic device and the second electronic device. It is understood that the above encryption method and decryption method can also be pre-set by the producers (or manufacturers) of the first electronic device and the second electronic device and preset at the factory.

[0195] In some embodiments, to increase verification speed and improve data transmission efficiency, the third channel can be a Wi-Fi unicast channel. That is, after the first electronic device determines that the second electronic device has passed verification based on the second target information of the second electronic device, it can send the first target information of the first electronic device (or the first encrypted information corresponding to the first target information) to the second electronic device via Wi-Fi unicast. By directly sending the first target information (or the first encrypted information) to the second electronic device in a Wi-Fi point-to-point manner, the transmission speed of the first target information (or the first encrypted information) can be increased, so that the second electronic device can quickly verify the first electronic device based on the first target information, thereby increasing the verification speed.

[0196] In one possible implementation, in order to enable the first electronic device to quickly send the first target information (or first encrypted information) of the first electronic device to the second electronic device via Wi-Fi unicast, the second electronic device may also send the MAC address corresponding to the second electronic device (e.g., MAC address A2) to the first electronic device via the second channel of the second near-field medium when sending the second target information to the first electronic device via the second channel of the second near-field medium. That is, the second electronic device may send the second target information and the MAC address A2 corresponding to the second electronic device to the first electronic device via the second channel of the second near-field medium. After the first electronic device obtains the second target information and MAC address A2 sent by the second electronic device, when it determines that the second electronic device has passed verification based on the second target information, it may send the first target information (or first encrypted information) point-to-point to the second electronic device via the Wi-Fi unicast channel (e.g., the unicast channel corresponding to MAC address A2) based on the MAC address A2, thereby increasing the transmission speed of the first target information (or first encrypted information), thereby increasing the speed at which the second electronic device verifies the first electronic device.

[0197] It should be noted that the second electronic device can simultaneously send the second target information and the MAC address A2 corresponding to the second electronic device through the second channel of the second near-field medium. Alternatively, the second electronic device can separately send the second target information and the MAC address A2 corresponding to the second electronic device through the second channel of the second near-field medium. For example, the second electronic device can first send the second target information through the second channel of the second near-field medium. Then, the MAC address A2 corresponding to the second electronic device can be sent through the second channel of the second near-field medium.

[0198] For example, the MAC address A2 corresponding to the second electronic device may be the real hardware MAC address of the second electronic device. That is, the first electronic device may send the first target information (or first encrypted information) of the first electronic device to the second electronic device in a point-to-point manner based on the real hardware MAC address of the second electronic device.

[0199] For example, in order to reduce the possibility of MAC address A2 being counterfeited and improve the security of data transmission, the MAC address A2 corresponding to the second electronic device can be a random MAC address temporarily generated by the second electronic device, which can reduce the possibility of the second electronic device being tracked and improve the security of data transmission.

[0200] For example, after obtaining a data transmission request sent by the first electronic device, the second electronic device can temporarily generate a MAC address A2 corresponding to the second electronic device (i.e., a random MAC address corresponding to the second electronic device), and can send the MAC address A2 corresponding to the second electronic device to the first electronic device via Wi-Fi unicast, so that when the first electronic device determines to send the first target information (or first encrypted information) to the second electronic device, it can send the first target information (or first encrypted information) to the second electronic device point-to-point based on the MAC address A2 corresponding to the second electronic device.

[0201] In other embodiments, in order to increase the verification speed and improve the efficiency of data transmission, the second channel can be a Star Flash unicast channel. That is, after the first electronic device determines that the second electronic device has passed the verification based on the second target information of the second electronic device, it can send the first target information (or first encrypted information) of the first electronic device to the second electronic device through Star Flash unicast, so as to directly send the first target information (or first encrypted information) to the second electronic device in a point-to-point manner through Star Flash, which can increase the transmission speed of the first target information (or first encrypted information), so that the second electronic device can quickly verify the first electronic device based on the first target information, thereby improving the verification speed.

[0202] In one possible implementation, in order to enable the first electronic device to quickly send the first target information (or first encrypted information) of the first electronic device to the second electronic device through Star Flash unicast, the second electronic device can also send the Star Flash address corresponding to the second electronic device (for example, Star Flash address B2) to the first electronic device through the second channel of the second near-field medium when sending the second target information to the first electronic device through the second channel of the second near-field medium. That is, the second electronic device can send the second target information and the Star Flash address B2 corresponding to the second electronic device to the first electronic device through the second channel of the second near-field medium. After the first electronic device obtains the second target information and Star Flash address B2 sent by the second electronic device, it can send the first target information (or first encrypted information) to the second electronic device point-to-point through the Star Flash unicast channel (for example, the unicast channel corresponding to Star Flash address B2) according to the Star Flash address B2 when it determines that the second electronic device has passed the verification based on the second target information, thereby improving the transmission speed of the first target information (or first encrypted information).

[0203] It should be noted that the second electronic device can simultaneously send the second target information and the star flash address B2 corresponding to the second electronic device through the second channel of the second near-field medium. Alternatively, the second electronic device can separately send the second target information and the star flash address B2 corresponding to the second electronic device through the second channel of the second near-field medium. For example, the second electronic device can first send the second target information through the second channel of the second near-field medium. Then, the star flash address B2 corresponding to the second electronic device can be sent through the second channel of the second near-field medium.

[0204] For example, in order to reduce the possibility of the Star Flash address B2 being counterfeited and improve the security of data transmission, the Star Flash address B2 corresponding to the second electronic device can be a random Star Flash address temporarily generated by the second electronic device, which can reduce the possibility of the second electronic device being tracked and improve the security of data transmission.

[0205] For example, after obtaining the data transmission request sent by the first electronic device, the second electronic device can temporarily generate the Star Flash address B2 corresponding to the second electronic device (that is, the random Star Flash address corresponding to the second electronic device), and can send the Star Flash address B2 corresponding to the second electronic device to the first electronic device through Star Flash unicast, so that when the first electronic device determines to send the first target information (or first encrypted information) to the second electronic device, it can send the first target information (or first encrypted information) to the second electronic device point-to-point based on the Star Flash address B2 corresponding to the second electronic device.

[0206] In some embodiments, data transmission based on the bump operation is generally performed between electronic devices at close range. In order to ensure the security of data transmission, after the first electronic device obtains the second target information sent by the second electronic device, it can determine the distance between the first electronic device and the second electronic device (for example, it can be called distance B), and can determine whether to send the first target information of the first electronic device to the second electronic device based on the distance B. When it is determined that the distance B is less than or equal to a preset distance threshold (for example, the preset distance threshold B), and when it is determined that the second electronic device has passed the verification based on the second target information, the first electronic device can send the first target information of the first electronic device to the second electronic device. When it is determined that the distance B is greater than the preset distance threshold B, or when it is determined that the second electronic device has failed the verification based on the second target information, the first electronic device may not respond to the second target information sent by the second electronic device, that is, the first electronic device may not send the first target information of the first electronic device to the second electronic device.

[0207] Alternatively, the first electronic device may determine, based on the distance B, whether to verify the second electronic device based on the second target information. That is, the first electronic device may determine, based on the distance B, whether the second electronic device is an electronic device that may collide with the first electronic device. When it is determined that the distance B is less than or equal to the preset distance threshold B, the first electronic device may determine that the second electronic device may be an electronic device that collides with the first electronic device. At this time, the first electronic device may verify the second electronic device based on the second target information, so as to send the first target information of the first electronic device to the second electronic device when the second electronic device passes the verification. When it is determined that the distance B is greater than the preset distance threshold B, the first electronic device may determine that the second electronic device is unlikely to be an electronic device that collides with the first electronic device. At this time, the first electronic device may directly not verify the second electronic device based on the second target information, so as to reduce the verification work of the first electronic device and improve the performance of the first electronic device.

[0208] For example, a distance measuring device (such as a distance sensor) may be provided in the first electronic device. After the first electronic device obtains the second target information sent by the second electronic device, the first electronic device may measure the distance B between the first electronic device and the second electronic device through the distance sensor in the first electronic device, and may determine whether to send the first target information of the first electronic device to the second electronic device based on whether the distance B is less than or equal to a preset distance threshold B.

[0209] It should be noted that the preset distance threshold B can be determined based on the actual scenario, and the embodiments of the present application are not limited thereto. For example, the preset distance threshold B can be determined to be 10 cm based on the actual scenario. For example, the preset distance threshold B can be determined to be 15 cm based on the actual scenario, and so on.

[0210] S407: The second electronic device obtains the first target information through the third channel of the second near-field medium, and verifies the first electronic device according to the first target information.

[0211] It should be understood that after the first electronic device sends the first target information to the second electronic device through the third channel of the second near-field medium, the second electronic device can obtain the first target information of the first electronic device. After obtaining the first target information, the second electronic device can verify the first electronic device based on the first target information to determine whether the first electronic device is a trusted device. When it is determined that the first electronic device is a trusted device, the second electronic device can determine that the first electronic device has passed the verification. When it is determined that the first electronic device is not a trusted device, the second electronic device can determine that the first electronic device has failed the verification. Among them, the specific content of the second electronic device determining whether the first electronic device has passed the verification based on the first target information can refer to the relevant content of the aforementioned first electronic device determining whether the second electronic device has passed the verification based on the second target information.

[0212] S408: After the second electronic device determines that the first electronic device has passed the verification, the first electronic device establishes a connection channel with the second electronic device.

[0213] It should be understood that after the second electronic device determines that the first electronic device has passed verification, a connection channel may be established between the first electronic device and the second electronic device, so that data can be transmitted between the first and second electronic devices based on the established connection channel. For example, a first service in the first electronic device may send data to a second service in the second electronic device based on the established connection channel. For example, a second service in the second electronic device may send data to the first service in the first electronic device based on the established connection channel.

[0214] In some embodiments, when the first electronic device needs to obtain data from the second electronic device, that is, when the second electronic device needs to send data to the first electronic device, the second electronic device determines that the first electronic device has passed the verification based on the first target information, that is, after determining that data can be transmitted with the first electronic device, it can initiate a connection establishment request to the first electronic device to establish a connection channel between the second electronic device and the first electronic device, so as to send data to the first electronic device based on the established connection channel.

[0215] In other embodiments, when a first electronic device needs to send data to a second electronic device, after the second electronic device determines that the first electronic device has passed verification based on the first target information, that is, after determining that data can be transmitted with the first electronic device, the second electronic device can send response information to the first electronic device (for example, Figure 5The response information may be used to indicate that the second electronic device has successfully verified the first electronic device, that is, the response information may be used to inform the first electronic device that it can transmit data to the second electronic device. After the first electronic device receives the response information sent by the second electronic device, it may send a connection establishment request to the second electronic device to establish a connection channel between the first electronic device and the second electronic device, and send data to the second electronic device based on the established connection channel.

[0216] It should be understood that the specific content of the response information can be determined according to the actual scenario, and the embodiments of the present application do not limit this. For example, the response information may include information indicating that the first electronic device can send data to the second electronic device, or may include information indicating that the second electronic device has passed the verification of the first electronic device, or may include information indicating that the first electronic device is a trusted device, etc.

[0217] It should be noted that the connection channel established between the first electronic device and the second electronic device can be determined according to the actual scenario, and the embodiments of the present application are not limited to this. For example, the connection channel established between the first electronic device and the second electronic device is a Wi-Fi channel, or it can be a StarFlash channel. That is, the first electronic device and the second electronic device can perform data transmission via a Wi-Fi connection, or they can perform data transmission via a StarFlash connection.

[0218] In one embodiment, to ensure the security of data transmission, when sending response information to the first electronic device, the second electronic device may encrypt the response information based on the first target information of the first electronic device to obtain encrypted information (e.g., second encrypted information), and may send the second encrypted information to the first electronic device. After the first electronic device obtains the second encrypted information, it may decrypt the second encrypted information based on the first target information of the first electronic device to obtain response information, and may establish a connection channel with the second electronic device based on the response information.

[0219] Exemplarily, when the first target information of the first electronic device includes a certificate corresponding to the first electronic device (such as a device certificate, a device account certificate, a compilation signature certificate of the device operating system, or a software signature certificate of the business, etc.), the first target information of the first electronic device may include a certificate public key. The second encrypted information can be obtained by encrypting the certificate public key included in the first target information of the first electronic device. That is, when sending a response message to the first electronic device, the second electronic device can encrypt the response message according to the certificate public key included in the first target information of the first electronic device to obtain the second encrypted information, and can send the second encrypted information to the first electronic device. After the first electronic device obtains the second encrypted information, it can decrypt the second encrypted information according to the certificate public key included in the first target information of the first electronic device to obtain the response information, so that it can establish a connection channel with the second electronic device based on the response information to carry out data transmission.

[0220] Exemplarily, when the first target information of the first electronic device includes an identity or account number corresponding to the first electronic device (such as the device ID or device account number, etc.), the identity or account number may be associated with a corresponding encryption method. The second encrypted information may be encrypted based on the encryption method associated with the identity or account number included in the first target information of the first electronic device. That is, when sending a response message to the first electronic device, the second electronic device may determine the encryption method associated with the identity or account number included in the first target information of the first electronic device, encrypt the response message according to the determined encryption method, obtain the second encrypted information, and send the second encrypted information to the first electronic device. After the first electronic device obtains the second encrypted information, it may determine the corresponding decryption method according to the encryption method associated with the identity or account number included in the first target information of the first electronic device, and may decrypt the second encrypted information according to the determined decryption method to obtain the response information, so that a connection channel may be established with the second electronic device based on the response information for data transmission.

[0221] In some embodiments, the second electronic device can send response information (or second encrypted information corresponding to the response information) to the first electronic device through the fourth channel of the second near-field medium, so that the first electronic device can establish a connection channel between the first electronic device and the second electronic device based on the response information, and thereby perform data transmission between the first electronic device and the second electronic device based on the established connection channel.

[0222] In one embodiment, to increase verification speed and improve data transmission efficiency, the fourth channel can be a Wi-Fi unicast channel. That is, after the second electronic device determines that the first electronic device has passed verification based on the first target information, it can send a response message (or second encrypted information) to the first electronic device via Wi-Fi unicast. By directly sending the response message (or second encrypted information) to the first electronic device in a Wi-Fi point-to-point manner, the transmission speed of the response message (or second encrypted information) can be increased, so that the first electronic device can quickly establish a connection channel between the first electronic device and the second electronic device based on the response message to perform data transmission, thereby improving data transmission efficiency.

[0223] In one possible implementation, in order to enable the second electronic device to quickly send response information (or second encrypted information) to the first electronic device via Wi-Fi unicast, the first electronic device may also send the MAC address corresponding to the first electronic device (e.g., MAC address A3) to the second electronic device via the third channel of the second near-field medium when sending the first target information (or the first encrypted information corresponding to the first target information) to the second electronic device via the third channel of the second near-field medium. That is, the first electronic device may send the first target information (or the first encrypted information) and the MAC address A3 corresponding to the first electronic device to the second electronic device via the third channel of the second near-field medium. After the second electronic device obtains the first target information (or the first encrypted information) and MAC address A3 sent by the first electronic device, it may, upon determining that the first electronic device has passed verification based on the first target information, send the response information (or the second encrypted information) to the first electronic device point-to-point based on the MAC address A3 via the Wi-Fi unicast channel (e.g., the unicast channel corresponding to the MAC address A3), thereby improving the transmission speed of the response information (or the second encrypted information).

[0224] It should be noted that the first electronic device can simultaneously send the first target information (or first encrypted information) and the MAC address A3 corresponding to the first electronic device through the third channel of the second near-field medium. Alternatively, the first electronic device can separately send the first target information (or first encrypted information) and the MAC address A3 corresponding to the first electronic device through the third channel of the second near-field medium. For example, the first electronic device can first send the first target information (or first encrypted information) through the third channel of the second near-field medium. Then, the MAC address A3 corresponding to the first electronic device can be sent through the third channel of the second near-field medium.

[0225] In another possible implementation, to enable the second electronic device to quickly send a response message (or second encrypted message) to the first electronic device via Wi-Fi unicast, the first electronic device may encrypt the MAC address corresponding to the first electronic device (e.g., MAC address A3) and the first target information to obtain the first encrypted message, and then send the first encrypted message to the second electronic device via a third channel of the second near-field medium. That is, the first encrypted message sent by the first electronic device to the second electronic device via the third channel of the second near-field medium may include the first target information and the MAC address A3 corresponding to the first electronic device. After obtaining the first encrypted message sent by the first electronic device, the second electronic device may determine the first target information and the MAC address A3 corresponding to the first electronic device based on the first encrypted message. When the second electronic device determines that the first electronic device has passed verification based on the first target information, it may send the response message (or second encrypted message) to the first electronic device point-to-point via a Wi-Fi unicast channel (e.g., the unicast channel corresponding to MAC address A3) based on MAC address A3, thereby improving the transmission speed of the response message (or second encrypted message).

[0226] For example, the MAC address A3 corresponding to the first electronic device may be the real hardware MAC address of the first electronic device. That is, the second electronic device may send a response message (or second encrypted message) to the first electronic device point-to-point based on the real hardware MAC address of the first electronic device.

[0227] For example, in order to reduce the possibility of MAC address A3 being counterfeited and improve the security of data transmission, the MAC address A3 corresponding to the first electronic device can be a random MAC address temporarily generated by the first electronic device to reduce the possibility of the first electronic device being tracked and improve the security of data transmission.

[0228] For example, after obtaining the second target information sent by the second electronic device, the first electronic device can temporarily generate a MAC address A3 corresponding to the first electronic device (i.e., a random MAC address corresponding to the first electronic device), and can send the MAC address A3 corresponding to the first electronic device to the second electronic device via Wi-Fi unicast, so that when the second electronic device determines to send a response information (or second encrypted information) to the first electronic device, it can send the response information (or second encrypted information) to the first electronic device point-to-point based on the MAC address A3 corresponding to the first electronic device.

[0229] In other embodiments, in order to increase the verification speed and improve the efficiency of data transmission, the fourth channel can be a Star Flash unicast channel. That is, after the second electronic device determines that the first electronic device has passed the verification based on the first target information, it can send a response message (or the second encrypted information) to the first electronic device through Star Flash unicast, so as to directly send the response message (or the second encrypted information) to the first electronic device in a Star Flash point-to-point manner. This can increase the transmission speed of the response message (or the second encrypted information), so that the first electronic device can quickly establish a connection channel between the first electronic device and the second electronic device based on the response message to perform data transmission, thereby improving the efficiency of data transmission.

[0230] In one possible implementation, in order to enable the second electronic device to quickly send response information (or second encrypted information) to the first electronic device through Star Flash unicast, the first electronic device may send the Star Flash address corresponding to the first electronic device (for example, Star Flash address B3) to the second electronic device through the third channel of the second near-field medium when sending the first target information (or first encrypted information) to the second electronic device through the third channel of the second near-field medium. That is, the first electronic device may send the first target information (or first encrypted information) and the Star Flash address B3 corresponding to the first electronic device to the second electronic device through the third channel of the second near-field medium. After the second electronic device obtains the first target information (or first encrypted information) and Star Flash address B3 sent by the first electronic device, it may send the response information (or second encrypted information) to the first electronic device point-to-point through the Star Flash unicast channel (for example, the unicast channel corresponding to Star Flash address B3) according to Star Flash address B3 when determining that the first electronic device has passed verification based on the first target information, thereby improving the transmission speed of the response information (or second encrypted information).

[0231] It should be noted that the first electronic device can simultaneously send the first target information (or the first encrypted information) and the Star Flash address B3 corresponding to the first electronic device through the third channel of the second near-field medium. Alternatively, the first electronic device can separately send the first target information (or the first encrypted information) and the Star Flash address B3 corresponding to the first electronic device through the third channel of the second near-field medium. For example, the first electronic device can first send the first target information (or the first encrypted information) through the third channel of the second near-field medium. Then, the Star Flash address B3 corresponding to the first electronic device can be sent through the third channel of the second near-field medium.

[0232] In another possible implementation, in order to enable the second electronic device to quickly send response information (or second encrypted information) to the first electronic device through Star Flash unicast, the first electronic device can encrypt the Star Flash address (for example, Star Flash address B3) and the first target information corresponding to the first electronic device to obtain the first encrypted information, and can send the first encrypted information to the second electronic device through the third channel of the second near-field medium. That is, the first encrypted information sent by the first electronic device to the second electronic device through the third channel of the second near-field medium may include the first target information and the Star Flash address B3 corresponding to the first electronic device. After the second electronic device obtains the first encrypted information sent by the first electronic device, it can determine the first target information and the Star Flash address B3 corresponding to the first electronic device based on the first encrypted information, and when it is determined that the first electronic device has passed the verification based on the first target information, it can send the response information (or second encrypted information) to the first electronic device point-to-point through the Star Flash unicast channel (for example, the unicast channel corresponding to the Star Flash address B3) based on the Star Flash address B3, thereby improving the transmission speed of the response information (or the second encrypted information).

[0233] For example, in order to reduce the possibility of the Star Flash address B3 being counterfeited and improve the security of data transmission, the Star Flash address B3 corresponding to the first electronic device can be a random Star Flash address temporarily generated by the first electronic device to reduce the possibility of the first electronic device being tracked and improve the security of data transmission.

[0234] For example, after obtaining the second target information sent by the second electronic device, the first electronic device can temporarily generate the Starflash address B3 corresponding to the first electronic device (that is, the random Starflash address corresponding to the first electronic device), and can send the Starflash address B3 corresponding to the first electronic device to the second electronic device through Starflash unicast, so that when the second electronic device determines to send a response message (or second encrypted information) to the first electronic device, it can send the response message (or second encrypted information) to the first electronic device point-to-point based on the Starflash address B3 corresponding to the first electronic device.

[0235] It should be noted that the second channel, the third channel, and the fourth channel may be the same or different, and the specific method may be determined based on the actual scenario, and the embodiments of the present application are not limited to this. For example, to improve the security of data transmission, at least one of the second channel, the third channel, and the fourth channel may be different from the other channels. For example, the second channel and the third channel may be the same, and the fourth channel may be different from the second channel. For example, the second channel and the third channel may be different, and the third channel and the fourth channel may be the same. For example, the second channel and the third channel may be different, and the third channel and the fourth channel may be different, and so on.

[0236] The data transmission method provided in the embodiment of the present application will be exemplarily described below by taking the example of a first electronic device sending data to a second electronic device.

[0237] See also Figure 5 , Figure 5 The data transmission method provided in this embodiment is shown in FIG. Figure 2 .

[0238] like Figure 5 As shown, the method may include:

[0239] S501: A first electronic device detects a tap operation.

[0240] It should be understood that when a first electronic device needs to transmit data to a second electronic device, the user can tap the first electronic device against the second electronic device. After the user taps the first electronic device against the second electronic device, the first electronic device can detect the tapping operation. The details of the first electronic device detecting the tapping operation can be found in S401, the first electronic device detecting a preset operation, and are not further described here.

[0241] S502: The first electronic device sends a data transmission request through a first channel of a first near-field medium.

[0242] After the first electronic device detects the tap-to-touch operation, the first electronic device may determine that data transmission is required. At this time, the first electronic device may send a data transmission request via the first channel of the first near-field medium. The data transmission request may be used to request data transmission to the second electronic device. The specific content of the data transmission request sent by the first electronic device via the first channel of the first near-field medium can refer to the aforementioned S402, wherein the first electronic device sends the data transmission request via the first channel of the first near-field medium in response to a preset operation.

[0243] S503: The second electronic device obtains the data transmission request sent by the first electronic device.

[0244] The second electronic device may obtain the data transmission request sent by the first electronic device through the first channel of the first near-field medium. The specific content of the data transmission request sent by the first electronic device obtained by the second electronic device may refer to the aforementioned S403, wherein the second electronic device obtains the relevant content of the data transmission request sent by the first electronic device through the first channel of the first near-field medium.

[0245] S504: The second electronic device determines whether the distance A between the second electronic device and the first electronic device is less than or equal to a preset distance threshold A.

[0246] It should be understood that after receiving the data transmission request sent by the first electronic device, the second electronic device can obtain the distance A between the second electronic device and the first electronic device, and can determine whether the distance A is less than or equal to the preset distance threshold A to determine whether to respond to the data transmission request sent by the first electronic device. The specific details of the second electronic device obtaining the distance A and determining whether the distance A is less than or equal to the preset distance threshold A can be referred to the aforementioned relevant content regarding the distance A, and will not be repeated here.

[0247] S505: After determining that the distance A is less than or equal to the preset distance threshold A, the second electronic device sends second target information to the first electronic device through the second channel of the second near-field medium.

[0248] Among them, when it is determined that the distance A is less than or equal to the preset distance threshold A, the second electronic device can determine to respond to the data transmission request sent by the first electronic device. At this time, the second electronic device can send the second target information of the second electronic device to the first electronic device through the second channel of the second near-field medium. For example, the device information and / or service information of the second electronic device can be sent to the first electronic device through the second channel of the second near-field medium. Among them, the specific content of the second target information of the second electronic device sent by the second electronic device to the first electronic device through the second channel of the second near-field medium can refer to the aforementioned S404, the second electronic device sends the relevant content of the second target information to the first electronic device through the second channel of the second near-field medium based on the data transmission request.

[0249] S506: After acquiring the second target information of the second electronic device, the first electronic device determines whether the distance B between the first electronic device and the second electronic device is less than or equal to a preset distance threshold B.

[0250] The first electronic device can obtain the second target information sent by the second electronic device through the second channel of the second near-field medium. After obtaining the second target information sent by the second electronic device, the first electronic device can obtain the distance B between the first electronic device and the second electronic device, and can determine whether the distance B is less than or equal to the preset distance threshold B to determine whether to send the first target information of the first electronic device to the second electronic device. The specific content of the first electronic device obtaining the distance B and determining whether the distance B is less than or equal to the preset distance threshold B can refer to the relevant content related to the distance B mentioned above.

[0251] S507: After determining that the distance B is less than or equal to the preset distance threshold B, the first electronic device verifies the second electronic device according to the second target information.

[0252] When it is determined that the distance B is less than or equal to the preset distance threshold B, the first electronic device may verify the second electronic device based on the second target information to determine whether the second electronic device is a trusted device. The specific content of the first electronic device verifying the second electronic device based on the second target information can refer to the aforementioned S405, where the first electronic device obtains the second target information through the second channel of the second near-field medium and verifies the second electronic device based on the second target information.

[0253] S508: After determining that the second electronic device has passed verification, the first electronic device encrypts the first target information of the first electronic device according to the second target information to obtain first encrypted information.

[0254] After determining that the second electronic device has passed verification based on the second target information, that is, after determining that the second electronic device is a trusted device, the first electronic device can encrypt the first target information of the first electronic device (e.g., device information and / or service information of the first electronic device) based on the second target information to obtain first encrypted information. The specific content of the encryption of the first target information by the first electronic device based on the second target information can refer to the relevant content of the encryption of the first target information by the first electronic device described above to obtain the first encrypted information.

[0255] S509: The first electronic device sends the first encrypted information to the second electronic device through the third channel of the second near-field medium.

[0256] After the first electronic device encrypts the first target information based on the second target information to obtain the first encrypted information corresponding to the first target information, the first electronic device may transmit the first encrypted information corresponding to the first target information to the second electronic device via the third channel of the second near-field medium. The specific content of the first encrypted information transmitted by the first electronic device to the second electronic device via the third channel of the second near-field medium can be referred to in S406 above, where the first electronic device transmits the relevant content of the first target information to the second electronic device via the third channel of the second near-field medium after determining that the second electronic device has passed verification.

[0257] S510: After obtaining the first encrypted information sent by the first electronic device through the third channel of the second near-field medium, the second electronic device decrypts the first encrypted information according to the second target information to obtain the first target information.

[0258] The second electronic device can obtain the first encrypted information sent by the first electronic device through the third channel of the second near-field medium, and decrypt the first encrypted information based on the second target information to obtain the first target information of the first electronic device. The second electronic device decrypts the first encrypted information based on the second target information to obtain the specific content of the first target information of the first electronic device, which can be referred to as the above-mentioned decryption of the first encrypted information by the second electronic device to obtain the relevant content of the first target information.

[0259] S511: The second electronic device verifies the first electronic device according to the first target information.

[0260] After obtaining the first target information, the second electronic device may verify the first electronic device based on the first target information to determine whether the first electronic device is a trusted device. The specific details of the second electronic device verifying the first electronic device based on the first target information can be found in S407, where the second electronic device obtains the first target information through the third channel of the second near-field medium and verifies the first electronic device based on the first target information.

[0261] S512: After determining that the first electronic device has passed verification, the second electronic device encrypts the response information according to the first target information to obtain second encrypted information.

[0262] After the first electronic device is determined to have passed verification based on the first target information, i.e., after the first electronic device is determined to be a trusted device, the second electronic device may encrypt the response information based on the first target information to obtain second encrypted information. The specific content of the second encrypted information obtained by encrypting the response information based on the first target information by the second electronic device can be referred to in the aforementioned method of encrypting the response information by the second electronic device to obtain the relevant content of the second encrypted information.

[0263] S513: The second electronic device sends second encrypted information to the first electronic device through the fourth channel of the second near-field medium.

[0264] After obtaining the second encrypted information corresponding to the response information, the second electronic device may send the second encrypted information to the first electronic device via the fourth channel of the second near-field medium. The specific content of the second encrypted information sent by the second electronic device to the first electronic device via the fourth channel of the second near-field medium can refer to the aforementioned content related to the second electronic device sending the second encrypted information to the first electronic device.

[0265] S514: After obtaining the second encrypted information through the fourth channel of the second near-field medium, the first electronic device decrypts the second encrypted information according to the first target information to obtain response information.

[0266] The first electronic device can obtain the second encrypted information sent by the second electronic device through the fourth channel of the second near-field medium. After obtaining the second encrypted information, the first electronic device can decrypt the second encrypted information based on the first target information of the first electronic device to obtain response information. The specific content of the first electronic device decrypting the second encrypted information based on the first target information of the first electronic device can refer to the relevant content of the first electronic device decrypting the second encrypted information.

[0267] S515: The first electronic device establishes a connection channel between the first electronic device and the second electronic device based on the response information.

[0268] After receiving the response information, the first electronic device may establish a connection channel (eg, a fifth channel) with the second electronic device according to the response information, and may send data transmission to the second electronic device based on the fifth channel.

[0269] It should be noted that the fifth channel can be a channel for the second near-field medium, such as a Wi-Fi channel or a star flash channel, or can also be a channel for other media. This embodiment of the present application is not limited to this and can be determined according to the actual scenario. The following will be exemplified by taking the fifth channel as the channel for the second near-field medium as an example.

[0270] The data transmission method provided in the embodiment of the present application will be exemplarily described below by taking the first near-field medium as Bluetooth and the second near-field medium as Wi-Fi as an example.

[0271] See also Figure 6 , Figure 6 The data transmission method provided in this embodiment is shown in FIG. Figure 3 .

[0272] like Figure 6 As shown, the first electronic device may include a first feature analysis device, a first distance measurement device, and a first communication device. The second electronic device may include a second feature analysis device, a second distance measurement device, and a second communication device. In addition, the first electronic device may be installed with a first service. The second electronic device may be installed with a second service. Figure 6 An example is given for illustrative description, in which a first service in a first electronic device needs to send data to a second service in a second electronic device.

[0273] like Figure 6 As shown, the method may include:

[0274] S601: A first service sends a data transmission request to a first feature analysis device.

[0275] It should be understood that when the first service in the first electronic device needs to send data to the second electronic device, the user can touch the first electronic device to the second electronic device. After the user touches the first electronic device to the second electronic device, the first electronic device can detect the touch operation. After the first electronic device detects the touch operation, the first service in the first electronic device can initiate a data transmission request ( Figure 6 For ease of understanding, it can be referred to as request A), and a data transmission request can be sent to the first feature analysis device. The specific content of the first electronic device detecting the tap operation can refer to the aforementioned S501, the first electronic device detecting the tap operation, and will not be repeated here.

[0276] S602: The first feature analysis device instructs the first communication device to send a data transmission request through the Bluetooth channel.

[0277] After obtaining the data transmission request, the first feature analysis device in the first electronic device may instruct the first communication device in the first electronic device to send the data transmission request via the Bluetooth channel. For example, the first feature analysis device may instruct the first communication device to broadcast a Bluetooth broadcast carrying the data transmission request, thereby sending the data transmission request via the Bluetooth broadcast.

[0278] S603: The first communication device sends a data transmission request via the Bluetooth channel.

[0279] After obtaining the instruction from the first feature analysis device, the first communication device may send a data transmission request via the Bluetooth channel, for example, by sending the data transmission request via Bluetooth broadcast.

[0280] The Bluetooth broadcast can carry the MAC address A1 corresponding to the first electronic device, so that the second electronic device can return relevant information to the first electronic device based on the MAC address A1. In addition, after broadcasting the data transmission request, the first communication device can open a Wi-Fi channel (such as the channel corresponding to the MAC address A1) to listen to obtain the information returned by the second electronic device.

[0281] S604: After receiving the data transmission request, the second communication device instructs the second distance measuring device to obtain the distance A.

[0282] The second communication device in the second electronic device can obtain the Bluetooth broadcast broadcast by the first communication device, thereby obtaining the data transmission request from the first electronic device. After obtaining the data transmission request from the first electronic device, the second communication device can instruct the second distance measuring device in the second electronic device to obtain the distance A between the second electronic device and the first electronic device, so as to determine whether to respond to the data transmission request from the first electronic device based on the distance A.

[0283] S605: After acquiring the distance A, the second distance measuring device sends the distance A to the second communication device.

[0284] After obtaining the instruction from the second communication device, the second distance measuring device may obtain the distance A and may send the distance A to the second communication device.

[0285] S606: After obtaining the distance A, the second communication device determines whether the distance A is less than or equal to a preset distance threshold A.

[0286] After obtaining the distance A, the second communication device may determine whether the distance A is less than or equal to the preset distance threshold A to determine whether to respond to the data transmission request sent by the first electronic device. The details of the second communication device determining whether the distance A is less than or equal to the preset distance threshold A can be found in S504, where the second electronic device determines whether the distance A between the second electronic device and the first electronic device is less than or equal to the preset distance threshold A.

[0287] S607: After determining that the distance A is less than or equal to the preset distance threshold A, the second communication device sends a data transmission request to the second feature analysis device.

[0288] When it is determined that the distance A is less than or equal to the preset distance threshold A, the second communication device may send a data transmission request to the second feature analysis device. When it is determined that the distance A is greater than the preset distance threshold A, the second communication device may not respond to the data transmission request sent by the first electronic device, that is, may not send a data transmission request to the second feature analysis device.

[0289] S608. The second feature analysis device sends a data transmission request to the second service.

[0290] After obtaining the data transmission request, the second feature analysis device may determine whether a service supporting the data transmission requested by the data transmission request exists in the second electronic device. When it is determined that a service (e.g., a second service) supporting the data transmission requested by the data transmission request exists, the second feature analysis device may send the data transmission request to the second service.

[0291] S609: The second service determines whether it supports the data transmission function.

[0292] After obtaining the data transmission request, the second service may determine whether the second service supports the data transmission function, that is, whether the second service can receive the data requested by the data transmission request.

[0293] S610: After determining that the data transmission function is supported, the second service sends the device certificate corresponding to the second electronic device to the second feature analysis device.

[0294] After the second service determines that the data transmission function is supported, the second service may send second target information of the second electronic device (e.g., the device certificate corresponding to the second electronic device) to the second feature analysis device. If the second service determines that the data transmission request is not supported, the second service may not respond to the data transmission request, that is, may not send the device certificate corresponding to the second electronic device to the second feature analysis device.

[0295] S611: After obtaining the device certificate, the second feature analysis device instructs the second communication device to send the device certificate through the Wi-Fi channel.

[0296] After the second feature analysis device obtains the device certificate corresponding to the second electronic device, it can instruct the second communication device to send the device certificate corresponding to the second electronic device to the first electronic device via the Wi-Fi channel. For example, the second communication device can be instructed to send the device certificate corresponding to the second electronic device to the first electronic device via the Wi-Fi unicast channel.

[0297] S612: The second communication device sends the device certificate to the first electronic device via Wi-Fi unicast.

[0298] The second communication device can send the device certificate corresponding to the second electronic device to the first electronic device via Wi-Fi unicast based on the MAC address A1 corresponding to the first electronic device. It should be understood that the second communication device can also send the MAC address A2 corresponding to the second electronic device to the first electronic device via Wi-Fi unicast. The specific content of the second communication device sending the device certificate to the first electronic device via Wi-Fi unicast can refer to the aforementioned S505, after the second electronic device determines that the distance A is less than or equal to the preset distance threshold A, sends the relevant content of the second target information to the first electronic device via the second channel of the second near-field medium.

[0299] S613: After obtaining the device certificate through the Wi-Fi channel, the first communication device sends the device certificate to the first feature analysis device.

[0300] The first communication device can obtain the device certificate and MAC address A2 corresponding to the second electronic device based on the Wi-Fi channel, and can send the device certificate corresponding to the second electronic device to the first feature analysis device, so that the first feature analysis device can verify the second electronic device based on the device certificate corresponding to the second electronic device.

[0301] S614: After obtaining the device certificate, the first feature analysis device instructs the first distance measurement device to obtain the distance B.

[0302] After the first feature analysis device obtains the device certificate corresponding to the second electronic device, it can instruct the first ranging device to obtain the distance B between the first electronic device and the second electronic device, so as to determine whether to verify the second electronic device based on the distance B, and thus determine whether to send the first target information of the first electronic device to the second electronic device.

[0303] S615: After obtaining the distance B, the first distance measuring device sends the distance B to the first feature analysis device.

[0304] After the first distance measuring device obtains the instruction from the first feature analyzing device, it can obtain the distance B and send the distance B to the first feature analyzing device.

[0305] S616: After obtaining the distance B, the first feature analysis device determines whether the distance B is less than or equal to a preset distance threshold B.

[0306] After the first feature analysis device obtains the distance B, it can determine whether the distance B is less than or equal to the preset distance threshold B, so as to determine whether to verify the second electronic device, and thus determine whether to send the first target information of the first electronic device to the second electronic device. The specific content of the first feature analysis device determining whether the distance B is less than or equal to the preset distance threshold B can refer to the aforementioned S506, wherein after the first electronic device obtains the second target information of the second electronic device, it determines whether the distance B between the first electronic device and the second electronic device is less than or equal to the preset distance threshold B.

[0307] S617: After the first feature analysis device determines that the distance B is less than or equal to the preset distance threshold B, the second electronic device is verified according to the device certificate.

[0308] When it is determined that the distance B is less than or equal to the preset distance threshold B, the first feature analysis device may verify the second electronic device based on the device certificate corresponding to the second electronic device. The specific content of the first feature analysis device verifying the second electronic device based on the device certificate corresponding to the second electronic device can refer to the aforementioned S405, where the first electronic device obtains the second target information through the second channel of the second near-field medium and verifies the second electronic device based on the second target information.

[0309] S618: After the first feature analysis device determines that the second electronic device has passed the verification based on the device certificate, it sends the result of the second electronic device passing the verification to the first service.

[0310] After determining that the second electronic device has passed the verification according to the device certificate corresponding to the second electronic device, the first feature analysis device can Figure 6 For ease of understanding, it may be referred to as result A) being sent to the first service.

[0311] S619: After the first service determines that the second electronic device has been verified based on the result that the second electronic device has passed the verification, the first service sends the first target information to the first feature analysis device.

[0312] After the first service obtains the verification result of the second electronic device, it can obtain the first target information of the first electronic device (such as the software signature certificate of the first service and the hash value of the device account corresponding to the first electronic device), and can send the first target information to the first feature analysis device.

[0313] S620. After acquiring the first target information, the first feature analysis device encrypts the first target information according to the second target information to obtain first encrypted information.

[0314] After the first feature analysis device obtains the first target information (e.g., the software signing certificate of the first service and the hash value of the device account corresponding to the first electronic device), it can encrypt the hash value of the software signing certificate of the first service and the device account corresponding to the first electronic device according to the device certificate corresponding to the second electronic device (e.g., the certificate public key included in the device certificate) to obtain the first encrypted information. The first feature analysis device encrypts the first target information according to the second target information, and the specific content of the first encrypted information can refer to the aforementioned S508. After the first electronic device determines that the second electronic device has passed the verification, it encrypts the first target information of the first electronic device according to the second target information to obtain the relevant content of the first encrypted information.

[0315] S621. After obtaining the first encrypted information, the first feature analysis device instructs the first communication device to send the first encrypted information through the Wi-Fi channel.

[0316] After obtaining the first encrypted information, the first feature analysis device may instruct the first communication device to send the first encrypted information to the second electronic device via a Wi-Fi channel. For example, the first communication device may be instructed to send the first encrypted information to the second electronic device via a Wi-Fi unicast channel.

[0317] S622: The first communication device sends the first encrypted information to the second electronic device via Wi-Fi unicast.

[0318] After the first communication device obtains the first encrypted information, it can send the first encrypted information to the second electronic device via Wi-Fi unicast based on the MAC address A2 corresponding to the second electronic device. The specific content of the first communication device sending the first encrypted information to the second electronic device via Wi-Fi unicast can refer to the aforementioned S509, the content of the first electronic device sending the first encrypted information to the second electronic device via the third channel of the second near-field medium.

[0319] In addition, the first communication device can also send the MAC address A3 corresponding to the first electronic device to the second electronic device via Wi-Fi unicast, so that the second electronic device can send relevant information to the first electronic device through the MAC address A3, for example, sending response information after the first electronic device passes verification to the first electronic device through the MAC address A3.

[0320] S623. After obtaining the first encrypted information, the second communication device sends the first encrypted information to the second feature analysis device.

[0321] The second communication device can obtain the first encrypted information sent by the first electronic device, and can send the first encrypted information to the second feature analysis device, so that the second feature analysis device can obtain the first target information corresponding to the first electronic device based on the first encrypted information.

[0322] S624. After obtaining the first encrypted information, the second feature analysis device decrypts the first encrypted information according to the second target information to obtain the first target information.

[0323] After the second feature parsing device obtains the first encrypted information, it can decrypt the first encrypted information based on the device certificate (e.g., certificate public key) corresponding to the second electronic device to obtain the first target information. The second feature parsing device decrypts the first encrypted information based on the second target information to obtain the specific content of the first target information, as described in S510 above. After the second electronic device obtains the first encrypted information sent by the second electronic device through the third channel of the second near-field medium, it decrypts the first encrypted information based on the second target information to obtain the relevant content of the first target information.

[0324] S625. After obtaining the first target information, the second feature analysis device verifies the first electronic device according to the first target information.

[0325] After the second feature analysis device decrypts and obtains the first target information (e.g., the software signature certificate of the first service and the hash value of the device account corresponding to the first electronic device), it can verify the first electronic device based on the first target information to determine whether to establish a connection channel with the first electronic device for data transmission. The specific content of the second feature analysis device verifying the first electronic device based on the first target information can refer to the aforementioned S511, wherein the second electronic device verifies the first electronic device based on the first target information.

[0326] S626: After determining that the first electronic device has passed verification, the second feature analysis device instructs the second communication device to send response information to the first electronic device through the Wi-Fi channel.

[0327] After determining that the first electronic device has passed verification, the second feature analysis device may instruct the second communication device to send a response message to the first electronic device via the Wi-Fi channel, thereby informing the first electronic device that data can be transmitted to the second electronic device through the response message. The specific content of the response message can be referred to the relevant content of the response message mentioned above.

[0328] S627: The second communication device sends response information to the first electronic device via Wi-Fi unicast.

[0329] After obtaining the instruction from the second feature analysis device, the second communication device may send response information to the first electronic device via Wi-Fi unicast based on the MAC address A3 corresponding to the first electronic device.

[0330] S628: After obtaining the response information, the first communication device establishes a Wi-Fi connection channel with the second electronic device.

[0331] After the first electronic device obtains the response information of the second electronic device, it determines that data can be sent to the second electronic device. At this time, the first electronic device can establish a Wi-Fi connection channel with the second electronic device through the first communication device to perform data transmission through the Wi-Fi connection between the first electronic device and the second electronic device.

[0332] S629: The first service performs data transmission with the second service based on the established Wi-Fi connection channel.

[0333] After a Wi-Fi connection channel is established between the first electronic device and the second electronic device, the first service may perform data transmission with the second service based on the established Wi-Fi connection channel.

[0334] That is, in an embodiment of the present application, when a first service in a first electronic device needs to transmit data to a second service in a second electronic device, the user only needs to touch the first electronic device to the second electronic device, and device authentication can be performed between the first electronic device and the second electronic device, and a connection channel can be established between the first electronic device and the second electronic device after the device authentication is passed. After the connection channel between the first electronic device and the second electronic device is established, when the user confirms the data transmission between the first service and the second service, the first service and the second service can directly perform secure data transmission based on the established connection channel, without the need for service verification, thereby eliminating the need for manual intervention and confirmation by the user during service verification, thereby improving the user experience.

[0335] The data transmission method provided in the embodiment of the present application will be exemplified below by taking Bluetooth as the first near-field medium and Starflash as the second near-field medium.

[0336] See also Figure 7 , Figure 7 The data transmission method provided in this embodiment is shown in FIG. Figure 4 .

[0337] like Figure 7 As shown, the first electronic device may include a first feature analysis device, a first distance measurement device, and a first communication device. The second electronic device may include a second feature analysis device, a second distance measurement device, and a second communication device. In addition, the first electronic device may be installed with a first service. The second electronic device may be installed with a second service. Figure 7 An example is given for illustrative description, in which a first service in a first electronic device needs to send data to a second service in a second electronic device.

[0338] like Figure 7 As shown, the method may include:

[0339] S701: A first service sends a data transmission request to a first feature analysis device.

[0340] S702: The first feature analysis device instructs the first communication device to send a data transmission request through the Bluetooth channel.

[0341] The specific contents of S701 and S702 may refer to the relevant contents of the aforementioned S601 and S602.

[0342] S703: The first communication device sends a data transmission request via the Bluetooth channel.

[0343] After obtaining the instruction from the first feature analysis device, the first communication device may send a data transmission request via the Bluetooth channel, for example, by sending the data transmission request via Bluetooth broadcast.

[0344] The Bluetooth broadcast can carry the Starflash address B1 corresponding to the first electronic device, so that the second electronic device can return relevant information to the first electronic device based on the Starflash address B1. In addition, after broadcasting the data transmission request, the first communication device can open a Starflash channel (for example, the channel corresponding to the Starflash address B1) to listen to obtain the information returned by the second electronic device.

[0345] S704: After receiving the data transmission request, the second communication device instructs the second distance measuring device to obtain the distance A.

[0346] S705: After acquiring the distance A, the second distance measuring device sends the distance A to the second communication device.

[0347] S706: After obtaining the distance A, the second communication device determines whether the distance A is less than or equal to a preset distance threshold A.

[0348] S707: After determining that the distance A is less than or equal to the preset distance threshold A, the second communication device sends a data transmission request to the second feature analysis device.

[0349] S708. The second feature analysis device sends a data transmission request to the second service.

[0350] S709: The second service determines whether it supports the data transmission function.

[0351] S710: After determining that the data transmission function is supported, the second service sends the device certificate corresponding to the second electronic device to the second feature analysis device.

[0352] Among them, the specific content of S704 to S710 can refer to the relevant content of the aforementioned S604 to S610.

[0353] S711. After obtaining the device certificate, the second feature analysis device instructs the second communication device to send the device certificate through the Star Flash channel.

[0354] After the second feature analysis device obtains the device certificate corresponding to the second electronic device, it can instruct the second communication device to send the device certificate corresponding to the second electronic device to the first electronic device via the Star Flash channel. For example, the second communication device can be instructed to send the device certificate corresponding to the second electronic device to the first electronic device via the Star Flash unicast channel.

[0355] S712. The second communication device sends the device certificate to the first electronic device via Star Flash unicast.

[0356] The second communication device can send the device certificate corresponding to the second electronic device to the first electronic device through Star Flash unicast based on the Star Flash address B1 corresponding to the first electronic device. It should be understood that the second communication device can also send the Star Flash address B2 corresponding to the second electronic device to the first electronic device through Star Flash unicast. The specific content of the second communication device sending the device certificate to the first electronic device through Star Flash unicast can refer to the aforementioned S505, after the second electronic device determines that the distance A is less than or equal to the preset distance threshold A, the second electronic device sends the relevant content of the second target information to the first electronic device through the second channel of the second near-field medium.

[0357] S713. After obtaining the device certificate through the Star Flash channel, the first communication device sends the device certificate to the first feature analysis device.

[0358] The first communication device can obtain the device certificate and Star Flash address B2 corresponding to the second electronic device based on the Star Flash channel, and can send the device certificate corresponding to the second electronic device to the first feature analysis device, so that the first feature analysis device can verify the second electronic device according to the device certificate corresponding to the second electronic device.

[0359] S714: After obtaining the device certificate, the first feature analysis device instructs the first distance measurement device to obtain the distance B.

[0360] S715. After obtaining the distance B, the first distance measuring device sends the distance B to the first feature analysis device.

[0361] S716: After obtaining the distance B, the first feature analysis device determines whether the distance B is less than or equal to a preset distance threshold B.

[0362] S717: After the first feature analysis device determines that the distance B is less than or equal to the preset distance threshold B, the second electronic device is verified according to the device certificate.

[0363] S718: After the first feature analysis device determines that the second electronic device has passed the verification according to the device certificate, it sends the result of the second electronic device passing the verification to the first service ( Figure 7 The result is shown in A).

[0364] S719: After the first service determines that the second electronic device has passed verification based on the result of the second electronic device passing verification, it sends the first target information to the first feature analysis device.

[0365] S720. After acquiring the first target information, the first feature analysis device encrypts the first target information according to the second target information to obtain first encrypted information.

[0366] Among them, the specific contents of S714 to S720 can refer to the relevant contents of the aforementioned S614 to S620.

[0367] S721. After obtaining the first encrypted information, the first feature analysis device instructs the first communication device to send the first encrypted information through the Star Flash channel.

[0368] After obtaining the first encrypted information, the first feature analysis device may instruct the first communication device to send the first encrypted information to the second electronic device via the Star Flash channel. For example, the first communication device may be instructed to send the first encrypted information to the second electronic device via the Star Flash unicast channel.

[0369] S722. The first communication device sends the first encrypted information to the second electronic device via Star Flash unicast.

[0370] After the first communication device obtains the first encrypted information, it can send the first encrypted information to the second electronic device via Starflash unicast based on the Starflash address B2 corresponding to the second electronic device. It should be understood that the first communication device can also send the Starflash address B3 corresponding to the first electronic device to the second electronic device via Starflash unicast.

[0371] S723. After obtaining the first encrypted information, the second communication device sends the first encrypted information to the second feature analysis device.

[0372] The second communication device can obtain the first encrypted information and the Star Flash address B3 sent by the first electronic device, and can send the first encrypted information to the second feature analysis device.

[0373] S724. After obtaining the first encrypted information, the second feature analysis device decrypts the first encrypted information according to the second target information to obtain the first target information.

[0374] S725. After obtaining the first target information, the second feature analysis device verifies the first electronic device according to the first target information.

[0375] Among them, the specific contents of S724 to S725 can refer to the relevant contents of the aforementioned S624 to S625.

[0376] S726. After determining that the first electronic device has passed verification, the second feature analysis device encrypts the response information according to the first target information to obtain second encrypted information.

[0377] Among them, the second feature analysis device encrypts the response information according to the first target information, and the specific content of the second encrypted information can refer to the aforementioned S512. After the second electronic device determines that the first electronic device has passed the verification, it encrypts the response information according to the first target information to obtain the relevant content of the second encrypted information.

[0378] S727. After obtaining the second encrypted information, the second feature analysis device instructs the second communication device to send the second encrypted information to the first electronic device through the Star Flash channel.

[0379] After obtaining the second encrypted information, the second feature analysis device can instruct the second communication device to send the second encrypted information to the first electronic device through the Star Flash channel.

[0380] S728. The second communication device sends the second encrypted information to the first electronic device via Star Flash unicast.

[0381] After obtaining the instruction of the second feature analysis device, the second communication device can send the second encrypted information to the first electronic device through Star Flash unicast based on the Star Flash address B3 corresponding to the first electronic device.

[0382] S729. After obtaining the second encrypted information, the first communication device sends the second encrypted information to the first feature analysis device.

[0383] After the first communication device obtains the second encrypted information, it can send the second encrypted information to the first feature analysis device, so that the first feature analysis device can decrypt the second encrypted information to obtain the response information sent by the second electronic device.

[0384] S730. After obtaining the second encrypted information, the first feature analysis device decrypts the second encrypted information according to the first target information to obtain response information.

[0385] Among them, the first feature analysis device decrypts the second encrypted information according to the first target information, and the specific content of the response information can be referred to the aforementioned S514. After the first electronic device obtains the second encrypted information through the fourth channel of the second near-field medium, it decrypts the second encrypted information according to the first target information to obtain the relevant content of the response information.

[0386] S731. After receiving the response information, the first communication device establishes a Star Flash connection channel with the second electronic device.

[0387] After the first feature analysis device analyzes the response information of the second electronic device, it determines that data can be sent to the second electronic device. At this time, the first feature analysis device can instruct the first communication device to establish a star flash connection channel with the second electronic device to transmit data through the star flash connection between the first electronic device and the second electronic device.

[0388] S732: The first service performs data transmission with the second service based on the established Star Flash connection channel.

[0389] After the Star Flash connection channel is established between the first electronic device and the second electronic device, the first service can perform data transmission with the second service based on the established Star Flash connection channel.

[0390] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0391] Corresponding to the data transmission method described in the above embodiment, the embodiment of the present application further provides a data transmission device, and each module of the device can correspondingly implement each step of the data transmission method.

[0392] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0393] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0394] The embodiment of the present application also provides a first electronic device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the first electronic device implements the steps performed by the first electronic device in any of the above-mentioned method embodiments. For example, the structure of the first electronic device can be as follows: Figure 2 shown.

[0395] The embodiment of the present application also provides a second electronic device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the second electronic device implements the steps performed by the second electronic device in any of the above-mentioned method embodiments. For example, the structure of the second electronic device can be as follows: Figure 2 shown.

[0396] An embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a first electronic device, the computer program enables the first electronic device to implement the steps performed by the first electronic device in any of the above-mentioned method embodiments; or, when the computer program is executed by a second electronic device, the computer program enables the second electronic device to implement the steps performed by the second electronic device in any of the above-mentioned method embodiments.

[0397] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run on a first electronic device, the computer program enables the first electronic device to implement the steps performed by the first electronic device in any of the above-mentioned method embodiments; or, when the computer program is run on a second electronic device, the computer program enables the second electronic device to implement the steps performed by the second electronic device in any of the above-mentioned method embodiments.

[0398] 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 present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include at least: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.

[0399] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0400] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0401] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0402] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0403] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: In response to a preset operation, the first electronic device sends a data transmission request through a first channel of a first near-field medium; The first electronic device obtains second target information of the second electronic device through a second channel of the second near-field medium; the second target information is sent by the second electronic device to the first electronic device based on the data transmission request; After determining, according to the second target information, that the second electronic device has passed verification, the first electronic device sends the first target information of the first electronic device to the second electronic device through a third channel of the second near-field medium; After the second electronic device determines that the first electronic device has passed verification based on the first target information, the first electronic device establishes a connection channel with the second electronic device; the connection channel is used for data transmission between the first electronic device and the second electronic device.

2. The method according to claim 1, characterized in that After the first electronic device determines, based on the second target information, that the second electronic device passes verification, the first electronic device sends the first target information of the first electronic device to the second electronic device through a third channel of the second near-field medium, including: After the first electronic device determines that the second electronic device has passed verification according to the second target information, the first electronic device encrypts the first target information of the first electronic device according to the second target information to obtain first encrypted information; The first electronic device sends the first encrypted information to the second electronic device through a third channel of the second near-field medium.

3. The method according to claim 1 or 2, characterized in that The first near-field medium is Bluetooth, and the second near-field medium is Wireless Fidelity Wi-Fi or StarFlash.

4. The method according to claim 3, characterized in that The first channel is a Bluetooth broadcast channel, the second channel and the third channel are Wi-Fi unicast channels, or the second channel and the third channel are Star Flash unicast channels.

5. The method according to claim 3 or 4, characterized in that The sending of the data transmission request by the first electronic device through the first channel of the first near-field medium in response to the preset operation includes: In response to the preset operation, the first electronic device sends a Bluetooth broadcast, where the Bluetooth broadcast includes the data transmission request.

6. The method according to claim 5, characterized in that The Bluetooth broadcast further includes address information of a first Wi-Fi unicast channel corresponding to the first electronic device; or the Bluetooth broadcast further includes address information of a first StarFlash unicast channel corresponding to the first electronic device.

7. The method according to claim 6, characterized in that The first electronic device obtains second target information of the second electronic device through a second channel of a second near-field medium, including: The first electronic device obtains the second target information of the second electronic device through the first Wi-Fi unicast channel; or The first electronic device obtains second target information of the second electronic device through the first Star Flash unicast channel.

8. The method according to any one of claims 3 to 7, characterized in that The method further comprises: The first electronic device obtains address information of a second Wi-Fi unicast channel corresponding to the second electronic device through the second channel of the second near-field medium; or The first electronic device obtains address information of a second StarFlash unicast channel corresponding to the second electronic device through the second channel of the second near-field medium.

9. The method according to claim 8, characterized in that The first electronic device sending first target information of the first electronic device to the second electronic device through the third channel of the second near-field medium includes: The first electronic device sends the first target information of the first electronic device to the second electronic device through the second Wi-Fi unicast channel; or The first electronic device sends the first target information of the first electronic device to the second electronic device through the second Star Flash unicast channel.

10. The method according to any one of claims 1 to 9, characterized in that After the second electronic device determines, based on the first target information, that the first electronic device has passed verification, establishing a connection channel with the second electronic device includes: The first electronic device obtains, via a fourth channel of the second near-field medium, second encrypted information sent by the second electronic device; the second encrypted information is obtained by encrypting response information based on the first target information after the second electronic device determines that the first electronic device has passed verification based on the first target information; the response information is used to indicate that the second electronic device has passed verification of the first electronic device; The first electronic device decrypts the second encrypted information according to the first target information to obtain the response information, and establishes a connection channel with the second electronic device according to the response information.

11. The method according to claim 10, characterized in that The method further comprises: The first electronic device sends address information of a third Wi-Fi unicast channel corresponding to the first electronic device to the second electronic device through a third channel of the second near-field medium; or The first electronic device sends address information of a third Star Flash unicast channel corresponding to the first electronic device to the second electronic device through a third channel of the second near-field medium.

12. The method according to claim 11, characterized in that The first electronic device obtaining, through the fourth channel of the second near-field medium, second encrypted information sent by the second electronic device, including: The first electronic device obtains the second encrypted information sent by the second electronic device through the third Wi-Fi unicast channel; or The first electronic device obtains the second encrypted information sent by the second electronic device through the third Star Flash unicast channel.

13. The method according to any one of claims 1 to 12, characterized in that The first electronic device determining, according to the second target information, that the second electronic device has passed verification includes: determining, by the first electronic device, a first distance between the first electronic device and the second electronic device; When the first distance is less than or equal to a first preset distance threshold, the first electronic device determines, based on the second target information, that the second electronic device has passed verification.

14. The method according to any one of claims 1 to 13, characterized in that The preset operation includes a touch operation.

15. The method according to any one of claims 1 to 14, characterized in that The second target information includes device information and / or service information of the second electronic device. The service information of the second electronic device is information of a second service that requires data transmission in the second electronic device.

16. The method according to any one of claims 1 to 15, characterized in that The first target information includes device information and / or service information of the first electronic device. The service information of the first electronic device is information of a first service that requires data transmission in the first electronic device.

17. The method according to claim 15 or 16, characterized in that The device information includes the device certificate, device account certificate, device operating system compilation signature certificate, device identity or device account; the service information includes the service software signature certificate.

18. A data transmission method, characterized in that: Applied to a second electronic device, the method includes: The second electronic device obtains, through the first channel of the first near-field medium, a data transmission request sent by the first electronic device; The second electronic device sends second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request; The second electronic device obtains the first target information sent by the first electronic device through the third channel of the second near-field medium; the first target information is sent by the first electronic device to the second electronic device after the first electronic device determines that the second electronic device has passed verification based on the second target information; After determining that the first electronic device has passed verification according to the first target information, the second electronic device establishes a connection channel with the first electronic device; the connection channel is used for data transmission between the first electronic device and the second electronic device.

19. The method according to claim 18, characterized in that The second electronic device acquiring, through the third channel of the second near-field medium, first target information sent by the first electronic device, including: The second electronic device obtains the first encrypted information sent by the first electronic device through the third channel of the second near-field medium; the first encrypted information is obtained by encrypting the first target information of the first electronic device according to the second target information after the first electronic device determines that the second electronic device has passed verification according to the second target information; The second electronic device decrypts the first encrypted information according to the second target information to obtain the first target information of the first electronic device.

20. The method according to claim 18 or 19, characterized in that The first near-field medium is Bluetooth, and the second near-field medium is Wireless Fidelity Wi-Fi or StarFlash.

21. The method according to claim 20, characterized in that The first channel is a Bluetooth broadcast channel, the second channel and the third channel are Wi-Fi unicast channels, or the second channel and the third channel are Star Flash unicast channels.

22. The method according to claim 20 or 21, characterized in that The second electronic device obtains, through the first channel of the first near-field medium, a data transmission request sent by the first electronic device, including: The second electronic device obtains the Bluetooth broadcast broadcasted by the first electronic device, where the Bluetooth broadcast includes the data transmission request.

23. The method according to claim 22, characterized in that The Bluetooth broadcast further includes address information of a first Wi-Fi unicast channel corresponding to the first electronic device; or the Bluetooth broadcast further includes address information of a first StarFlash unicast channel corresponding to the first electronic device.

24. The method according to claim 23, wherein The second electronic device sending second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request includes: The second electronic device sends the second target information to the first electronic device through the first Wi-Fi unicast channel according to the data transmission request; or The second electronic device sends the second target information to the first electronic device through the first Star Flash unicast channel according to the data transmission request.

25. The method according to any one of claims 20 to 24, characterized in that The method further comprises: The second electronic device sends address information of a second Wi-Fi unicast channel corresponding to the second electronic device to the first electronic device through the second channel of the second near-field medium; or, The second electronic device sends address information of a second Star Flash unicast channel corresponding to the second electronic device to the first electronic device through the second channel of the second near-field medium.

26. The method according to claim 25, characterized in that The second electronic device acquiring, through the third channel of the second near-field medium, first target information sent by the first electronic device, including: The second electronic device obtains the first target information sent by the first electronic device through the second Wi-Fi unicast channel; or The second electronic device obtains the first target information sent by the first electronic device through the second Star Flash unicast channel.

27. The method according to any one of claims 18 to 26, characterized in that After the second electronic device determines, based on the first target information, that the first electronic device has passed verification, establishing a connection channel with the first electronic device includes: After the second electronic device determines that the first electronic device has passed verification based on the first target information, the second electronic device encrypts the response information based on the first target information to obtain second encrypted information; the response information is used to indicate that the second electronic device has passed verification of the first electronic device; The second electronic device sends the second encrypted information to the first electronic device through a fourth channel of the second near-field medium, where the second encrypted information is used to indicate that the first electronic device can establish a connection channel with the second electronic device.

28. The method according to claim 27, characterized in that The method further comprises: The second electronic device obtains the address information of the third Wi-Fi unicast channel corresponding to the first electronic device sent by the first electronic device through the third channel of the second near-field medium; or The second electronic device obtains, through the third channel of the second near-field medium, address information of the third Star Flash unicast channel corresponding to the first electronic device, which is sent by the first electronic device.

29. The method according to claim 28, characterized in that The second electronic device sending the second encrypted information to the first electronic device through the fourth channel of the second near-field medium includes: The second electronic device sends the second encrypted information to the first electronic device through the third Wi-Fi unicast channel; or The second electronic device sends the second encrypted information to the first electronic device through the third Star Flash unicast channel.

30. The method according to any one of claims 18 to 29, characterized in that The second electronic device sending second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request includes: The second electronic device determines a second distance between the second electronic device and the first electronic device; When the second distance is less than or equal to a second preset distance threshold, the second electronic device sends the second target information to the first electronic device through a second channel of a second near-field medium according to the data transmission request.

31. The method according to any one of claims 18 to 30, characterized in that The second target information includes device information and / or service information of the second electronic device. The service information of the second electronic device is information of a second service that requires data transmission in the second electronic device.

32. The method according to any one of claims 18 to 31, characterized in that The first target information includes device information and / or service information of the first electronic device. The service information of the first electronic device is information of a first service that requires data transmission in the first electronic device.

33. The method according to claim 31 or 32, characterized in that The device information includes the device certificate, device account certificate, device operating system compilation signature certificate, device identity or device account; the service information includes the service software signature certificate.

34. A data transmission system, characterized in that comprising a first electronic device and a second electronic device; The first electronic device is configured to perform the steps of the data transmission method according to any one of claims 1 to 17; The second electronic device is used to perform the steps in the data transmission method as described in any one of claims 18 to 33.

35. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device implements the data transmission method according to any one of claims 1 to 17, or implements the data transmission method according to any one of claims 18 to 33.

36. A computer program product, comprising a computer program, characterized in that When the computer program is executed by an electronic device, the electronic device implements the data transmission method according to any one of claims 1 to 17, or implements the data transmission method according to any one of claims 18 to 33.

37. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by an electronic device, the electronic device implements the data transmission method according to any one of claims 1 to 17, or implements the data transmission method according to any one of claims 18 to 33.

Citation Information

Patent Citations

  • Authentication method and mobile terminal

    CN106304066A

  • Data transmission method and device, electronic equipment and storage medium

    CN113595740A

  • Verification method and device

    CN113810886A

  • Wireless connection method and device, electronic equipment and readable storage medium

    CN114339710A

  • File sharing method and electronic equipment

    CN115278616A