DATA SENDING METHOD AND MOBILE DEVICE

A first interface of a first device displays a plurality of objects. The first device displays a second interface when detecting a first input for a first object in the plurality of objects. The second interface includes a plurality of options including a sharing option. The first device displays a third interface including a target display region when detecting a second input for the sharing option. The sharing target display region includes two types of display regions, a first type is for displaying a device identifier that maintains an infrared connection, and a second type is for displaying a device identifier that maintains a Bluetooth connection. The first device sends the first object to the second device when detecting a third input for the device identifier in the first type display regions. This can implement quick locating, and facilitate an operation.

TECHNICAL FIELD

This application relates to wireless transmission technologies, and in particular, to a data sending method and a mobile device.

BACKGROUND

A data sharing technology can enable a user to implement data sharing between different devices, and is widely applied. However, in an existing data sharing technology, a peripheral device is discovered based on a broadcast mechanism, and an identifier of the discovered peripheral device is displayed. After selecting a target device identifier, the user sends data to a target device. When there are a plurality of peripheral device identifiers and one interface cannot display all the identifiers, the user needs to browse the identifiers one by one for searching. In addition, when the peripheral device identifiers include a plurality of device identifiers that are the same as or similar to the target device identifier, the user needs to spend much time and energy and even needs other assistance information to locate the target device. Therefore, a data sending method needs to be provided for conveniently locating a target device.

SUMMARY

To address the foregoing technical problem in the conventional technology, this application provides a data sending method and a mobile device for conveniently locating a target device.

According to a first aspect, a data sending method is provided. The method is applied to a first device, and includes: The first device enables a sharing function. The first device establishes a wireless connection to a second device at least through infrared. The first device establishes a wireless connection to a third device at least through Bluetooth. A plurality of objects are displayed on a first interface of the first device. The object includes at least one of a document, a photo, a folder, a video file, an audio file, an application, and text content. The first device displays a second interface when detecting a first input for a first object in the plurality of objects. The second interface includes a mark indicating that the first object is selected and a plurality of options that include at least a sharing option. The first device displays a third interface when detecting a second input for the sharing option. The third interface includes a sharing target display region, the sharing target display region includes two types of display region, a first type display region is used to display a device identifier that maintains an infrared connection to the first device, and a second type display region is used to display a device identifier that maintains a Bluetooth connection to the first device. The first device sends the first object to the second device when the first device detects a third input for a first device identifier in the first type display region. In this way, when a user of the first device expects to send data of the first device to the second device near the first device, the user only needs to make the first device which has enabled the sharing function face towards the second device. A second device identifier is displayed in the first type display region, implying that the second device has enabled a sharing function. Because the display manner of the first type display region is different from the display manner of the second type display region, the user of the first device can quickly distinguish and identify the second device identifier on the third interface of the first device, so as to conveniently send the data from the first device to the second device. The user of the first device can perform quick locating without one-by-one browsing for searching. This facilitates a user operation of the first device, improves user experience, and does not affect data sending from the first device to the third device.

According to the first aspect, that the first device sends the first object to the second device includes: The first device sends the first object to the second device through Wi-Fi. In this way, the first device can quickly send the first object to the second device.

According to the first aspect or any implementation of the first aspect, a display manner of the first type display region is different from a display manner of the second type display region, and an area of the second type display region is greater than an area of the first type display region. In this way, the user of the first device can quickly identify the first type display region, so as to quickly identify a device identifier displayed in the first type display region, thereby facilitating subsequent data sending.

According to the first aspect or any implementation of the first aspect, after the first device rotates by a specific angle, the first device faces towards the third device, content in the first type display region is updated, and content in the second type display region is updated; and the first device establishes a wireless connection to the third device through infrared, and the first device establishes a wireless connection to the second device through Bluetooth. In this way, by using a directional feature of infrared, when an orientation of the first device changes, the first type display region and the second type display region are correspondingly updated, so that the user of the first device can conveniently and quickly locate, by adjusting the orientation of the first device, a device to which the data is expected to be sent.

According to the first aspect or any implementation of the first aspect, that content in the first type display region is updated, and content in the second type display region is updated includes: The first type display region displays an identifier of the third device but does not display an identifier of the second device; and the second type display region displays the identifier of the second device. In this way, after the orientation of the first device changes, it is determined that the first type display region and the second type display region correspondingly change.

According to the first aspect or any implementation of the first aspect, after the first device rotates by a specific angle, the first device faces towards the third device, content in the first type display region is updated, and content in the second type display region remains unchanged; and the first device establishes a wireless connection to the third device through infrared, and the first device separately maintains a wireless connection to the second device and the third device through Bluetooth. In this way, when the orientation of the first device changes, the content in the second type display region remains unchanged, and only the content in the first type display region is updated. The user of the first device can conveniently and quickly identify, through the updated first type display region, a device identifier displayed in the updated first type display region, thereby facilitating subsequent data sending.

According to the first aspect or any implementation of the first aspect, that content in the first type display region is updated, and content in the second type display region remains unchanged includes: The first type display region displays an identifier of the third device but does not display an identifier of the second device; and the second type display region displays the identifier of the second device and the identifier of the third device. In this way, after the orientation of the first device changes, it is determined that the content in the first type display region correspondingly changes, and the content in the second type display region does not change.

According to the first aspect or any implementation of the first aspect, after the first device rotates by a specific angle, the first device does not face towards any device, content in the first type display region is updated, and content in the second type display region remains unchanged; and the first device separately maintains a wireless connection to the second device and the third device through Bluetooth. In this way, the user of the first device can conveniently and quickly obtain, through the updated first type display region, information indicating whether the first device can establish or maintain a wireless connection to any device through infrared.

According to the first aspect or any implementation of the first aspect, that content in the first type display region is updated, and content in the second type display region remains unchanged includes: The first type display region does not display an identifier of any device; and the second type display region displays an identifier of the second device and an identifier of the third device. In this way, the user of the first device can conveniently and quickly learn, through the updated first type display region, that the first device cannot establish or maintain a wireless connection to any device through infrared in the current orientation of the first device.

According to the first aspect or any implementation of the first aspect, a location of the first type display region on the third interface is fixed; and a location of the second type display region on the third interface is fixed. In this way, it is convenient for the user of the first device to perform viewing and locating.

According to the first aspect or any implementation of the first aspect, after the first device enables the sharing function, the first device automatically enables infrared, Bluetooth, and Wi-Fi. In this way, it is further determined that infrared, Bluetooth, and Wi-Fi are automatically enabled when the sharing function is enabled, so that a relationship between the sharing function, infrared, Bluetooth, and Wi-Fi is determined.

