Data transmission method, device and equipment, readable storage medium and program product
By obtaining Bluetooth broadcast signals to determine the target device type and adjusting the NFC working mode, the compatibility problem of different types of electronic devices activated communication through NFC is solved, and efficient data transmission is achieved.
Patent Information
- Application Number
- CN202510468181.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-06-24
AI Technical Summary
The prior art is difficult to compatible with different types of electronic devices to activate communication for data transmission through NFC technology, especially between two first type electronic devices. When NFC is in card simulation mode, it is impossible to establish a communication link, resulting in cumbersome and time-consuming data transmission.
By obtaining N Bluetooth broadcast signals upon receiving input for the target file, the device type of the target device is determined, and the NFC of the first electronic device is controlled according to the type to be in the operating mode corresponding to the device type, so as to induce and identify and establish a communication channel with the target device.
It is compatible with different types of electronic devices to establish communication channels for data transmission through NFC technology, which reduces the number of data transmission operations, simplifies the data transmission process, and improves the efficiency of data transmission.
Smart Images

Figure CN120201382A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of electronic devices, and particularly relates to a data transmission method, apparatus, device, readable storage medium, and program product. Background Art
[0002] With the development of intelligent life, the data transmission methods between electronic devices are increasingly pursuing convenience and efficiency. Near-field communication (NFC) technology is a technology that allows two electronic devices to quickly sense and identify within a range of a few centimeters, activate communication, and establish a communication channel for data transmission, which can reduce the operations of users to establish a communication channel and effectively meet the user's demand for convenient and efficient data transmission.
[0003] However, there are different types of electronic devices on the market, and they have different limiting conditions for inductive identification through NFC technology. It can be seen that how to be compatible with different types of electronic devices to activate communication through NFC technology for data transmission is an urgent problem to be solved. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a data transmission method, apparatus, device, readable storage medium, and program product, which can be compatible with different types of electronic devices to establish a communication channel through NFC technology for data transmission.
[0005] In a first aspect, the embodiments of this application provide a data transmission method, which includes:
[0006] When receiving a first input for a target file, obtain N Bluetooth broadcast signals, where N is a positive integer;
[0007] Determine the device type of the target device according to the N Bluetooth broadcast signals;
[0008] Control the near-field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type.
[0009] In a second aspect, the embodiments of this application provide a data transmission apparatus, which includes:
[0010] An obtaining module, configured to obtain N Bluetooth broadcast signals when receiving a first input for a target file, where N is a positive integer;
[0011] A determining module, configured to determine the device type of the target device according to the N Bluetooth broadcast signals;
[0012] A control module, configured to control the near-field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instructions that can run on the processor. When the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instructions are stored. When the program or instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instructions to implement the method described in the first aspect.
[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0017] In the embodiment of the present application, when a first input for a target file is received, N Bluetooth broadcast signals can be obtained, where N is a positive integer; according to the N Bluetooth broadcast signals, the device type of the target device is determined; and the near field communication (NFC) of the first electronic device is controlled to be in a working mode corresponding to the device type. In this way, when the first electronic device wants to share the target file with other devices, it can determine the device type of the target device that may perform data transmission with the first electronic device based on the obtained Bluetooth broadcast signals, and then flexibly adjust the working mode of the NFC of the first electronic device according to the device type, so that the first electronic device can successfully sense and identify the target device, thereby establishing a communication channel for data transmission. Therefore, it is possible to be compatible with different types of electronic devices to establish a communication channel for data transmission through NFC technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a schematic flowchart of the data transmission method provided by the embodiment of the present application;
[0019] Figure 2 is a schematic flowchart of a scenario embodiment of the data transmission method provided by the embodiment of the present application;
[0020] Figure 3 is a schematic structural diagram of the data transmission device provided by the embodiment of the present application;
[0021] Figure 4 is a schematic structural diagram of the electronic device provided by the embodiment of the present application;
[0022] Figure 5It is a schematic diagram of the hardware structure of the electronic device provided by the embodiments of the present application. Detailed implementation manners
[0023] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.
[0024] Terms such as "first" and "second" in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects before and after.
[0025] NFC: Near Field Communication, that is, near-field communication, is a short-range high-frequency wireless communication technology that allows non-contact point-to-point data transmission and data exchange between electronic devices. NFC technology evolved from the integration of non-contact radio frequency identification and interconnection technologies, and can be used to achieve applications such as mobile payment, electronic ticketing, access control, mobile identity recognition, anti-counterfeiting, and data transmission through electronic devices.
[0026] Read / write mode (NFC reader / writer): A working mode of NFC. In the read / write mode, the NFC device, as a card reader, actively emits its own radio frequency magnetic field to identify and read / write data to tags or devices. For example, when the mobile phone NFC is in the read / write mode, it can read some information in the NFC Tag tag, or read the balance of the bus card or subway card or recharge in scenarios such as this.
[0027] Card emulation mode (NFC card emulation): A working mode of NFC. In this mode, the electronic device can be emulated as an NFC card (such as a transportation card, access control card, or bank card, etc.), and only passively senses in the radio frequency magnetic field emitted by other devices. In the card emulation mode, the electronic device internally includes an NFC controller and an NFC antenna. When the electronic device approaches the NFC radio frequency device, it will send and receive radio frequency signals through the antenna, and these signals contain the information of the NFC card emulated by the electronic device, such as the card number, balance, etc.
[0028] In the related art, when two electronic devices are close to each other, if the NFC of one of the electronic devices is in the read / write mode and generates a radio frequency magnetic field as the active device, and the NFC of the other electronic device is in the card emulation mode and its coil obtains energy through electromagnetic induction and responds as the passive device, the two electronic devices can establish a communication link at this time to transmit data. If both electronic devices are in the card emulation mode, neither of them generates a radio frequency field at this time, resulting in no energy source and unable to activate communication. Or, if both electronic devices are in the read / write mode, a radio frequency magnetic field will be generated simultaneously at this time, resulting in electromagnetic interference and unable to establish an effective communication link. Usually, the NFC of an electronic device works in an alternating mode between the read / write mode and the card emulation mode.
[0029] Currently, there are two types of electronic devices on the market: For the first type of electronic device, when the NFC of the peer device is in the above alternating working mode or the card emulation mode, it can sense and identify the peer device, and then establish a communication channel with the peer device to transmit data. For the second type of electronic device, it can only sense and identify the peer device when the NFC of the peer device is in the card emulation mode, and then establish a communication channel with the peer device to transmit data.
[0030] In order to be compatible with the activation communication requirements of the above two types of electronic devices, currently, the first type of electronic device can achieve this by limiting the working mode of its own NFC to the card emulation mode when entering the data transmission scenario.
[0031] However, the applicant found that by using this method, if both electronic devices are of the first type and both have the need to transmit data to each other, at this time, the NFCs of both electronic devices are in the card emulation mode, which will lead to the problem that a communication link cannot be established for subsequent data transmission. Only one-way data transmission can be carried out by activating communication through NFC respectively, that is, the NFC of the first electronic device is in the card emulation mode, and the NFC of the second electronic device is in the read / write mode. The first electronic device is brought close to the second electronic device so that the second electronic device can sense and identify the first electronic device, establish a communication channel with the first electronic device, and receive the data transmitted by the first electronic device. Then, repeat the above operation. The NFC of the second electronic device is in the card emulation mode, and the NFC of the first electronic device is in the read / write mode. The second electronic device is brought close to the first electronic device so that the first electronic device can sense and identify the second electronic device, establish a communication channel with the second electronic device, and receive the data transmitted by the second electronic device. In this way, the number of data transmission operations is increased, resulting in a more cumbersome data transmission process and longer time consumption.
[0032] In order to solve the above technical problems, the data transmission method provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0033] Figure 1 It is a schematic flowchart of the data transmission method provided by the embodiments of the present application. The data transmission method may include:
[0034] Step 101, when receiving a first input for a target file, obtain N Bluetooth broadcast signals, where N is a positive integer.
[0035] In step 101, the first electronic device can turn on the Bluetooth function and the NFC function. At this time, the first electronic device can send out Bluetooth broadcast signals and can also detect in real time the Bluetooth broadcast signals sent by other electronic devices in the surrounding environment.
[0036] The first electronic device can receive a first input from the user for a target file (such as a document, video, audio, picture, etc.). Exemplarily, when the user wants to share the target file, the target file can be selected to trigger the sharing process. It can also be that after the target file is selected, the sharing control is clicked to trigger the sharing process. It can also be that when the target file is displayed according to a preset display mode, such as when entering the preview interface of a video or a large picture, the sharing process is triggered. At this time, obtain N Bluetooth broadcast signals.
[0037] Among them, the Bluetooth broadcast signal may include device information corresponding to the electronic device that sends the Bluetooth broadcast signal. The device information may include the model of the device, the manufacturer name of the device, etc. The device type of the electronic device can be determined through the device information, that is, the first type or the second type mentioned above.
[0038] Step 102, determine the device type of the target device according to the N Bluetooth broadcast signals.
[0039] In step 102, as mentioned above, the Bluetooth broadcast signal may include device information, and the device type of the target device can be determined according to the device information in the N Bluetooth broadcast signals. Among them, the target device may refer to all devices corresponding to the N Bluetooth broadcast signals, or one or more devices corresponding to the N Bluetooth broadcast signals that meet the preset conditions. No specific limitation is made here.
[0040] For example, taking the device information including the manufacturer name of the electronic device as an example, the corresponding relationship between the electronic devices of different manufacturers and the device type can be established in advance according to the working mode defined by the NFC of the electronic device. Furthermore, the device type of the target device can be determined according to the manufacturer name indicated by the device information in the N Bluetooth broadcast signals.
[0041] Among them, as mentioned above, the device types may include a first type and a second type. For the first type of electronic device, it can sense and identify the peer device when the NFC of the peer device is in the above-mentioned alternating working mode or card emulation mode. For the second type of electronic device, it can sense and identify the peer device only when the NFC of the peer device is in the card emulation mode.
[0042] Step 103: Control the near field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type.
[0043] In step 103, the NFC of the first electronic device can be controlled to be in the working mode corresponding to the device type according to the device type of the target device, so that the target device can successfully sense and identify the first electronic device to activate the communication, facilitating subsequent data transmission between the first electronic device and the target device.
[0044] Exemplarily, after the NFC senses and identifies, the target device can obtain the Bluetooth Media Access Control (MAC) address information of the first electronic device and establish a Bluetooth connection with the first electronic device. The target device obtains the hotspot information to be connected or the connection information of peer-to-peer (P2P) networking through Bluetooth communication, and then the first electronic device and the target device can establish a Wireless Fidelity (WiFi) connection to perform fast data transmission through WiFi communication.
[0045] In the embodiment of the present application, the data transmission method can, when receiving a first input for a target file, obtain N Bluetooth broadcast signals, where N is a positive integer; determine the device type of the target device according to the N Bluetooth broadcast signals; and control the near field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type. In this way, when the first electronic device wants to share a target file with other devices, it can determine the device type of the target device that may perform data transmission with the first electronic device based on the obtained Bluetooth broadcast signals, and then flexibly adjust the working mode of the NFC of the first electronic device according to the device type, so that the first electronic device can successfully sense and identify the target device, thereby establishing a communication channel for data transmission. Therefore, it can be compatible with different types of electronic devices to establish a communication channel for data transmission through NFC technology.
[0046] In some embodiments, when the target device is the N devices corresponding to the N Bluetooth broadcast signals, controlling the near field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type may include:
[0047] When the device types of the N devices are all of the first type, control the NFC of the first electronic device to be in an operating mode where it alternates between card emulation mode and read / write mode;
[0048] When the device types of the N devices include the second type, control the NFC of the first electronic device to be in card emulation mode;
[0049] Among them, the electronic device of the first type is an electronic device that requires the peer device to be in card emulation mode, or an operating mode that alternates between card emulation mode and read / write mode, when performing NFC sensing and identification; the electronic device of the second type is an electronic device that requires the peer device to be in card emulation mode when performing NFC sensing and identification.
[0050] In this embodiment, the target device can be the N devices corresponding to the N Bluetooth broadcast signals. In other words, the target device can include all the devices around the first electronic device.
[0051] When the device types of the N devices are all of the first type, it can be explained that when the N devices perform NFC sensing and identification, the NFC of the peer device is in card emulation mode, or an operating mode that alternates between card emulation mode and read / write mode, and can successfully perform sensing and identification with the peer device. At this time, the NFC of the first electronic device can be controlled to be in an operating mode that alternates between card emulation mode and read / write mode.
[0052] In this way, if any of the N devices also has a need to share files with the first electronic device, and the device type of the first electronic device can also be of the first type. At this time, the NFC of this device can also be controlled to be in an operating mode that alternates between card emulation mode and read / write mode. At this time, the NFCs of both devices are in the alternating operating mode, and through a single close-range sensing, the mutual NFC sensing and identification of both devices can be completed, achieving the purpose of bidirectional data transmission.
[0053] When the device types of the N devices include the second type, it can be explained that there is an electronic device among the N devices that requires the peer NFC to be in card emulation mode to successfully perform NFC sensing and identification. At this time, the NFC of the first electronic device can be controlled to be in card emulation mode to ensure that the first electronic device can be successfully sensed and identified by all the surrounding devices, reducing the risk of data transmission failure caused by the inability of a certain device to sense and identify the first electronic device and resulting in the failure to establish a communication channel.
[0054] In this way, the device types of all devices around the first electronic device can be determined at one time, so as to control the working mode of the NFC of the first electronic device by considering the limiting conditions of NFC induction recognition of all surrounding devices. While being able to be compatible with different types of electronic devices to establish a communication channel through NFC technology for data transmission, the number of device type detections is reduced, and computing power resources are saved.
[0055] In some embodiments, the Bluetooth broadcast signal includes device information and signal strength; determining the device type of the target device according to N Bluetooth broadcast signals may include:
[0056] Determining the target device from the N devices corresponding to the N Bluetooth broadcast signals according to the signal strength;
[0057] Determining the device type of the target device according to the device information in the target Bluetooth broadcast signal corresponding to the target device.
[0058] In this embodiment, the Bluetooth broadcast signal may include device information and signal strength. The device information is as described above and will not be elaborated here. The signal strength can, to a certain extent, reflect the distance between the device corresponding to the Bluetooth broadcast signal and the first electronic device.
[0059] The target device can be determined from the N devices corresponding to the N Bluetooth broadcast signals according to the signal strength. Exemplarily, the device corresponding to the Bluetooth broadcast signal with a signal strength greater than a preset threshold can be determined as the target device, or the signal strengths can be arranged in descending order, and one or more devices corresponding to the Bluetooth broadcast signals at the front can be selected as the target devices. For example, the target device can be the device determined to be the closest to the first electronic device. It can be understood that the Bluetooth broadcast signals are obtained in real time, so the target device can change in the scenario where the first electronic device shares the target file.
[0060] The device type of the target device can be determined according to the device information in the target Bluetooth broadcast signal corresponding to the target device. So that subsequently, the working mode of the NFC of the first electronic device can be controlled specifically based on the device type of the target device.
[0061] In this way, the target device can be determined by considering the signal strength, and then the working mode of the NFC of the first electronic device can be controlled according to the device type of the target device, improving the pertinence and accuracy of the NFC working mode.
[0062] In some embodiments, controlling the near field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type may include:
[0063] When the device type is the first type, control the NFC of the first electronic device to be in an operating mode where the card emulation mode and the read / write mode alternate;
[0064] When the device type is the second type, control the NFC of the first electronic device to be in the card emulation mode;
[0065] Among them, the first type of electronic device is an electronic device that requires the peer to be in the card emulation mode, or an operating mode where the card emulation mode and the read / write mode alternate, when performing NFC sensing and identification; the second type of electronic device is an electronic device that requires the peer to be in the card emulation mode when performing NFC sensing and identification.
[0066] In this embodiment, if the device type of the target device is the first type, it means that at this time, the target device can perform normal sensing and identification with the first electronic device when the NFC of the first electronic device is in the first operating mode or the card emulation mode, activate communication, and establish a WiFi connection to achieve the purpose of data transmission.
[0067] At this time, the NFC of the first electronic device can be controlled to be in an operating mode where the card emulation mode and the read / write mode alternate. In this way, if the target device has no need to transmit data to the first electronic device, since the operating mode where the card emulation mode and the read / write mode alternate is the normal operating mode of the NFC, the NFC of the target device can also be in an operating mode where the card emulation mode and the read / write mode alternate. When the NFC of the first electronic device alternates to the card emulation mode and the NFC of the target device alternates to the read / write mode, the target device can identify the first electronic device to establish a WiFi connection, and the first electronic device transmits data to the target device through WiFi communication.
[0068] If the target device also has a need to transmit data to the first electronic device, and the device type of the first electronic device can also be the first type. At this time, the NFC of the target device can also be controlled to be in an operating mode where the card emulation mode and the read / write mode alternate. When the NFC of the first electronic device alternates to the card emulation mode and the NFC of the target device alternates to the read / write mode, the target device can identify the first electronic device to establish a WiFi connection, and the first electronic device transmits data to the target device through WiFi communication. When the NFC of the target device alternates to the card emulation mode and the NFC of the first electronic device alternates to the read / write mode, the first electronic device can identify the target device to establish a WiFi connection, and the target device transmits data to the first electronic device through WiFi communication. In other words, the purpose of two-way data transmission between the first electronic device and the target device can be achieved through one NFC sensing and identification.
[0069] If the device type of the target device is the second type, it means that at this time, the target device can only perform normal induction recognition and activate communication with the first electronic device when the NFC of the first electronic device is in the card emulation mode, so as to establish a WiFi connection to achieve the purpose of data transmission.
[0070] At this time, the NFC of the first electronic device can be controlled to be in the card emulation mode to meet the requirement of the target device to activate communication through the NFC technology, that is, the target device can identify the first electronic device to establish a WiFi connection, and the first electronic device transmits data to the target device through WiFi communication to achieve the purpose of data transmission.
[0071] In this way, on the one hand, when the device type of the target device is the first type, the NFC of the first electronic device can be controlled to alternate between the card emulation mode and the read / write mode, so that when there is a need for two-way data transmission between the first electronic device and the target device, two-way data transmission can be completed through one close-range induction, reducing the number of data transmission times, simplifying the data transmission process, and effectively improving the data transmission efficiency. On the other hand, when the device type of the target device is the second type, the NFC of the first electronic device can be controlled to be in the card emulation mode, so as to be compatible with the second type of electronic device to establish a communication channel through the NFC technology for data transmission.
[0072] In some embodiments, when receiving a first input for a target file, obtaining N Bluetooth broadcast signals may include:
[0073] When receiving a first input for a target file, controlling the NFC of the first electronic device to be in the card emulation mode;
[0074] Obtaining N Bluetooth broadcast signals.
[0075] In this embodiment, as mentioned above, both the first type of electronic device and the second type of electronic device can identify an electronic device with the NFC in the card emulation mode.
[0076] Based on this, for the first type of target device, if the target device has no need to transmit data to the first electronic device, at this time, if the NFC of the first electronic device is in the card emulation mode, the target device can also identify the first electronic device, and then establish a WiFi connection to achieve the purpose of the first electronic device transmitting data to the target device.
[0077] In this way, when the first electronic device receives a first input for a target file and enters the scenario of sharing a file, the NFC of the first electronic device can be controlled to be in the card emulation mode first, and then N Bluetooth broadcast signals can be obtained to perform the step of determining the device type of the target device.
[0078] In this way, through the compatible card emulation mode, the limiting conditions of the NFC working mode for activating communication and transmitting data while adapting to different types of target devices can be met. Before determining the device type of the target device, the purpose of transmitting data from the first electronic device to the target device can be achieved, further improving the data transmission efficiency.
[0079] In some embodiments, determining the target device from the N devices corresponding to the N Bluetooth broadcast signals according to the signal strength may include:
[0080] Determining the distances between the N devices and the first electronic device according to the device information and signal strength in the N Bluetooth broadcast signals;
[0081] Determining the device corresponding to the minimum value of the distances as the target device.
[0082] In this embodiment, since there are differences in the signal strengths of the Bluetooth broadcast signals released by electronic devices of different brands, for the same signal strength, the distances between electronic devices of different brands and the first electronic device may be inconsistent.
[0083] Based on this, a mapping relationship between the signal strength and the distance can be established for different brands of devices, and then the distances between the N devices and the first electronic device can be determined according to the signal strength and the device information in the N Bluetooth broadcast signals.
[0084] The device corresponding to the minimum value of the distances can be determined as the target device. In other words, the device closest to the first electronic device can be determined as the target device that needs to transmit data with the first electronic device.
[0085] The first electronic device can obtain the changes of the nearest electronic device in real time, so that NFC can dynamically adjust the working mode of NFC according to the device type of the nearest electronic device obtained by listening.
[0086] In this way, by combining the device information and signal strength in the Bluetooth broadcast signal, the distance between the device corresponding to the Bluetooth broadcast signal and the first electronic device can be accurately judged, so as to determine a more accurate target device, and then the accuracy of the NFC working mode is improved.
[0087] To facilitate the understanding of the data transmission method provided in the above embodiments, the following uses a specific scenario embodiment to illustrate the above data transmission method. Figure 2 It is a schematic flowchart of a scenario embodiment of the data transmission method provided in the embodiment of the present application.
[0088] The application scenario of this scenario embodiment can be: Both electronic device A and electronic device B are electronic devices of the first type.
[0089] The embodiments of this scenario may specifically include the following steps:
[0090] Step 201, both Electronic Device A and Electronic Device B turn on the NFC and Bluetooth functions, and the system starts to detect the Bluetooth broadcast signals of surrounding devices. The Bluetooth broadcast signals include device information and signal strength.
[0091] Step 202, both Electronic Device A and Electronic Device B check the pictures for the picture sharing scenario. At this time, the NFCs of Electronic Device A and Electronic Device B are both in the card emulation mode.
[0092] Step 203, Electronic Device A obtains the target device (i.e., Electronic Device B) according to the device information and signal strength in the Bluetooth broadcast signal, and Electronic Device B obtains the target device (i.e., Electronic Device A) according to the device information and signal strength in the Bluetooth broadcast signal.
[0093] Step 204, Electronic Device A determines that the device type of Electronic Device B is the first type according to the Bluetooth broadcast signal sent by Electronic Device B, and controls the NFC of Electronic Device A to be in an operating mode that alternates between the card emulation mode and the read / write mode.
[0094] Step 205, Electronic Device B determines that the device type of Electronic Device A is the first type according to the Bluetooth broadcast signal sent by Electronic Device A, and controls the NFC of Electronic Device B to be in an operating mode that alternates between the card emulation mode and the read / write mode.
[0095] Step 206, Electronic Device A and Electronic Device B trigger NFC induction at a short distance for subsequent two-way picture sharing.
[0096] In the embodiments of this scenario, by introducing the detection of the Bluetooth broadcast signals and signal strength of surrounding devices to determine the device type of the nearest electronic device, the operating mode of the NFC of this electronic device is dynamically managed and switched, thereby solving the problem that electronic devices cannot perform two-way sharing based on a single NFC short-distance induction, and further expanding the scenarios that support users to use NFC for data transmission.
[0097] In the data transmission method provided by the embodiments of this application, the execution subject may be a data transmission device. In the embodiments of this application, taking the data transmission device executing the data transmission method as an example, the data transmission device provided by the embodiments of this application is described.
[0098] As Figure 3 shown, the data transmission device 300 may include:
[0099] An acquisition module 301, configured to acquire N Bluetooth broadcast signals when receiving a first input for a target file, where N is a positive integer.
[0100] A determination module 302, configured to determine the device type of a target device according to N Bluetooth broadcast signals;
[0101] A control module 303, configured to control the near field communication (NFC) of the first electronic device to be in a working mode corresponding to the device type.
[0102] In this way, when the first electronic device wants to share a target file with other devices, it can determine the device type of the target device that may perform data transmission with the first electronic device based on the obtained Bluetooth broadcast signals, and then flexibly adjust the working mode of the NFC of the first electronic device according to the device type, so that the first electronic device can successfully sense and identify the target device, thereby establishing a communication channel for data transmission. Therefore, it can be compatible with different types of electronic devices to establish a communication channel for data transmission through NFC technology.
[0103] In some embodiments, the target device is the N devices corresponding to the N Bluetooth broadcast signals. The control module 303 may further be configured to:
[0104] When the device types of all N devices are of the first type, control the NFC of the first electronic device to be in a working mode of alternating between card emulation mode and read / write mode;
[0105] When the device types of the N devices include the second type, control the NFC of the first electronic device to be in card emulation mode;
[0106] Wherein, the first type of electronic device is an electronic device that requires the opposite end to be in card emulation mode, or an alternating working mode of card emulation mode and read / write mode when performing NFC sensing and identification; the second type of electronic device is an electronic device that requires the opposite end to be in card emulation mode when performing NFC sensing and identification.
[0107] In this way, the device types of all devices around the first electronic device can be determined at one time, so as to control the working mode of the NFC of the first electronic device considering the limiting conditions of NFC sensing and identification of all surrounding devices. While being able to be compatible with different types of electronic devices to establish a communication channel for data transmission through NFC technology, the number of device type detections is reduced, and computing power resources are saved.
[0108] In some embodiments, the Bluetooth broadcast signal includes device information and signal strength. The determination module 302 may further include:
[0109] A first determination unit, configured to determine a target device from the N devices corresponding to the N Bluetooth broadcast signals according to the signal strength;
[0110] A second determination unit, configured to determine the device type of the target device according to the device information in the target Bluetooth broadcast signal corresponding to the target device.
[0111] In this way, the signal strength can be considered to determine the target device, and then the working mode of the NFC of the first electronic device can be controlled according to the device type of the target device, improving the pertinence and accuracy of the NFC working mode.
[0112] In some embodiments, the control module 303 can also be used for:
[0113] When the device type is the first type, control the NFC of the first electronic device to be in a working mode of alternating between the card emulation mode and the read / write mode;
[0114] When the device type is the second type, control the NFC of the first electronic device to be in the card emulation mode;
[0115] Among them, the first type of electronic device is an electronic device that requires the opposite end to be in the card emulation mode, or an alternating working mode between the card emulation mode and the read / write mode when performing NFC induction and identification; the second type of electronic device is an electronic device that requires the opposite end to be in the card emulation mode when performing NFC induction and identification.
[0116] In this way, on the one hand, when the device type of the target device is the first type, the NFC of the first electronic device can be controlled to be in an alternating working mode between the card emulation mode and the read / write mode, so that when there is a need for two-way data transmission between the first electronic device and the target device, two-way data transmission can be completed through a single close-range induction, reducing the number of data transmissions, simplifying the data transmission process, and effectively improving the data transmission efficiency. On the other hand, when the device type of the target device is the second type, the NFC of the first electronic device can be controlled to be in the card emulation mode, so as to be able to be compatible with the second type of electronic device to establish a communication channel through NFC technology for data transmission.
[0117] In some embodiments, the first determination unit can also be used for:
[0118] According to the device information and signal strength in the N Bluetooth broadcast signals, determine the distance between the N devices and the first electronic device;
[0119] Determine the device corresponding to the minimum value of the distance as the target device.
[0120] In this way, the distance between the device corresponding to the Bluetooth broadcast signal and the first electronic device can be accurately judged by combining the device information and signal strength in the Bluetooth broadcast signal, so as to determine a more accurate target device, and then improve the accuracy of the NFC working mode.
[0121] The data transmission device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0122] The data transmission device in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0123] The data transmission device provided by the embodiments of the present application can implement Figures 1 to 2 each process implemented by the method embodiments. To avoid repetition, it will not be elaborated here.
[0124] Optionally, as Figure 4 shown, the embodiments of the present application further provide an electronic device 400, including a processor 401 and a memory 402. A program or instruction that can run on the processor 401 is stored on the memory 402. When the program or instruction is executed by the processor 401, it implements each step of the above data transmission method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0125] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0126] Figure 5 is a schematic diagram of the hardware structure of the electronic device provided by the embodiments of the present application.
[0127] The electronic device 500 includes, but is not limited to, components such as a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, and a processor 510.
[0128] Those skilled in the art can understand that the electronic device 500 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 510 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 5 The structure of the electronic device shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0129] Among them, the radio frequency unit 501 is used to obtain N Bluetooth broadcast signals and the signal strength of each Bluetooth broadcast signal. The Bluetooth broadcast signal carries device information, and N is a positive integer.
[0130] The processor 510 can be used for:
[0131] When receiving a first input for a target file, obtain N Bluetooth broadcast signals, where N is a positive integer;
[0132] Determine the device type of the target device according to the N Bluetooth broadcast signals;
[0133] Control the near field communication (NFC) of the first electronic device to be in the working mode corresponding to the device type.
[0134] In this way, when the first electronic device wants to share a target file with other devices, it can determine the device type of the target device that may perform data transmission with the first electronic device based on the obtained Bluetooth broadcast signals, and then flexibly adjust the working mode of the NFC of the first electronic device according to the device type, so that the first electronic device can successfully sense and identify the target device, thereby establishing a communication channel for data transmission. Therefore, it can be compatible with different types of electronic devices to establish a communication channel for data transmission through NFC technology.
[0135] In some embodiments, the target device is the N devices corresponding to the N Bluetooth broadcast signals, and the processor 510 can also be used for:
[0136] When the device types of all N devices are of the first type, control the NFC of the first electronic device to be in a working mode that alternates between the card emulation mode and the read / write mode;
[0137] When the device types of the N devices include the second type, control the NFC of the first electronic device to be in the card emulation mode;
[0138] Among them, the first type of electronic device is an electronic device that requires the opposite end to be in the card emulation mode when performing NFC induction identification, or an electronic device with an operating mode that alternates between the card emulation mode and the read / write mode; the second type of electronic device is an electronic device that requires the opposite end to be in the card emulation mode when performing NFC induction identification.
[0139] In this way, the device types of all devices around the first electronic device can be determined at one time, so as to control the operating mode of the NFC of the first electronic device by considering the limiting conditions of NFC induction identification of all surrounding devices. While being able to be compatible with different types of electronic devices to establish a communication channel through NFC technology for data transmission, the number of device type detections is reduced, saving computing power resources.
[0140] In some embodiments, the Bluetooth broadcast signal includes device information and signal strength; the processor 510 can also be used for:
[0141] Determine the target device from the N devices corresponding to the N Bluetooth broadcast signals according to the signal strength;
[0142] Determine the device type of the target device according to the device information in the target Bluetooth broadcast signal corresponding to the target device.
[0143] In this way, the target device can be determined by considering the signal strength, and then the operating mode of the NFC of the first electronic device can be controlled according to the device type of the target device, improving the pertinence and accuracy of the NFC operating mode.
[0144] In some embodiments, the processor 510 can also be used for:
[0145] When the device type is the first type, control the NFC of the first electronic device to be in an operating mode that alternates between the card emulation mode and the read / write mode;
[0146] When the device type is the second type, control the NFC of the first electronic device to be in the card emulation mode;
[0147] Among them, the first type of electronic device is an electronic device that requires the opposite end to be in the card emulation mode when performing NFC induction identification, or an electronic device with an operating mode that alternates between the card emulation mode and the read / write mode; the second type of electronic device is an electronic device that requires the opposite end to be in the card emulation mode when performing NFC induction identification.
[0148] In this way, on the one hand, when the device type of the target device is the first type, the NFC of the first electronic device can be controlled to be in a working mode of alternating between card emulation mode and read / write mode, so that when there is a need for two-way data transmission between the first electronic device and the target device, two-way data transmission can be completed through a single close-range induction, reducing the number of data transmissions, simplifying the data transmission process, and effectively improving the data transmission efficiency. On the other hand, when the device type of the target device is the second type, the NFC of the first electronic device can be controlled to be in card emulation mode, so as to be able to be compatible with the second type of electronic device to establish a communication channel through NFC technology for data transmission.
[0149] In some embodiments, the processor 510 may further be configured to:
[0150] Determine the distances between the N devices and the first electronic device according to the device information and signal strengths in the N Bluetooth broadcast signals;
[0151] Determine the device corresponding to the minimum value of the distances as the target device.
[0152] In this way, the distances between the devices corresponding to the Bluetooth broadcast signals and the first electronic device can be accurately judged by combining the device information and signal strengths in the Bluetooth broadcast signals, so as to determine a more accurate target device, thereby improving the accuracy of the NFC working mode.
[0153] It should be understood that in the embodiments of the present application, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The graphics processing unit 5041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also referred to as a touch screen. The touch panel 5071 may include two parts: a touch detection device and a touch controller. The other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0154] The memory 509 can be used to store software programs and various data. The memory 509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 509 can include volatile memory or non-volatile memory, or the memory 509 can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 509 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0155] The processor 510 may include one or more processing units; optionally, the processor 510 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 510 either.
[0156] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above data transmission method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0157] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0158] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above data transmission method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0159] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0160] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above data transmission method embodiment, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0161] It should be noted that in this article, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without more limitations, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described method may be executed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0162] Through the description of the above embodiments, those skilled in the art can clearly understand that the above method of the embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0163] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: When receiving a first input for a target file, obtaining N Bluetooth broadcast signals, where N is a positive integer; Determine the device type of the target device according to the N Bluetooth broadcast signals; The near field communication NFC of the first electronic device is controlled to be in a working mode corresponding to the device type.
2. The method according to claim 1, characterized in that: The target devices are N devices corresponding to the N Bluetooth broadcast signals, and the near field communication NFC of the first electronic device is controlled to be in a working mode corresponding to the device type, including: When the device types of the N devices are all the first type, controlling the NFC of the first electronic device to be in a working mode that alternates between a card emulation mode and a read-write mode; When the device types of the N devices include the second type, controlling the NFC of the first electronic device to be in a card emulation mode; Among them, the first type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition, or an electronic device that alternates between card simulation mode and read-write mode; the second type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition.
3. The method according to claim 1, characterized in that The Bluetooth broadcast signal includes device information and signal strength; and determining the device type of the target device according to the N Bluetooth broadcast signals includes: Determining a target device from N devices corresponding to the N Bluetooth broadcast signals according to the signal strength; The device type of the target device is determined according to the device information in the target Bluetooth broadcast signal corresponding to the target device.
4. The method according to claim 3, characterized in that The controlling the near field communication NFC of the first electronic device to be in a working mode corresponding to the device type includes: When the device type is the first type, controlling the NFC of the first electronic device to be in a working mode that alternates between a card emulation mode and a read-write mode; When the device type is the second type, controlling the NFC of the first electronic device to be in the card emulation mode; Among them, the first type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition, or an electronic device that alternates between card simulation mode and read-write mode; the second type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition.
5. The method according to claim 3 or 4, characterized in that: The determining the target device from the N devices corresponding to the N Bluetooth broadcast signals according to the signal strength includes: Determine the distance between the N devices and the first electronic device according to the device information and the signal strength in the N Bluetooth broadcast signals; The device corresponding to the minimum value of the distance is determined as the target device.
6. A data transmission device, characterized in that: Applied to a first electronic device, the device comprises: An acquisition module, configured to acquire N Bluetooth broadcast signals upon receiving a first input for a target file, where N is a positive integer; A determination module, used to determine a device type of a target device according to the N Bluetooth broadcast signals; The control module is used to control the near field communication NFC of the first electronic device to be in a working mode corresponding to the device type.
7. The device according to claim 6, characterized in that The target devices are N devices corresponding to N Bluetooth broadcast signals, and the control module is further used for: When the device types of the N devices are all the first type, controlling the NFC of the first electronic device to be in a working mode that alternates between a card emulation mode and a read-write mode; When the device types of the N devices include the second type, controlling the NFC of the first electronic device to be in a card emulation mode; Among them, the first type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition, or an electronic device that alternates between card simulation mode and read-write mode; the second type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition.
8. The device according to claim 6, characterized in that The Bluetooth broadcast signal includes device information and signal strength; the determination module also includes: A first determining unit, configured to determine a target device from N devices corresponding to the N Bluetooth broadcast signals according to the signal strength; The second determining unit is used to determine the device type of the target device according to the device information in the target Bluetooth broadcast signal corresponding to the target device.
9. The device according to claim 8, characterized in that The control module is also used for: When the device type is the first type, controlling the NFC of the first electronic device to be in a working mode that alternates between a card emulation mode and a read-write mode; When the device type is the second type, controlling the NFC of the first electronic device to be in the card emulation mode; Among them, the first type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition, or an electronic device that alternates between card simulation mode and read-write mode; the second type of electronic device is an electronic device that requires the other end to be in card simulation mode when performing NFC induction recognition.
10. The device according to claim 8 or 9, characterized in that The first determining unit is further configured to: Determine the distance between the N devices and the first electronic device according to the device information and the signal strength in the N Bluetooth broadcast signals; The device corresponding to the minimum value of the distance is determined as the target device.
11. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
13. A computer program product, characterized in that The program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the method according to any one of claims 1 to 5.