According to a second aspect, a data sending method is provided. The method is applied to a first device, a second device, and a third device, and includes: The first device, the second device, and the third device each enable a sharing function. The first device establishes a wireless connection to the second device at least through infrared. The first device establishes a wireless connection to the third device at least through Bluetooth. A plurality of objects are displayed on a first interface of the first device. The object includes at least one of a document, a photo, a folder, a video file, an audio file, an application, and text content. The first device displays a second interface when detecting a first input for a first object in the plurality of objects. The second interface includes a mark indicating that the first object is selected and a plurality of options that include at least a sharing option. The first device displays a third interface when detecting a second input for the sharing option. The third interface includes a sharing target display region, the sharing target display region includes two types of display regions, a first type display region is used to display a device identifier that maintains an infrared connection to the first device, and a second type display region is used to display a device identifier that maintains a Bluetooth connection to the first device. The first device sends the first object to the second device when the first device detects a third input for a first device identifier in the first type display region. An interface of the second device displays a first option and a second option. The first option is used to indicate to agree to receive sharing, and the second option is used to indicate to disagree to receive sharing. After the second device detects an input for the first option, the second device receives the first object. In this way, when a user of the first device expects to send data of the first device to the second device near the first device, the user only needs to make the first device which has enabled the sharing function face towards the second device. Because the display manner of the first type display region is different from the display manner of the second type display region, the user of the first device can quickly distinguish and identify a second device identifier on the third interface of the first device, so as to conveniently send the data from the first device to the second device. The user of the first device can perform quick locating without one-by-one browsing for searching. This facilitates a user operation of the first device, improves user experience, and does not affect data sending from the first device to the third device.

According to the second aspect, that the first device sends the first object to the second device includes: The first device sends the first object to the second device through Wi-Fi. In this way, the first device can quickly send the first object to the second device.

According to the second aspect or any implementation of the second aspect, a display manner of the first type display region is different from a display manner of the second type display region, and an area of the second type display region is greater than an area of the first type display region. In this way, the user of the first device can quickly identify the first type display region, so as to quickly identify a device identifier displayed in the first type display region, thereby facilitating subsequent data sending.

According to the second aspect or any implementation of the second aspect, after the first device rotates by a specific angle, the first device faces towards the third device, content in the first type display region is updated, and content in the second type display region is updated; and the first device establishes a wireless connection to the third device through infrared, and the first device establishes a wireless connection to the second device through Bluetooth. In this way, by using a directional feature of infrared, when an orientation of the first device changes, the first type display region and the second type display region are correspondingly updated, so that the user of the first device can conveniently and quickly locate, by adjusting the orientation of the first device, a device to which the data is expected to be sent.

According to the second aspect or any implementation of the second aspect, that content in the first type display region is updated, and content in the second type display region is updated includes: The first type display region displays an identifier of the third device but does not display an identifier of the second device; and the second type display region displays the identifier of the second device.

According to the second aspect or any implementation of the second aspect, after the first device rotates by a specific angle, the first device faces towards the third device, content in the first type display region is updated, and content in the second type display region remains unchanged; and the first device establishes a wireless connection to the third device through infrared, and the first device separately maintains a wireless connection to the second device and the third device through Bluetooth. In this way, the user of the first device can conveniently and quickly identify, through the updated first type display region, a device identifier displayed in the updated first type display region, thereby facilitating subsequent data sending.

According to the second aspect or any implementation of the second aspect, that content in the first type display region is updated, and content in the second type display region remains unchanged includes: The first type display region displays an identifier of the third device but does not display an identifier of the second device; and the second type display region displays the identifier of the second device and the identifier of the third device. In this way, after the orientation of the first device changes, it is determined that the first type display region and the second type display region correspondingly change.

According to the second aspect or any implementation of the second aspect, after the first device rotates by a specific angle, the first device does not face towards any device, content in the first type display region is updated, and content in the second type display region remains unchanged; and the first device separately maintains a wireless connection to the second device and the third device through Bluetooth. In this way, the user of the first device can conveniently and quickly obtain, through the updated first type display region, information indicating whether the first device can establish or maintain a wireless connection to any device through infrared.

According to the second aspect or any implementation of the second aspect, that content in the first type display region is updated, and content in the second type display region remains unchanged includes: The first type display region does not display an identifier of any device; and the second type display region displays an identifier of the second device and an identifier of the third device. In this way, the user of the first device can conveniently and quickly learn, through the updated first type display region, that the first device cannot establish or maintain a wireless connection to any device through infrared in the current orientation of the first device.

According to the second aspect or any implementation of the second aspect, a location of the first type display region on the third interface is fixed; and a location of the second type display region on the third interface is fixed. In this way, it is convenient for the user of the first device to perform viewing and locating.

According to the second aspect or any implementation of the second aspect, after the first device enables the sharing function, the first device automatically enables infrared, Bluetooth, and Wi-Fi. In this way, a relationship between the sharing function, infrared, Bluetooth, and Wi-Fi is further determined.

According to a third aspect, a mobile device is provided, including at least a memory, a touchscreen, one or more processors, and one or more computer programs. The one or more computer programs are stored in the memory, and when the one or more processors execute the one or more computer programs, the mobile device is enabled to implement the data sending method according to any one of the first aspect and the implementations of the first aspect or according to any one of the second aspect and the implementations of the second aspect.

In addition, for implementations of the third aspect and corresponding technical effects, refer to the implementations of the first aspect and the corresponding technical effects or the implementations of the second aspect and the corresponding technical effects. Details are not described herein again.

According to a fourth aspect, a computer-readable storage medium is provided, including instructions. When the instructions are run on the mobile device according to the third aspect, the mobile device is enabled to perform the data sending method according to any one of the first aspect and the implementations of the first aspect or according to any one of the second aspect and the implementations of the second aspect.

In addition, for implementations of the fourth aspect and corresponding technical effects, refer to the implementations of the first aspect and the corresponding technical effects or the implementations of the second aspect and the corresponding technical effects. Details are not described herein again.

The sharing function in any one of the first aspect, the second aspect, the third aspect, the fourth aspect, and the implementations thereof means first establishing a connection through infrared and/or Bluetooth, transmitting a Wi-Fi connection parameter through the infrared and/or Bluetooth connection, and then quickly transmitting data based on an established Wi-Fi connection. The sharing function may also be referred to as a moment sharing function or a quick sharing function.

DESCRIPTION OF EMBODIMENTS

The following clearly describes the technical solutions in embodiments of the present disclosure with reference to the accompanying drawings. It is clear that the described embodiments are merely some rather than all of embodiments of this application. All other embodiments obtained by persons of ordinary skill in the art based on embodiments of this application without creative efforts shall fall within the protection scope of the present disclosure.

Terms used in the following embodiments of this application are only intended to describe particular embodiments, and are not intended to limit this application. Terms “one”, “a”, “the”, “the foregoing”, “this”, and “the one” of singular forms used in this specification and the appended claims of this application are also intended to include plural forms, unless otherwise specified in the context clearly. It should be further understood that, a term “and/or” used in this application indicates and includes any one or all of possible combinations of one or more listed items. In this application, “establishing a wireless connection through infrared” and “establishing a wireless connection through Bluetooth” respectively mean establishing a wireless connection through an infrared standard and establishing a wireless connection through a Bluetooth standard.

The following describes a mobile device, a user interface used for the mobile device, and embodiments for using the mobile device. In some embodiments, the mobile device may be a portable mobile device further including another function such as a personal digital assistant and/or a music player function, for example, a mobile phone, a tablet computer, or a wearable mobile device (such as a smartwatch or a smart band) having a wireless communication function. An example embodiment of the portable mobile device includes but is not limited to a portable mobile device running on iOS®, Android®, Microsoft®, or another operating system. The portable mobile device may alternatively be another portable mobile device, for example, a laptop having a touch-sensitive surface or a touch panel. It should be further understood that, in some other embodiments, the mobile device may alternatively not be a portable mobile device, but a desktop computer having a touch-sensitive surface or a touch panel.

A term “user interface (UI)” in this specification, the claims, and the accompanying drawings of this application is a medium interface for interaction and information exchange between a user and an application or an operating system, and the interface implements conversion between an internal form of information and a form that can be accepted by the user. A user interface of an application is source code written in a specific computer language such as Java or an extensible markup language (XML). The interface source code is parsed and rendered on the mobile device, and is finally presented as content that can be identified by the user, for example, a control such as a photo, a text, or a button. A control is also referred to as a widget, and is a basic element of a user interface. Typical controls include a toolbar, a menu bar, a text box, a button, a scrollbar, a photo, and a text. An attribute and content of a control on an interface are defined by using a tag or a node. For example, XML defines a control on the interface by using a node such as <Textview>, <ImgView>, or <VideoView>. One node corresponds to one control or attribute on the interface. After being parsed and rendered, the node is presented as user-visible content. In addition, interfaces of a plurality of applications such as a hybrid application usually further include a web page. The web page, also referred to as a page, may be understood as a special control that is embedded in an interface of an application. The web page is source code written in a specific computer language, for example, a hypertext markup language (HTML), cascading style sheets (CSS), or JavaScript (JS). A browser or a web page display component whose function is similar to that of a browser may load and display the web page source code as content that can be identified by the user. Specific content included in the web page is also defined by using a tag or a node in the web page source code. For example, HTML defines an element and an attribute of the web page by using <p>, <img>, <video>, or <canvas>.

The user interface is usually represented in a form of a graphical user interface (GUI), and is a user interface that is related to a computer operation and that is displayed in a graphic manner. The user interface may be an interface element displayed on a display of the mobile device such as an icon, a window, or a control. The control may include a visual interface element such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, or a widget.

In the following embodiments of this application, “Moment Share (Moment Share)” of the mobile device such as a smartphone may be a service or a function provided by the mobile device, and may support the mobile device in transmitting data to another device. In some embodiments, “Moment Share” may support the mobile device in transmitting data to a nearby device by using one or more technologies such as Bluetooth, infrared, wireless fidelity direct (Wi-Fi direct), and a Wi-Fi software access point (SoftAP). In some other embodiments, “Moment Share” may support the mobile device in transmitting, through a local area network (LAN), data to a device (for example, another mobile device) that is located in a same local area network as the mobile device. In some embodiments of this application, a device that is located in a same local area network as the mobile device may alternatively be a device near the mobile device. In some embodiments, “Moment Share” may support the mobile device in transmitting, by using a wide area network (WAN) technology or a cellular mobile communications technology such as 3G, LTE, or 5G, data to a cloud device that can be accessed by the mobile device. It may be understood that the nearby device and the cloud device are merely relative concepts. The cloud device is a device discovered by the mobile device by using a cellular mobile communications technology or a wide area network communications technology. The nearby device is a device discovered by the mobile device by using one or more technologies such as Bluetooth, infrared, Wi-Fi direct (such as Wi-Fi P2P), Wi-Fi SoftAP, and Wi-Fi LAN.

In this application, enabling “Moment Share” may include enabling one or more of a Bluetooth module, an infrared module, a Wi-Fi module, and a mobile communications module of the mobile device. In some embodiments, after enabling the foregoing function, the mobile device may discover a device near the mobile device by using one or more technologies such as Bluetooth, infrared, Wi-Fi direct (such as Wi-Fi P2P), Wi-Fi SoftAP, and Wi-Fi LAN.

It may be understood that “Moment Share” or “Moment Share” is merely a word used in embodiments, a meaning has been recorded in embodiments, and an identifier does not constitute any limitation on embodiments. In addition, in some other embodiments of this application, “Moment Share” may also be referred to as another noun such as “Short-distance Share”. Similarly, “Moment Share” mentioned in embodiments of this application may also be referred to as another name such as “Shoot Share” in some other embodiments.

A method provided in embodiments of this application is applicable to a mobile device100shown inFIG.1.FIG.1is a schematic diagram of a structure of the mobile device100.

It may be understood that the structure shown in embodiments of the present application does not constitute a specific limitation on the mobile device100. In some other embodiments of this application, the mobile device100may include more or fewer components than those shown in the figure, or combine some components, or split some components, or have different component arrangements. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.

The controller may generate an operation control signal based on instruction operation code and a time sequence signal, to control instruction fetching and instruction execution.

The charging management module140is configured to receive a charging input from a charger. The power management module141is configured to connect the battery142and the charging management module140to the processor110. A wireless communication function of the mobile device100may be implemented through the antenna1, the antenna2, the mobile communications module150, the wireless communications module160, the modem processor, the baseband processor, and the like.

The mobile communications module150can provide a solution, applied to the mobile device100, to wireless communication including 2G, 3G, 4G, 5G, and the like. The mobile communications module150may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communications module150may receive an electromagnetic wave through the antenna1, perform processing such as filtering or amplification on the received electromagnetic wave, and transmit a processed electromagnetic wave to the modem processor for demodulation. The mobile communications module150may further amplify a signal modulated by the modem processor, and convert an amplified signal into an electromagnetic wave for radiation through the antenna1. In some embodiments, at least some function modules in the mobile communications module150may be disposed in the processor110. In some embodiments, at least some function modules in the mobile communications module150may be disposed in a same device as at least some modules in the processor110.

The wireless communications module160may provide a solution, applied to the mobile device100, to wireless communication including a wireless local area network (WLAN) (for example, a wireless fidelity (Wi-Fi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), a near field communication ( ) technology, an infrared (IR) technology, and the like. The wireless communications module160may be one or more components integrating at least one communications processing module. The wireless communications module160receives an electromagnetic wave through the antenna2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and sends a processed signal to the processor110. The wireless communications module160may further receive a to-be-sent signal from the processor110, perform frequency modulation and amplification on the signal, and convert a processed signal into an electromagnetic wave for radiation through the antenna2.

In some embodiments, in the mobile device100, the antenna1and the mobile communications module150are coupled, and the antenna2and the wireless communications module160are coupled, so that the mobile device100can communicate with a network and another device by using a wireless communications technology. The wireless communications technology may include a global system for mobile communications (GSM), a general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division-synchronous code division multiple access (TD-SCDMA), long term evolution (LTE), BT, a GNSS, Wi-Fi, NFC, FM, an IR technology, and/or the like. 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).

The internal memory121may be configured to store computer-executable program code, and the executable program code includes instructions. The internal memory121may include a program storage area and a data storage area. The program storage area may store an operating system, an application required by at least one function (for example, a sound playing function or an image playing function), and the like. The data storage area may store data (for example, audio data and a phone book) and the like created when the mobile device100is used. In addition, the internal memory121may include a high-speed random access memory, or may include a nonvolatile memory such as at least one disk storage device, a flash memory, or a universal flash storage (UFS). The processor110runs the instructions stored in the internal memory121and/or the instructions stored in the memory disposed in the processor, to perform various function applications of the mobile device100and data processing.

The mobile device100may implement an audio function such as music playing or recording by using the audio module170, the speaker170A, the receiver170B, the microphone170C, the headset jack170D, the application processor, and the like.

The pressure sensor180A is configured to sense a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor180A may be disposed on the display194. There are many types of pressure sensors180A, for example, a resistive pressure sensor, an inductive pressure sensor, and a capacitive pressure sensor. The capacitive pressure sensor may include at least two parallel plates made of conductive materials. When force is applied to the pressure sensor180A, capacitance between electrodes changes. The mobile device100determines pressure strength based on the change of the capacitance. When a touch operation is performed on the display194, the mobile device100detects strength of the touch operation by using the pressure sensor180A. The mobile device100may also calculate a touch location based on a detection signal of the pressure sensor180A. In some embodiments, touch operations that are performed at a same touch location but have different touch operation strength may correspond to different operation instructions. For example, when a touch operation whose touch operation strength is less than a first pressure threshold is performed on an icon of Messages, an instruction for viewing an SMS message is performed. When a touch operation whose touch operation strength is greater than or equal to the first pressure threshold is performed on the icon of Messages, an instruction for creating a new SMS message is performed.

FIG.2atoFIG.2fshow user interfaces displayed when a mobile device quickly shares data. An example of quickly sharing a photo is used below for description. On a user interface shown inFIG.2a, when detecting a gesture of sliding downward from the top of the mobile device, in response to the gesture, the mobile device switches from the user interface shown inFIG.2ato a user interface shown inFIG.2b. As shown inFIG.2b, in an initial state, a “Moment Share” control is in an off state. When detecting an operation on the “Moment Share” control inFIG.2b(for example, a touch operation on the “Moment Share” control), in response to the operation, the mobile device enables “Moment Share”. A manner of enabling “Moment Share” is not limited to the foregoing manner. Alternatively, a user may enable “Moment Share” when selecting data (such as a photo, a document, or a web page) for sharing. Details are not described herein again. In some embodiments, a dialog box pops up before “Moment Share” is enabled, to notify whether to agree to enable both Bluetooth and Wi-Fi for enabling “Moment Share”. If yes, “Moment Share” is enabled. If no, “Moment Share” is not enabled. In some embodiments, no dialog box pops up before “Moment Share” is enabled. In other words, the user is not queried whether to agree to enable both Bluetooth and Wi-Fi. When it is detected that “Moment Share” is enabled, Bluetooth and Wi-Fi are automatically enabled. Then, on a user interface shown inFIG.2c, when detecting an operation on a “Gallery” icon (for example, a tap operation on the “Gallery” icon), the mobile device enters a user interface shown inFIG.2d. When it is detected that a photo on the user interface shown inFIG.2dis selected, a black square embedded with a tick mark is displayed on a lower right corner of the selected photo, and a control bar including a “Share” control is displayed below all photos. In this case, an interface is shown inFIG.2e. As shown inFIG.2e, it is detected that two photos are selected. Then, after detecting an operation on the “Share” control (for example, a touch operation on the “Share” control), the mobile device enters a user interface shown inFIG.2f. On the user interface shown inFIG.2f, a peripheral device identifier discovered through “Moment Share” is displayed. On the user interface shown inFIG.2f, when it is detected that a peripheral device identifier is selected, and acceptance is detected on a user interface of the peripheral device (not shown inFIG.2atoFIG.20, the two photos are sent to a selected peripheral device.

However, in this process, when there are a plurality of peripheral device identifiers and one interface cannot display all the peripheral device identifiers, the user needs to browse the peripheral device identifiers one by one to search for a target device. This occupies a large amount of energy of the user, brings inconvenience to the user, and causes poor user experience. In addition, if the plurality of peripheral device identifiers are the same or similar, the user cannot or cannot easily accurately determine the target device from a plurality of peripheral devices with the same or similar identifiers based on only an identifier of the mobile device. For example, the peripheral devices include HUAWEI Mate 30 of A, HUAWEI Mate 30 of B, HUAWEI Mate 20 of C, HUAWEI Mate 20 of D, and HUAWEI Mate 30 of E, and the target device is HUAWEI Mate 30 of A. On the user interface shown inFIG.2f, the peripheral device identifiers include three same identifiers “HUAWEI Mate 30” and two same identifiers “HUAWEI Mate 20”. The user needs to spend much time and energy and even needs other assistance information to accurately identify the target device and send data to the target device, for example, needs to first disable “Moment Share” of HUAWEI Mate 30 of B and E or first modify the device identifier of HUAWEI Mate 30 of A. In addition, because the identifiers of HUAWEI Mate 20 and HUAWEI Mate 30 are similar, the user is likely to confuse HUAWEI Mate 20 with HUAWEI Mate 30, and mistakes HUAWEI Mate 20 of C and D for HUAWEI Mate 30 of A. Consequently, a sharing error and information leakage are caused. In addition, even if the user modifies a device identifier, a device identifier obtained through modification by the user may also be the same as or similar to an identifier of the target device, and the user cannot accurately identify the target device.

Consequently, much time and energy of the user are consumed, the target device is likely to be confused, an information leakage risk is relatively high, a user operation is inconvenient, and experience is relatively poor. An embodiment of this application provides a data sending method for conveniently locating a target device, so that the target device is not likely to be confused, an information leakage risk is greatly reduced, a user operation is convenient, and experience is relatively good.

FIG.3is a schematic diagram of a scenario of a data sending method for conveniently locating a target device according to an embodiment of this application. As shown inFIG.3, a user301holds a first device310, there are users302,303,304,305, and306around the user301, and the users302,303,304,305, and306respectively hold devices320,330,340,350, and360. The devices320,330,340,350, and360may be differently classified. For example, the devices320and330are second devices, and the devices340,350, and360are third devices; or the devices320,330, and340are second devices, and the devices350and360are third devices. For simplicity, an example in which the device320is a second device and the devices330,340,350, and360are third devices is used below for description. In other words, peripheral devices of the first device310include the second device320and the third devices330,340,350, and360. There is no obstruction between the first device310and the second device320, and between the first device310and any one of the third devices330,340,350, and360. The first device310, the second device320, and the third devices330,340,350, and360each may implement a “Moment Share” function. The user301sends data on the first device310to any one of the second device320and the third devices330,340,350, and360by using the first device310. All the first device310, the second device320, and the third devices330,340,350, and360enable “Moment Share”. The first device310discovers the second device320and the third devices330,340,350, and360through “Moment Share”. The user301selects the data on the first device310by performing a touch operation on a touchscreen of the first device310. In response to the foregoing operation, the user301selects an identifier of the second device320on the first device310, and the user302accepts or agrees with the touch operation on the second device320. In this way, the data on the first device310is quickly sent to the second device320. The foregoing touch operation is merely an example, and there may alternatively be another operation, for example, a corresponding operation performed through a voice input.

FIG.4atoFIG.4fshow user interfaces of a data sending method for conveniently locating a target device according to an embodiment of this application. For ease of description, an example in which the first device310, the second device320, and the third devices330,340,350, and360are respectively HUAWEI Mate 30, HUAWEI Mate 30, HUAWEI Mate 20, HUAWEI Mate 20, HUAWEI Mate 30, and HUAWEI Mate 30 and the first device quickly sends a photo on the first device to the second device is used. In this case, the first device310, the second device320, and the third devices330,340,350, and360each are provided with infrared, and each can enable a “Moment Share” function. In embodiments of this application, infrared is enabled when “Moment Share” is enabled, and infrared is disabled when “Moment Share” is disabled. In some embodiments, a dialog box pops up before “Moment Share” is enabled, to notify whether to agree to enable all of infrared, Bluetooth, and Wi-Fi for enabling “Moment Share”. If yes, “Moment Share” is enabled. If no, “Moment Share” is not enabled. In some embodiments, no dialog box pops up before “Moment Share” is enabled. In other words, the user is not queried whether to agree to enable all of infrared, Bluetooth, and Wi-Fi. When it is detected that “Moment Share” is enabled, infrared, Bluetooth, and Wi-Fi are automatically enabled. There is no obstruction between the first device310and the second device320, and between the first device310and any one of the third devices330,340,350, and360. The following describes detailed steps in an embodiment of this application in detail with reference toFIG.4atoFIG.4f.

First, the first device310, the second device320, and the third devices330,340,350, and360each enable the “Moment Share” function. Then, on a user interface shown inFIG.4a, when a gesture of sliding downward from the top of the first device310is detected, in response to the gesture, a user interface of the first device310is switched from the user interface shown inFIG.4ato a user interface shown inFIG.4b. As shown inFIG.4b, in an initial state, a “Moment Share” control is in an off state. When detecting an operation on the “Moment Share” control inFIG.4b(for example, a touch operation on the “Moment Share” control), in response to the operation, the first device310enables “Moment Share”. “Moment Share” may alternatively be enabled in another manner. For example, the user may enable “Moment Share” when selecting data (such as a photo, a document, or a web page) for sharing. Details are not described herein again. Then, on a user interface shown inFIG.4c, when detecting an operation on a “Gallery” icon (for example, a tap operation on the “Gallery” icon), the first device enters a user interface shown inFIG.4d. When it is detected that a photo on the user interface shown inFIG.4dis selected, a black square embedded with a tick mark is displayed on a lower right corner of the selected photo, and a control bar including a “Share” control is displayed below all photos. In this case, an interface is shown inFIG.4e. As shown inFIG.4e, it is detected that two photos are selected. Then, after detecting an operation on the “Share” control (for example, a touch operation on the “Share” control), the first device enters a user interface shown inFIG.4fOn the user interface shown inFIG.4f, a second device identifier and third device identifiers are displayed. Specifically, the second device identifier and the third device identifiers are displayed in a first region401and a second region402. The first region401displays a device identifier discovered by the first device310through infrared, and the second region402displays a device identifier discovered by the first device310through Bluetooth. Optionally, the first region401further displays a word “Infrared” and/or a corresponding icon for identification; and the second region402displays a word “Bluetooth” and/or a corresponding icon for identification. Optionally, “Infrared” may alternatively be another word or an abbreviation such as “IF”; and “Bluetooth” may alternatively be another word or an abbreviation such as “BT”. Optionally, “Infrared” is located at a specific location in the first region; and “Bluetooth” is located at a specific location in the second region. Optionally, a separation line may be disposed between the first region401and the second region402. The separation line may be a line type such as a dashed line, a solid line, a dash-dot line, or a dash-dot-dot line. The line type is any line type that can be figured out by persons skilled in the art. Alternatively, the first region401and the second region402may be respectively a first location and a second location. In other words, there is a first location on a first interface of the first device for displaying a device identifier discovered by the first device through infrared; and there is a second location on the first interface of the first device for displaying a device identifier discovered by the first device through Bluetooth. The first location and the second location may be or may not be adjacent. The device identifier discovered by the first device310through infrared is a target device identifier. There is at least one target device identifier. Preferably, there is one target device identifier. Certainly, the two regions may alternatively be identified for the user in another manner. For example, at least one of a font type, a font color, a pattern color, a background color, and a font weight of the target device identifier displayed in the first region401is different from at least one of a font type, a font color, a pattern color, a background color, and a font weight of a non-target device identifier. In other words, after all the first device, the second device, and the third devices enable “Moment Share”, two manners of performing discovering through infrared and performing discovering through Bluetooth are further distinguished in “Moment Share”; and a manner of displaying the device identifier discovered by the first device through infrared is different from a manner of displaying the device identifier discovered by the first device through Bluetooth. It should be noted that “Moment Share” is a function implemented by using an application. The two discovery manners of performing discovering through Bluetooth and performing discovering through infrared that are included in “Moment Share” are not simply establishing a connection through only infrared or Bluetooth when “Moment Share” is not enabled, but are performing further subdivision based on specific discovery in “Moment Share” on a premise of “Moment Share” discovery.

Alternatively, the first region401does not display a device identifier, or displays only one device identifier, or displays a plurality of device identifiers. Preferably, the first region401does not display a device identifier, or displays only one device identifier. Specifically, within a specific angle range of an orientation of the first device310, if no device exists, the first region401is empty and displays no device identifier, and the second region402displays the identifiers of the second device320and the third devices330,340,350, and360. For example, inFIG.4f, because a width of the second region402is limited, only three device identifiers can be displayed at the same time. The foregoing three device identifiers are merely examples for description, and are not used to limit a quantity of device identifiers that can be displayed in the second region. In this case, another device identifier may be displayed by touching a left arrow control and a right arrow control disposed on two sides of the second region402. In addition, within the specific angle range of the orientation of the first device310, if the second device320exists, the first region401displays the identifier of the second device320, and the second region402displays the identifiers of the third devices330,340,350, and360; or the second region402displays all the identifiers of the second device320and the third devices330,340,350, and360. In addition, within the specific angle range of the orientation of the first device310, if there are more than two devices, in some embodiments, the first region401displays more than two of the foregoing device identifiers, and the second region402displays the other device identifies; or the second region402displays all the device identifiers. In some embodiments, the first region401displays an identifier of a device that is closest to the first device310in more than two of the foregoing devices, or the first region401displays an identifier of a device with a strongest infrared feedback signal that is received by the first device310; and the second region402displays the other device identifiers, or the second region402displays all the device identifiers. Optionally, within the specific angle range of the orientation of the first device310, if no device exists, the first region401may further display “None”, or a synonym of “None”, or another national language text corresponding to “None”.

Further description is provided with reference toFIG.3andFIG.5atoFIG.5c. When the first device310is located at a location {circle around (1)} inFIG.3, a user interface of the first device310is shown inFIG.5a. When the first device310is located at a location {circle around (2)} inFIG.3, a user interface of the first device310is shown inFIG.5b. When the first device310is located at a location {circle around (3)} inFIG.3, a user interface of the first device310is shown inFIG.5c. When the first device310is located at the location {circle around (1)} inFIG.3, an orientation of the first device310is a first direction. The second device320is located in the first direction. The third devices330,340,350, and360are located in another direction. Because infrared has a directional feature, the identifier “HUAWEI Mate 30” of the second device320is displayed in a first region501inFIG.5a, and the identifier “HUAWEI Mate 20” of the third device330, the identifier “HUAWEI Mate 20” of the third device340, and the identifier “HUAWEI Mate 30” of the third device350are displayed in a second region502inFIG.5a. Because a width of the second region502is limited, the identifier of the third device360is not displayed in the second region502. The identifier “HUAWEI Mate 30” of the third device360may be displayed by touching a left arrow control and a right arrow control that are disposed on two sides of the second region. When the first device310is located at the location {circle around (2)} inFIG.3, an orientation of the first device310is a second direction. The third device330is located in the second direction. The second device320and the third devices340,350, and360are located in another direction. Similarly, the identifier “HUAWEI Mate 20” of the third device330is displayed in a first region503inFIG.5b, and the identifier “HUAWEI Mate 30” of the second device320, the identifier “HUAWEI Mate 20” of the third device340, and the identifier “HUAWEI Mate 30” of the third device350are displayed in a second region504inFIG.5b. Because a width of the second region504is limited, the identifier of the third device360is not displayed in the second region504. The identifier “HUAWEI Mate 30” of the third device360may be displayed by touching a left arrow control and a right arrow control that are disposed on two sides of the second region. When the first device310is located at the location {circle around (3)} inFIG.3, an orientation of the first device310is a third direction. The third device350is located in the third direction. The second device320and the third devices330,340, and360are located in another direction. Similarly, the identifier “HUAWEI Mate 30” of the third device350is displayed in a first region505inFIG.5c, and the identifier “HUAWEI Mate 30” of the third device360, the identifier “HUAWEI Mate 30” of the second device320, and the identifier “HUAWEI Mate 20” of the third device330are displayed in a second region506inFIG.5c. Because a width of the second region506is limited, the identifier of the third device340is not displayed in the second region506. The identifier “HUAWEI Mate 20” of the third device340may be displayed by touching a left arrow control and a right arrow control that are disposed on two sides of the second region. In this way, after the first device310enables “Moment Share”, when the user301needs to send data to a specific user, the user only needs to make the first device310face towards a device of the specific user, so that an identifier of the device of the specific user is displayed in the first region of the first device310, and the user301can quickly determine the target device, thereby implementing quick data sending. In the technical solution provided in embodiments of this application, the target device is not confused when device identifiers are the same or similar, thereby facilitating an operation and improving user experience.

The photos in “Gallery” are merely examples, and do not limit the scope of embodiments of this application. For example, a scenario in which the user301sends a photo may further include that the user301sends a photo in an application such as “Browser”. In addition, the foregoing photo is merely an example of a type of data. Other data types such as a video, audio, a document, and a compressed package that can be figured out by persons skilled in the art may be data types for sending.

FIG.6is a schematic diagram of a software architecture of a data sending method according to an embodiment of this application. As shown inFIG.6, the method runs at an application layer. A lower layer of the application layer is a system software layer. A lower layer of the system software layer is a hardware layer. The system software layer includes an application framework layer, a system service layer, and a kernel layer. The application layer transmits data and/or a command to or receives data and/or a command from the hardware layer through the application framework layer, the system service layer, and the kernel layer. A hardware driver is integrated into the kernel layer.

FIG.7aandFIG.7bare a schematic flowchart of a data sending method according to an embodiment of this application. To describe procedure steps shown inFIG.7aandFIG.7bmore clearly and accurately, the following describesFIG.7aandFIG.7bwith reference toFIG.3andFIG.5atoFIG.5c. The first device310is provided with infrared, Bluetooth, Wi-Fi, and “Moment Share”. The second device320and the third devices330,340,350, and360each are provided with at least Bluetooth, Wi-Fi, and “Moment Share”. Optionally, any one of the second device320and the third devices330,340,350, and360may be provided with infrared, or may not be provided with infrared. For example, all the second device320and the third devices330,340,350, and360are provided with infrared. The second device320and the third devices330,340,350, and360are located around the first device310. There is no obstruction between the first device310and any one or some of the second device320and the third devices330,340,350, and360. For ease of description, the following uses an example in which there is no obstruction.

As shown inFIG.7aandFIG.7b, first, all the first device310, the second device320, and the third devices330,340,350, and360enable “Moment Share”. With reference toFIG.3, when the first device310, the second device320, and the third devices330,340,350, and360enable “Moment Share”, infrared, Bluetooth, and Wi-Fi are automatically enabled synchronously. In some embodiments, a dialog box pops up before “Moment Share” is enabled, to notify whether to agree to enable all of infrared, Bluetooth, and Wi-Fi for enabling “Moment Share”. If yes, “Moment Share” is enabled. If no, “Moment Share” is not enabled. In some embodiments, no dialog box pops up before “Moment Share” is enabled. In other words, the user is not queried whether to agree to enable all of infrared, Bluetooth, and Wi-Fi. When it is detected that “Moment Share” is enabled, infrared, Bluetooth, and Wi-Fi are automatically enabled synchronously. If one of the third devices is not provided with infrared, when the third device enables “Moment Share”, only Bluetooth and Wi-Fi are enabled synchronously.

Next, after all the first device310, the second device320, and the third devices330,340,350, and360enable “Moment Share”, the first device310publishes information in a broadcast manner through Bluetooth, and also publishes information in a directional manner through infrared. Because infrared has a directional feature, only a device that is provided with infrared and that is located within a specific angle range of an orientation of the first device310can receive the foregoing information published through infrared. Because all the second device320and the third devices330,340,350, and360are located around the first device310, all the second device320and the third devices330,340,350, and360can receive the foregoing information published in the Bluetooth manner through Bluetooth. Therefore, the device that is provided with infrared and that is located within the specific angle range of the orientation of the first device310can also receive, through Bluetooth, the foregoing information published through Bluetooth. Optionally, in the second device and the third devices, if a device that is provided with infrared is located within the specific angle range of the orientation of the first device310, the device feeds back a response signal to the first device310through infrared instead of feeding back a response signal to the first device310through Bluetooth, and another device feeds back a response signal to the first device310through Bluetooth. Optionally, the device may alternatively feed back a response signal to the first device310through Bluetooth. In other words, in some embodiments, a device may feed back a response signal to the first device310only through infrared. In some embodiments, a device may feed back a response signal to the first device310through infrared, or may feed back a response signal to the first device310through Bluetooth. For example, if the third device340that is provided with infrared is located within the specific angle range of the orientation of the first device310, the third device340may feed back a response signal to the first device310through infrared, or may feed back a response signal to the first device310through Bluetooth. Correspondingly, on one interface of the first device310, the identifier of the third device340may be displayed only at a first location for displaying a target device identifier such as the first region501, and the identifier of the third device340is not displayed at a second location such as the second region502; or the identifier of the third device340may be displayed at a first location for displaying a target device identifier such as the first region501, or the identifier of the third device340is displayed at the second location such as the second region502.

In this case, an orientation of the first device310is a first direction. In some embodiments, within a specific angle range of the first direction, at least one device responds to the first device310through infrared, and another device or all devices respond to the first device310through Bluetooth. Optionally, in some embodiments, within a specific angle range of the first direction, a maximum of one device responds to the first device310through infrared, and another device or all devices respond to the first device310through Bluetooth. For example, within the specific angle range of the first direction, both the third device330and the third device340receive the information published by the first device310through infrared, and both respond to the first device310through infrared. Strength of an infrared feedback signal received by the first device310from the third device330is stronger than strength of an infrared feedback signal received by the first device310from the third device340. Therefore, the first region501displays the identifier of the third device330.

If no device is located within the specific angle range of the first direction, and correspondingly no device responds to the first device310through infrared, the first region501displays no device identifier. If a device is located within the specific angle range of the first direction, but the device is not provided with infrared, the device does not respond to the first device310through infrared either. In addition, because infrared has the directional feature, there is no obstruction between the first device310and the second device320and between the first device310and any one of the third devices330,340,350, and360. Otherwise, even if a device is provided with infrared and is within the specific angle range of the first direction, because there is an obstruction between the first device310and the device, the device cannot receive the information published through infrared.

With reference toFIG.3, when the first device310is located at the location Di inFIG.3, an orientation of the first device310is the first direction. Within the specific angle range of the first direction, the second device320is provided with infrared, and responds to the first device310through infrared. The third devices330,340,350, and360each respond to the first device310through Bluetooth.

Device identifiers are displayed on one interface of the first device310shown inFIG.5a. The device identifiers are displayed in the first region501and the second region502. The identifier of the second device320is displayed in the first region501. The identifiers of the third devices330,340, and350are displayed in the second region502. The identifier of the third device360may be displayed by touching the left arrow control and the right arrow control disposed on the two sides of the second region502. In this case, only the identifier of the second device320is displayed in the first region501. In some cases, no device identifier is displayed in the first region501. The foregoing cases include but are not limited to a case in which no device is located within the specific angle range of the first direction and a case in which a device is located within the specific angle range of the first direction but the device is not provided with infrared. In other words, a maximum of one device identifier is displayed in the first region501. In some embodiments, at least one device identifier is displayed in the first region501, and the user selects, by touching one device identifier in the device identifiers displayed in the first region501, the identifier of a device to which data is to be sent. In addition, a location of the first region501inFIG.5ais merely an example, and is not intended to limit the scope of this application. Optionally, locations of the first region501and the second region502may be exchanged. Optionally, the first region501and the second region502may be in an up-and-down location relationship. The first region501may be located above or below the second region502. Optionally, the first region501and the second region502may not be adjacent, and are separately disposed at different locations of the interface shown inFIG.5a. Optionally, shapes of the first region501and the second region502are not limited to the shapes shown inFIG.5a. The first region501and the second region502each may be in another shape such as a triangle, a circle, a heart shape, or a circular ring shape. The other shape is any shape that can be figured out by persons skilled in the art. Optionally, the location of the first region501on the first interface is fixed. Optionally, the identifier of any one of the second device320and the third devices330,340,350, and360can be displayed in only the first region501or the second region502. For example, if the identifier of the second device320is displayed in the first region501, the identifier of the second device cannot be displayed in the second region502. In this way, when the user301of the first device310expects to quickly send data to the second device320, the user only needs to make the first device310face towards the second device320, so that the user301of the first device310can quickly locate the identifier of the second device320by using the first region of the first device310. Next, based on selection of the user301of the first device310for a device identifier that performs infrared responding, to-be-sent data is automatically transmitted through Wi-Fi. Specifically, based on a touch operation performed by the user301of the first device310on the identifier of the second device320in the first region501and an operation that the user302of the second device320accepts or agrees with the selection, the first device310automatically transmits the to-be-sent data to the second device320through Wi-Fi. Optionally, in a specific condition, for example, if a login account of the first device310is the same as a login account of the second device320, or a login account of the first device310and a login account of the second device320correspond to a same user, or a corresponding user relationship is a family member relationship, or a corresponding user relationship is a close friend relationship, based on the touch operation performed by the user301of the first device310on the identifier of the second device320in the first region501, the first device310automatically transmits the to-be-sent data to the second device320through Wi-Fi.

Then, it is determined whether the orientation of the first device310changes. If the orientation of the first device310does not change, the first device returns to the previous step shown inFIG.7aandFIG.7b. If the orientation of the first device310changes, a changed orientation of the first device310is the second direction. For example, when the first device310is located at the location {circle around (2)} inFIG.3, the orientation of the first device310is the second direction. Similar to the step performed after the orientation of the first device310is the first direction, within a specific angle range of the second direction, the third device330provided with infrared responds to the first device310through infrared, and the second device320and the third devices340,350, and360respond to the first device310through Bluetooth. Optionally, the second device320and the third devices330,340,350, and360each respond to the first device310through Bluetooth. Device identifiers are displayed on another interface of the first device310shown inFIG.5b. The device identifiers are displayed in the first region503and the second region504. The identifier of the third device330is displayed in the first region503. The identifiers of the second device320and the third devices340and350are displayed in the second region504. The identifier of the third device360may be displayed by touching the left arrow control and the right arrow control disposed on the two sides of the second region504. In this case, only the identifier of the third device330is displayed in the first region503. In some cases, no device identifier is displayed in the first region503. The foregoing cases include but are not limited to a case in which no device is located within the specific angle range of the second direction and a case in which a device is located within the specific angle range of the second direction but the device is not provided with infrared. In other words, a maximum of one device identifier is displayed in the first region503. In some embodiments, at least one device identifier is displayed in the first region503, and the user selects, by touching one device identifier in the device identifiers displayed in the first region503, the identifier of a device to which data is to be sent. In addition, a location of the first region503inFIG.5bis merely an example, and is not intended to limit the scope of this application. Similarly, locations and shapes of the first region503and the second region504inFIG.5bare changed in a same manner as the locations and the shapes of the first region501and the second region502inFIG.5a. Details are not described herein again. In this way, when the user301of the first device310expects to quickly send data to a device such as the third device330, the user only needs to make the first device310face towards the third device330, so that the user301of the first device310can quickly locate, by using the first region503of the first device310, the identifier of the third device330to which the data is expected to be sent. Next, based on selection of the user301of the first device310for a device identifier that performs infrared responding and an operation that the user303of the third device330accepts or agrees with the selection, the to-be-sent data is automatically transmitted through Wi-Fi. Optionally, in a specific condition, for example, if a login account of the first device310is the same as a login account of the third device330, or a login account of the first device310and a login account of the third device330correspond to a same user, or a corresponding user relationship is a family member relationship, or a corresponding user relationship is a close friend relationship, based on the touch operation performed by the user301of the first device310on the identifier of the third device330in the first region503, the first device310automatically transmits the to-be-sent data to the third device330through Wi-Fi.

Then, based on the foregoing steps, it may be further determined whether the orientation of the first device310changes. If the orientation of the first device310does not change, the first device returns to the previous step shown inFIG.7aandFIG.7b. If the orientation of the first device310changes, a changed orientation of the first device310is the third direction. For example, when the first device310is located at the location {circle around (3)} inFIG.3, the orientation of the first device310is the third direction. Similar to the step performed after the orientation of the first device310is the second direction, within a specific angle range of the third direction, the third device350provided with infrared responds to the first device310through infrared, and the second device320and the third devices330,340, and360respond to the first device310through Bluetooth. Device identifiers are displayed on a third interface of the first device310shown inFIG.5c. The device identifiers are displayed in the first region505and the second region506. The identifier of the third device350is displayed in the first region505. The identifiers of the third device360, the second device320, and the third device330are displayed in the second region506. The identifier of the third device340may be displayed by touching the left arrow control and the right arrow control disposed on the two sides of the second region506. In this case, only the identifier of the third device350is displayed in the first region505. In some cases, no device identifier is displayed in the first region505. The foregoing cases include but are not limited to a case in which no device is located within the specific angle range of the third direction, and a case in which a device is located within the specific angle range of the third direction but the device is not provided with infrared. In other words, a maximum of one second device identifier is displayed in the first region505. In some embodiments, at least one device identifier is displayed in the first region505, and the user selects, by touching one device identifier in the device identifiers displayed in the first region505, the identifier of a device to which data is to be sent. In addition, a location of the first region505inFIG.5cis merely an example, and is not intended to limit the scope of this application. Similarly, locations and shapes of the first region505and the second region506inFIG.5care changed in a same manner as the locations and the shapes of the first region503and the second region504inFIG.5b. Details are not described herein again.

In this way, when the user301of the first device310expects to quickly send data to the third device350, the user only needs to make the first device310face towards the third device350, so that the user301of the first device310can quickly locate, by using the first region of the first device310, the identifier of the third device350to which the data is expected to be sent.

Next, based on selection of the user301of the first device310for a device identifier that performs infrared responding and an operation that the user305of the third device350accepts or agrees with the selection, the first device310automatically sends the to-be-shared data to the third device350through Wi-Fi. Optionally, in a specific condition, for example, if a login account of the first device310is the same as a login account of the third device350, or a login account of the first device310and a login account of the third device350correspond to a same user, or a corresponding user relationship is a family member relationship, or a corresponding user relationship is a close friend relationship, based on the touch operation performed by the user301of the first device310on the identifier of the third device350in the first region505, the first device310automatically transmits the to-be-shared data to the third device350through Wi-Fi.

Then, based on the foregoing steps, it may be further determined whether the orientation of the first device310changes. Subsequent steps are similar to the foregoing steps. Details are not described herein again.

Optionally, a location of the first region on the first interface may not be fixed. The location of the first region changes with the orientation of the first device. However, the first region is highlighted.

Optionally, even if the location of the first region on the first interface is fixed, the first region may also be highlighted.

Optionally, the location of the first region on the first interface is not fixed, but a location of the first region relative to the second region is fixed. In other words, the first region and the second region maintain a relatively fixed location relationship.

Any one of the foregoing cases is intended to enable a maximum of one second device identifier that performs infrared responding to be quickly identified by the user of the first device on the first interface of the first device.

When no second device performs infrared responding, no identifier of the second device around the first device is displayed in the first region. In this way, the user can quickly learn that no second device performs infrared responding around the first device. In this case, the user may alternatively select an identifier of an expected second device around the first device by using the second region, to quickly send data.

Optionally, the first region and the second region may be respectively a first location and a second location.

It should be noted that, unless otherwise specified, that the first device and/or the second device are/is provided with infrared means that the first device and/or the second device are/is provided with an infrared transmitter and an infrared receiver, or are/is provided with an infrared transceiver.

Optionally, the first device and the second device each may be a portable mobile device further including another function such as a personal digital assistant and/or a music player function, for example, a mobile phone, a tablet computer, or a wearable mobile device (such as a smartwatch or a smart band) having a wireless communication function. The portable mobile device may alternatively be another portable mobile device, for example, a laptop having a touch-sensitive surface or a touch panel. It should be further understood that, in some other embodiments, the mobile device may alternatively not be a portable mobile device, but a desktop computer having a touch-sensitive surface or a touch panel.

FIG.8shows a mobile device800according to this application. For example, the mobile device800includes at least one processor810, a memory820, and a touchscreen830. The processor810is coupled to the memory820and the touchscreen830. The coupling in this embodiment of this application may be a communication connection, an electronic connection, or another form. Specifically, the memory820is configured to store program instructions. The touchscreen830is configured to display a user interface. The processor810is configured to invoke the program instructions stored in the memory820, so that the mobile device800performs the steps performed by the mobile device800in the data sending method for conveniently locating a target device provided in this embodiment of this application. It should be understood that the mobile device800may be configured to implement the data sending method for conveniently locating a target device provided in this embodiment of this application. For related features, refer to the foregoing descriptions. Details are not described herein again.

This application provides a computer program product including instructions. When the computer program product runs on a mobile device, the mobile device is enabled to perform the steps performed by the mobile device in the data sending method for conveniently locating a target device provided in embodiments of this application.

This application provides a computer-readable storage medium, including instructions. When the instructions are run on a mobile device, the mobile device is enabled to perform the steps performed by the mobile device in the data sending method for conveniently locating a target device provided in embodiments of this application.

Persons skilled in the art may clearly understand that embodiments of this application may be implemented by hardware, or by hardware and software. When hardware and software are used for implementation, the foregoing functions may be stored in the computer-readable medium. Based on such an understanding, the technical solutions of embodiments of this application essentially, or the part contributing to the conventional technology, or all or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions to enable a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the method described in embodiments of this application. The storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or a compact disc.

The foregoing descriptions are merely specific implementations of embodiments of this application, but are not intended to limit the protection scope of embodiments of this application. Any variation or replacement within the technical scope disclosed in embodiments of this application shall fall within the protection scope of embodiments of this application. Therefore, the protection scope of embodiments of this application shall be subject to the protection scope of the claims.