Method of identifying a location and electronic device
By sending instruction information and ultrasonic signals between multiple electronic devices, the relative positional relationship between the devices is automatically identified, solving the problem of manually setting the positional relationship in the prior art and realizing convenient cross-device operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI DEVICE CO LTD
- Filing Date
- 2021-11-22
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, moving the cursor, copying, or dragging across devices requires users to manually set the relative positions of multiple electronic devices, which is not convenient.
The first electronic device sends instruction information to at least two second electronic devices, instructing them to activate the recording function, and instructs the third electronic device to send an ultrasonic signal. The second electronic devices detect the ultrasonic signal based on the recording function to determine their relative positional relationship with the third electronic device. The first electronic device summarizes and determines the relative positional relationship between all devices.
Users no longer need to manually set the relative positions of multiple devices, simplifying cross-device operation and improving ease of use.
Smart Images

Figure CN116149502B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and more specifically, to methods and electronic devices for identifying location. Background Technology
[0002] With the fast pace of work, if office workers can perform operations such as moving the cursor, copying, pasting, or dragging across multiple electronic devices, their work efficiency can be greatly improved.
[0003] In existing technologies, to achieve operations such as moving the cursor across multiple electronic devices, copying, pasting, or dragging across devices, users need to manually set the relative positions between each pair of electronic devices, which makes the operation inconvenient. Summary of the Invention
[0004] This application provides a method and electronic device for identifying positions. The method can automatically identify the relative positional relationship between two devices in a plurality of devices without requiring the user to manually set the relative positional relationship between two devices in a plurality of devices, and is easy to operate.
[0005] In a first aspect, a method for identifying location is provided. This method is applied to a first electronic device and includes: the first electronic device sending first indication information to at least two second electronic devices, the first indication information instructing the corresponding second electronic devices to activate a recording function; and the first electronic device sending second indication information to a third electronic device, the second indication information instructing the third electronic device to send an ultrasonic signal, the ultrasonic signal being used by the at least two second electronic devices to determine their relative positional relationship with the third electronic device; subsequently, the first electronic device receiving the relative positional relationships between the at least two second electronic devices and the third electronic device; and finally, the first electronic device sending the relative positional relationships between each pair of the at least two second electronic devices and the third electronic device; or, the first electronic device determining the relative positional relationships between each pair of the at least two second electronic devices based on the relative positional relationships between each of the at least two second electronic devices and the third electronic device.
[0006] Based on the above technical solution, the first electronic device instructs at least two second electronic devices to activate their respective recording functions and instructs the third electronic device to send ultrasonic signals. After activating their recording functions, the at least two second electronic devices determine their relative positional relationship with the third electronic device based on the ultrasonic signals detected by their respective recording functions. They then send their relative positional relationship with the third electronic device to the first electronic device. Finally, after determining the relative positional relationship between each pair of the at least two second electronic devices and the third electronic device based on their respective relative positional relationships with the third electronic device, the first electronic device sends the relative positional relationship between each pair of the at least two second electronic devices and the third electronic device to both the at least two second electronic devices and the third electronic device. This enables cross-device cursor movement, cross-device copying, pasting, or dragging operations between the two second electronic devices and the third electronic device. This method does not require the user to manually set the relative positional relationship between each pair of multiple devices, making it simple to operate.
[0007] The following section uses at least two second electronic devices as an example to illustrate the method for determining the relative positional relationship between two second electronic devices, and explains it in different cases.
[0008] Case 1: The two second electronic devices are located on opposite sides of the third electronic device.
[0009] For example, the relative position relationship sent by one of the two second electronic devices to the first electronic device indicates that one of the two second electronic devices is located on the first side of the third electronic device, and the relative position relationship sent by the other of the two second electronic devices to the first electronic device indicates that the other of the two second electronic devices is located on the second side of the third electronic device, wherein the first side is opposite to the second side, and the first side is either the left or the right side.
[0010] In this case, the first electronic device can determine that the two second electronic devices are located on opposite sides of the third electronic device. For example, one of the two second electronic devices is located on the left side of the third electronic device, and the other of the two second electronic devices is located on the right side of the third electronic device; or, one of the two second electronic devices is located on the right side of the third electronic device, and the other of the two second electronic devices is located on the left side of the third electronic device.
[0011] Scenario 2: Both second electronic devices are located on the same side of the third electronic device.
[0012] For example, the relative positional relationship sent by the two second electronic devices to the first electronic device indicates that the two second electronic devices are located on the same side of the third electronic device, for example, that the two second electronic devices are located on the left or right side of the third electronic device.
[0013] In this scenario, the first electronic device can send a first instruction message to one of the two second electronic devices to instruct it to activate the recording function, and send a second instruction message to the other of the two second electronic devices to instruct it to send an ultrasonic signal. One of the second electronic devices determines the relative positional relationship between the two second electronic devices based on the detected ultrasonic signal from the other second electronic device, and sends the relative positional relationship between the two second electronic devices to the first electronic device.
[0014] Based on the above technical solution, when the two second electronic devices are located on the same side of the third electronic device, by enabling one of the two second electronic devices to activate the recording function and enabling the other of the two second electronic devices to send an ultrasonic signal, one of the two second electronic devices can determine its relative position to the other second electronic device based on the ultrasonic signal.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, before sending the second instruction information to the other of the two second electronic devices, the method further includes: the first electronic device receiving a confirmation message for the first instruction information sent by one of the two second electronic devices, wherein the confirmation message for the first instruction information instructs one of the two second electronic devices to enable the recording function.
[0016] Based on the above technical solution, by having one of the two second electronic devices send a confirmation message to the first electronic device in response to the received first instruction information, the first electronic device can determine that one of the second electronic devices has activated the recording function based on the confirmation message. In this case, the first electronic device then instructs the other of the two second electronic devices to send an ultrasonic signal. By ensuring that one of the two second electronic devices has activated the recording function before instructing the other to send an ultrasonic signal, the one of the second electronic devices can receive at least one set of ultrasonic signals from the left and right speakers of the other second electronic device. Only when it receives at least one set of ultrasonic signals from the left and right speakers of the electronic device that sent the ultrasonic signal can the one of the second electronic devices determine its relative position to the other of the two second electronic devices. In addition, by ensuring that one of the two second electronic devices has activated the recording function before instructing the other to send an ultrasonic signal, the possibility of the one of the two second electronic devices receiving invalid signals can be reduced, and the processing difficulty of the received signals can be reduced.
[0017] In conjunction with the first aspect and the above implementation methods, in some implementation methods of the first aspect, before sending the second instruction information to the third electronic device, the method further includes: the first electronic device receiving confirmation messages for the first instruction information sent by at least two second electronic devices, wherein the confirmation messages indicate that the corresponding second electronic devices have enabled the recording function.
[0018] Based on the above technical solution, by having at least two second electronic devices send confirmation information to the first electronic device in response to the received first instruction information, the first electronic device can determine that at least two second electronic devices have activated the recording function based on the confirmation information. In this case, the first electronic device then instructs the third electronic device to send an ultrasonic signal. By instructing the third electronic device to send an ultrasonic signal after ensuring that at least two second electronic devices have activated the recording function, the at least two second electronic devices can receive at least one set of ultrasonic signals from the left and right speakers of the third electronic device. Only when at least one set of ultrasonic signals from the left and right speakers of the third electronic device are received can the at least two second electronic devices determine their relative positional relationship with the third electronic device. In addition, instructing the third electronic device to send an ultrasonic signal after ensuring that at least two second electronic devices have activated the recording function can also reduce the possibility that the at least two second electronic devices receive invalid signals and reduce the difficulty of processing the received signals.
[0019] Secondly, a method for identifying location is provided. The method is applied to a second electronic device. The method includes: the second electronic device receiving first indication information from a first electronic device, the first indication information instructing the second electronic device to activate a recording function; the second electronic device activating the recording function according to the first indication information; then, the second electronic device determining the relative positional relationship between the second electronic device and the third electronic device based on an ultrasonic signal detected from the third electronic device based on the recording function; then, the second electronic device sending the relative positional relationship between the second electronic device and the third electronic device to the first electronic device; finally, the second electronic device receiving the relative positional relationships between at least two second electronic devices and the third electronic device sent by the first electronic device, including the second electronic device itself.
[0020] Based on the above technical solution, the first electronic device instructs at least two second electronic devices (one of at least two second electronic devices) to activate their respective recording functions, and instructs the third electronic device to send ultrasonic signals. After activating their recording functions, the at least two second electronic devices determine their relative positional relationship with the third electronic device based on the ultrasonic signals detected by their respective recording functions, and then send their relative positional relationship with the third electronic device to the first electronic device. Finally, after determining the relative positional relationship between each pair of the at least two second electronic devices and the third electronic device based on the relative positional relationship between each of the at least two second electronic devices and the third electronic device, the first electronic device sends the relative positional relationship between each pair of the at least two second electronic devices and the third electronic device to both the at least two second electronic devices and the third electronic device. This enables cross-device cursor movement, cross-device copying, pasting, or dragging operations between the two second electronic devices and the third electronic device. This method does not require the user to manually set the relative positional relationship between each pair of multiple devices, making it simple to operate.
[0021] In conjunction with the second aspect, in some implementations of the second aspect, the second electronic device is one of two second electronic devices, and the relative positional relationship between the second electronic device and the third electronic device includes: the second electronic device is located on the first side of the third electronic device, the first side is opposite to the second side, and the second side is the relative positional relationship between the other of the two second electronic devices and the third electronic device, wherein the first side is the left or right side.
[0022] In conjunction with the second aspect and the above implementations, in some implementations of the second aspect, the second electronic device is one of two second electronic devices. The method further includes: the second electronic device receiving first instruction information sent by the first electronic device; the second electronic device activating a recording function according to the first instruction information; the second electronic device determining the relative positional relationship between the second electronic device and the other second electronic device based on an ultrasonic signal detected by the recording function from the other second electronic device; and the second electronic device sending the relative positional relationship between the second electronic device and the other second electronic device to the first electronic device.
[0023] Based on the above technical solution, when the two second electronic devices are located on the same side of the third electronic device, by enabling one of the two second electronic devices to activate the recording function and enabling the other of the two second electronic devices to send an ultrasonic signal, one of the two second electronic devices can determine its relative position to the other second electronic device based on the ultrasonic signal.
[0024] In conjunction with the second aspect and the above implementation methods, in some implementation methods of the second aspect, the second electronic device is one of two second electronic devices, and the method further includes: receiving second instruction information sent by the first electronic device, the second instruction information instructing the second electronic device to play an ultrasonic signal, the second electronic device playing the ultrasonic signal according to the second instruction information, the ultrasonic signal being used to determine the relative positional relationship between the two second electronic devices.
[0025] In conjunction with the second aspect and the above implementation methods, in some implementation methods of the second aspect, after the second electronic device enables the recording function, the method further includes: the second electronic device sending a confirmation message for the first instruction information to the first electronic device, wherein the confirmation message for the first instruction information instructs the second electronic device to enable the recording function.
[0026] Based on the above technical solution, by having the second electronic device send a confirmation message to the first electronic device in response to the received first instruction information, the first electronic device can determine that the second electronic device has enabled the recording function based on the confirmation message. In this case, the first electronic device then instructs the electronic device that sends the ultrasonic signal to send an ultrasonic signal. By instructing the electronic device that sends the ultrasonic signal to send an ultrasonic signal after ensuring that the second electronic device has enabled the recording function, the second electronic device can receive at least one set of ultrasonic signals from the left and right speakers of the electronic device that sends the ultrasonic signal. Only when the second electronic device receives at least one set of ultrasonic signals from the left and right speakers of the electronic device that sends the ultrasonic signal can it determine its relative positional relationship with the electronic device that sends the ultrasonic signal. In addition, instructing the electronic device that sends the ultrasonic signal to send an ultrasonic signal after ensuring that the second electronic device has enabled the recording function can also reduce the possibility of the second electronic device receiving invalid signals and reduce the difficulty of processing the received signals.
[0027] Thirdly, a method for identifying location is provided, applied to a third electronic device. The method includes: the third electronic device sending first indication information to at least two second electronic devices, the first indication information instructing the corresponding second electronic devices to activate a recording function; the third electronic device playing an ultrasonic signal, the ultrasonic signal being used to determine the relative positional relationship between the third electronic device and the at least two second electronic devices; the third electronic device receiving the relative positional relationship between itself and the third electronic device sent by the at least two second electronic devices; and finally, the third electronic device sending the relative positional relationship between each pair of the at least two second electronic devices and the third electronic device to the at least two second electronic devices; or, the third electronic device determining the relative positional relationship between each pair of the at least two second electronic devices based on the relative positional relationship between each of the at least two second electronic devices and the third electronic device.
[0028] Based on the above technical solution, the third electronic device instructs at least two second electronic devices to activate their respective recording functions and send ultrasonic signals. After activating their recording functions, the at least two second electronic devices determine their relative positional relationship with the third electronic device based on the ultrasonic signals detected by their respective recording functions, and then send their relative positional relationship with the third electronic device to the third electronic device. Finally, after determining the relative positional relationship between at least two second electronic devices and the third electronic device based on the relative positional relationship between the at least two second electronic devices and the third electronic device, the third electronic device sends the relative positional relationship between at least two second electronic devices and the third electronic device to the at least two second electronic devices. This enables cross-device cursor movement, cross-device copying, pasting, or dragging operations between the two second electronic devices and the third electronic device. This method does not require the user to manually set the relative positional relationship between multiple devices, making it simple to operate.
[0029] The following section uses at least two second electronic devices as an example to illustrate the method for determining the relative positional relationship between two second electronic devices, and explains it in different cases.
[0030] Case 1: The two second electronic devices are located on opposite sides of the third electronic device.
[0031] For example, the relative position relationship sent by one of the two second electronic devices to the third electronic device indicates that one of the two second electronic devices is located on the first side of the third electronic device, and the relative position relationship sent by the other of the two second electronic devices to the third electronic device indicates that the other of the two second electronic devices is located on the second side of the third electronic device, wherein the first side is opposite to the second side, and the first side is either the left or the right side.
[0032] In this case, the third electronic device can determine that the two second electronic devices are located on opposite sides of the third electronic device. For example, one of the two second electronic devices is located on the left side of the third electronic device, and the other of the two second electronic devices is located on the right side of the third electronic device; or, one of the two second electronic devices is located on the right side of the third electronic device, and the other of the two second electronic devices is located on the left side of the third electronic device.
[0033] Scenario 2: Both second electronic devices are located on the same side of the third electronic device.
[0034] For example, the relative positional relationship sent by the two second electronic devices to the third electronic device indicates that the two second electronic devices are located on the same side of the third electronic device, for example, that the two second electronic devices are located on the left or right side of the third electronic device.
[0035] In this scenario, the third electronic device can send a first instruction to one of the two second electronic devices to instruct it to activate the recording function, and send a second instruction to the other of the two second electronic devices to instruct it to send an ultrasonic signal. One of the second electronic devices determines the relative position between the two second electronic devices based on the detected ultrasonic signal from the other second electronic device, and sends the relative position between the two second electronic devices to the third electronic device.
[0036] Based on the above technical solution, when the two second electronic devices are located on the same side of the third electronic device, by enabling one of the two second electronic devices to activate the recording function and enabling the other of the two second electronic devices to send an ultrasonic signal, one of the two second electronic devices can determine its relative position to the other second electronic device based on the ultrasonic signal.
[0037] In conjunction with the third aspect, in some implementations of the third aspect, before sending the second instruction information to the other of the two second electronic devices, the method further includes: the third electronic device receiving a confirmation message for the first instruction information sent by one of the two second electronic devices, the confirmation message for the first instruction information instructing one of the two second electronic devices to enable the recording function.
[0038] Based on the above technical solution, by having one of the two second electronic devices send a confirmation message to the third electronic device in response to the received first instruction information, the third electronic device can determine that one of the second electronic devices has activated the recording function. In this case, the third electronic device then instructs the other of the two second electronic devices to send an ultrasonic signal. By ensuring that one of the two second electronic devices has activated the recording function before instructing the other to send an ultrasonic signal, the one of the second electronic devices can receive at least one set of ultrasonic signals from the left and right speakers of the other second electronic device. Only when it receives at least one set of ultrasonic signals from the left and right speakers of the electronic device that sent the ultrasonic signal can the one of the second electronic devices determine its relative position to the other of the two second electronic devices. In addition, by ensuring that one of the two second electronic devices has activated the recording function before instructing the other to send an ultrasonic signal, the possibility of the one of the two second electronic devices receiving invalid signals can be reduced, thus reducing the difficulty of processing the received signals.
[0039] In conjunction with the third aspect and the above implementation methods, in some implementation methods of the third aspect, before the third electronic device plays the ultrasonic signal, the method further includes: the third electronic device receiving confirmation messages for the first indication information sent by at least two second electronic devices, the confirmation messages instructing the corresponding second electronic devices to enable the recording function.
[0040] Based on the above technical solution, by having at least two second electronic devices send confirmation information to a third electronic device in response to the received first instruction information, the third electronic device can determine that at least two second electronic devices have activated the recording function based on the confirmation information. In this case, when the third electronic device sends an ultrasonic signal, the at least two second electronic devices can receive at least one set of ultrasonic signals from the left and right speakers of the third electronic device. Only when they receive at least one set of ultrasonic signals from the left and right speakers of the third electronic device can the at least two second electronic devices determine their relative positional relationship with the third electronic device. In addition, by ensuring that at least two second electronic devices have activated the recording function before sending the ultrasonic signal, the possibility of at least two second electronic devices receiving invalid signals can be reduced, thus reducing the difficulty of processing the received signals.
[0041] Fourthly, a method for identifying location is provided, applied to a second electronic device. The method includes: the second electronic device receiving first indication information from a third electronic device, the first indication information instructing the second electronic device to activate a recording function; the second electronic device activating the recording function according to the first indication information; then, the second electronic device determining the relative positional relationship between the second electronic device and the third electronic device based on an ultrasonic signal detected from the third electronic device based on the recording function; then, the second electronic device sending the relative positional relationship between the second electronic device and the third electronic device to the third electronic device; and finally, the second electronic device receiving the relative positional relationships between at least two pairs of the second electronic devices and the third electronic device sent by the third electronic device, including the second electronic device itself.
[0042] Based on the above technical solution, the third electronic device instructs at least two second electronic devices (one of the at least two second electronic devices) to activate their respective recording functions and send ultrasonic signals. After activating their recording functions, the at least two second electronic devices determine their relative positional relationship with the third electronic device based on the ultrasonic signals detected by their respective recording functions, and then send their relative positional relationship with the third electronic device to the third electronic device. Finally, after determining the relative positional relationship between the at least two second electronic devices and the third electronic device based on the relative positional relationship between the at least two second electronic devices and the third electronic device, the third electronic device sends the relative positional relationship between the at least two second electronic devices and the third electronic device to the at least two second electronic devices. This enables cross-device cursor movement, cross-device copying, pasting, or dragging operations between the two second electronic devices and the third electronic device. This method does not require the user to manually set the relative positional relationship between multiple devices, making it simple to operate.
[0043] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the second electronic device is one of two second electronic devices, and the relative positional relationship between the second electronic device and the third electronic device includes: the second electronic device is located on the first side of the third electronic device, the first side is opposite to the second side, and the second side is the relative positional relationship between the other of the two second electronic devices and the third electronic device, wherein the first side is the left or right side.
[0044] In conjunction with the fourth aspect and the above implementation methods, in some implementation methods of the fourth aspect, the second electronic device is one of two second electronic devices, and the method further includes: the second electronic device receiving first instruction information sent by the third electronic device; the second electronic device activating a recording function according to the first instruction information; the second electronic device determining the relative positional relationship between the second electronic device and the other second electronic device based on the ultrasonic signal detected by the recording function from the other of the two second electronic devices; and the second electronic device sending the relative positional relationship between the second electronic device and the other second electronic device to the third electronic device.
[0045] Based on the above technical solution, when the two second electronic devices are located on the same side of the third electronic device, by enabling one of the two second electronic devices to activate the recording function and enabling the other of the two second electronic devices to send an ultrasonic signal, one of the two second electronic devices can determine its relative position to the other second electronic device based on the ultrasonic signal.
[0046] In conjunction with the fourth aspect and the above implementation methods, in some implementation methods of the fourth aspect, the second electronic device is one of two second electronic devices, and the method further includes: the second electronic device receiving second instruction information sent by the third electronic device, the second instruction information instructing the second electronic device to play an ultrasonic signal, the second electronic device playing the ultrasonic signal according to the second instruction information, and the ultrasonic signal being used to determine the relative positional relationship between the two second electronic devices.
[0047] In conjunction with the fourth aspect and the above implementation methods, in some implementation methods of the fourth aspect, after the second electronic device activates the recording function, the method further includes: the second electronic device sending a confirmation message for the first instruction information to the third electronic device, wherein the confirmation message for the first instruction information instructs the second electronic device to activate the recording function.
[0048] Based on the above technical solution, by having the second electronic device send a confirmation message to the third electronic device in response to the received first instruction message, the third electronic device can determine that the second electronic device has activated the recording function based on the confirmation message. In this case, the third electronic device then sends an ultrasonic signal. By sending the ultrasonic signal after ensuring that the second electronic device has activated the recording function, the second electronic device can receive at least one set of ultrasonic signals from the left and right speakers of the third electronic device. Only when the second electronic device receives at least one set of ultrasonic signals from the left and right speakers of the third electronic device can it determine its relative position to the third electronic device. In addition, by ensuring that the second electronic device has activated the recording function before sending the ultrasonic signal, the possibility of the second electronic device receiving invalid signals can be reduced, and the processing difficulty of the received signals can be reduced.
[0049] Fifthly, this application provides an apparatus included in an electronic device, which has the function of implementing the behaviors of the electronic device in the above aspects and possible implementations thereof. The functions can be implemented in hardware or by hardware executing corresponding software.
[0050] Optionally, the device may be the first electronic device, the second electronic device, or the third electronic device described above.
[0051] Sixthly, this application provides an electronic device, including: one or more processors; a memory; multiple application programs; and one or more computer programs. The one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device performs the location recognition method in any possible implementation of any of the above aspects.
[0052] Optionally, the electronic device may be the first electronic device, the second electronic device, or the third electronic device described above.
[0053] In a seventh aspect, this application provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method for identifying a location in any possible implementation of any of the above aspects.
[0054] Eighthly, a system is provided, comprising at least a first electronic device, at least two second electronic devices and a third electronic device, wherein the first electronic device is configured to perform the location identification method in any possible implementation of the first aspect, the second electronic devices are configured to perform the location identification method in any possible implementation of the second or fourth aspect, and the third electronic device is configured to perform the location identification method in any possible implementation of the third aspect.
[0055] Ninthly, this application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform any of the possible location identification methods described above.
[0056] In a tenth aspect, this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform any of the possible location identification methods described above. Attached Figure Description
[0057] Figure 1 This is a schematic diagram of the structure of an electronic device provided in this application;
[0058] Figure 2 This is a schematic diagram of another example of an electronic device provided in the embodiments of this application;
[0059] Figure 3 This is a schematic diagram of an example scenario provided in an embodiment of this application;
[0060] Figure 4 This is an interactive flowchart of an example of a location identification method provided in an embodiment of this application;
[0061] Figure 5 This is a schematic diagram showing the distribution of the left and right speakers on an electronic device according to an embodiment of this application;
[0062] Figure 6 This is an interactive flowchart of another method for identifying location provided in an embodiment of this application;
[0063] Figure 7 This is a schematic diagram of an example display interface in the location identification process provided in the embodiments of this application;
[0064] Figure 8 This is a schematic diagram of another scenario provided in an embodiment of this application;
[0065] Figure 9 This is an interactive flowchart of another method for identifying location provided in the embodiments of this application;
[0066] Figure 10This is an interactive flowchart of another method for identifying location provided in the embodiments of this application;
[0067] Figure 11 This is a schematic diagram of yet another scenario provided in the embodiments of this application;
[0068] Figure 12 This is an interactive flowchart of another method for identifying location provided in the embodiments of this application;
[0069] Figure 13 This is an interactive flowchart of another method for identifying location provided in the embodiments of this application;
[0070] Figure 14 This is a schematic diagram of yet another scenario provided in the embodiments of this application;
[0071] Figure 15 This is an interactive flowchart of another method for identifying location provided in the embodiments of this application;
[0072] Figure 16 This is an interactive flowchart of another method for identifying location provided in the embodiments of this application;
[0073] Figure 17 This is an interactive flowchart of another method for identifying location provided in the embodiments of this application. Detailed Implementation
[0074] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0075] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, such as "first indication information" and "second indication information" described in the embodiments of this application.
[0076] The location identification method provided in this application can be applied to electronic devices such as desktop computers, laptops, and mice. This application does not impose any restrictions on the specific type of device.
[0077] Figure 1The diagram shows a structural schematic of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may be a desktop computer, laptop computer, or the like with a display function.
[0078] The electronic device 100 may include a processor 110, an ultrasonic signal generation module 120, an audio module 130, a recording module 140, a position recognition module 150, an internal memory 160, an external memory interface 170, a communication module 180, and a display module 190.
[0079] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0080] The processor 110 may include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0081] The ultrasonic signal generation module 120 can be used to generate ultrasonic signals.
[0082] The audio module 130 can be used to play ultrasonic signals to external devices.
[0083] The recording module 140 can be used to receive ultrasonic signals.
[0084] The position recognition module 150 can be used to determine the relative positional relationship between multiple electronic devices based on ultrasonic signals.
[0085] Internal memory 160 can be used to store computer executable program code, which includes instructions. Internal memory 160 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, text, etc.). Furthermore, internal memory 160 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 160 and / or instructions stored in memory located in the processor.
[0086] The external storage interface 170 can be used to connect external storage devices, such as USB flash drives, to expand the storage capacity of electronic device 100. The USB flash drive communicates with processor 110 through the external storage interface 170 to perform data storage functions. For example, music, video, and other files can be saved on the USB flash drive.
[0087] The communication module 180 can be used to receive and send instructions or information.
[0088] Display module 190 can be used to display images, videos, etc.
[0089] Figure 2 The diagram shows a structural schematic of an electronic device 200 provided in an embodiment of this application. The electronic device 200 may be an electronic device such as a mouse that does not have a display function.
[0090] Electronic device 200 may include processor 210, receiver 220 and transmitter 230.
[0091] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 200. In other embodiments of this application, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0092] For an introduction to processor 210, please refer to the above description of processor 110. For the sake of brevity, it will not be repeated here.
[0093] When electronic device 200 and electronic device 100 have a communication connection, receiver 220 can be used to receive instructions from electronic device 100, and transmitter 230 can be used to send instructions to electronic device 100.
[0094] The following is combined Figures 3 to 14 This application provides a detailed description of the location identification method provided in its embodiments.
[0095] Figure 3 This paper illustrates an application scenario of the location identification method provided in an embodiment of this application. Figure 3 The illustration shows three electronic devices, which are referred to as electronic device 1, electronic device 2, and electronic device 3 for ease of description. To enable cross-device operations such as cursor movement among electronic devices 1, 2, and 3, it is first necessary to determine the relative positional relationships between each pair of electronic devices 1, 2, and 3. In one implementation, the mouse provided in this embodiment can be used to determine the relative positional relationships between each pair of electronic devices 1, 2, and 3. In this case, the mouse needs to have a communication connection with each of electronic devices 1, 2, and 3, for example, a short-range communication connection, to communicate with each other during the determination of the relative positional relationships.
[0096] In another implementation, the relative positional relationships between any two of electronic devices 1, 2, and 3 can be determined by one of them. In this case, communication connections, such as short-range communication connections, are required between any two of electronic devices 1, 2, and 3 to facilitate communication during the determination of relative positional relationships. In the following description, it is assumed that the mouse has individual communication connections with each of the electronic devices, or that multiple electronic devices have mutual communication connections.
[0097] In this embodiment of the application, the relative positional relationship between two electronic devices can be understood as: one electronic device is located to the left or right of another electronic device, for example, in Figure 3 In the diagram, the relative positional relationship between electronic device 1 and electronic device 2 is that electronic device 1 is located to the right of electronic device 2, and the relative positional relationship between electronic device 2 and electronic device 1 is that electronic device 2 is located to the left of electronic device 1.
[0098] It should be understood that Figure 3 The number of electronic devices with display functions, the relative positional relationship between electronic devices, and the type of electronic devices included in the scenarios shown below do not constitute a limitation on the embodiments of this application. In specific implementation, there may be more or fewer electronic devices than in each scenario, and there may be other relative positional relationships between electronic devices besides those in the scenario. Electronic devices may also be of other types besides those in the scenario.
[0099] The following is combined Figure 3 The illustrated scenario uses the example of determining the relative positional relationships between any two electronic devices 1, 2, and 3 using a mouse to illustrate an example of a position identification method provided in this application. Figure 4 An exemplary interactive flowchart of the method 400 for identifying location is shown. It is worth noting that in method 400, the mouse corresponds to the first electronic device, electronic device 1 corresponds to the third electronic device, and electronic devices 2 and 3 each correspond one-to-one with two second electronic devices.
[0100] Step 401: The mouse sends a first instruction message to electronic device 2 and electronic device 3 respectively, instructing electronic device 2 and electronic device 3 to turn on their respective recording functions.
[0101] For example, the user can trigger the mouse to perform a position recognition process.
[0102] For example, a physical button can be embedded in the mouse. When the physical button is pressed, the mouse begins to execute the position recognition process. For example, after the physical button is pressed, the transmitter inside the mouse is triggered to send a command indicating the start of the position recognition process to electronic devices 1, 2, and 3 respectively, based on the short-range communication connection established with electronic devices 1, 2, and 3. After receiving the command indicating the start of the position recognition process, electronic devices 1, 2, and 3 respectively return an acknowledgment (Ack) message to the mouse based on the short-range communication connection established with the mouse, indicating that they agree to start the position recognition process. After receiving the acknowledgment messages from electronic devices 1, 2, and 3, the mouse can start to execute the position recognition process.
[0103] After the location recognition process begins, the mouse sends first instruction information to electronic devices 2 and 3 respectively, instructing electronic devices 2 and 3 to activate their respective recording functions. For example, the mouse sends the first instruction information to electronic devices 2 and 3 respectively based on the short-range communication connection established with electronic devices 2 and 3.
[0104] Step 402: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0105] After the mouse sends the first instruction information to electronic devices 2 and 3, in one implementation, the mouse can directly execute step 404 after sending the first instruction information to electronic devices 2 and 3: the mouse sends the second instruction information to electronic device 1 to instruct electronic device 1 to play an ultrasonic signal. For example, the mouse sends the second instruction information to electronic device 1 based on the short-range communication connection established with electronic device 1.
[0106] In another implementation, after the mouse sends the first instruction information to electronic devices 2 and 3, if the mouse receives an acknowledgment message from electronic devices 2 and 3, such as an Ack message, then the mouse executes step 404. Here, the acknowledgment message from electronic devices 2 and 3 is the response of electronic devices 2 and 3 to the first instruction information. In this case, method 400 may also include step 403 before step 404: after electronic devices 2 and 3 have enabled their recording functions, they send an acknowledgment message to the mouse to inform the mouse that the recording functions of electronic devices 2 and 3 have been enabled.
[0107] After receiving the second instruction information, electronic device 1 executes step 405: playing an ultrasonic signal.
[0108] Since electronic devices 2 and 3 have their respective recording functions enabled, when electronic device 1 plays an ultrasonic signal, the ultrasonic signal will be received by electronic devices 2 and 3. Then, electronic devices 2 and 3 can execute step 406, whereby electronic devices 2 and 3 determine their relative positional relationship with electronic device 1 based on the received ultrasonic signal.
[0109] For example, electronic device 1 plays ultrasonic signals through a left speaker and a right speaker, and the distribution of the left speaker and right speaker on electronic device 1 can be as follows: Figure 5 As shown, electronic devices 2 and 3 can determine their relative positional relationship with electronic device 1 based on the difference in the time when they receive the two ultrasonic signals.
[0110] To enable a device receiving ultrasonic signals to distinguish whether the received ultrasonic signal originates from the left or right speaker, the device playing the ultrasonic signal can alternately play the signal from the left and right speakers. Furthermore, it can differentiate between the ultrasonic signals from the left and right speakers based on signal characteristics. For example, the device playing the ultrasonic signal can transmit a decreasing frequency ultrasonic signal from the left speaker and an increasing frequency ultrasonic signal from the right speaker, allowing the receiving device to distinguish between the two received ultrasonic signals. The following explanation uses electronic device 2 as an example to illustrate the method for determining the relative position between electronic device 2 and electronic device 1 based on the two received ultrasonic signals.
[0111] For example, electronic device 1 first plays an ultrasonic signal s1 with decreasing frequency through the left speaker within a time length T1 corresponding to time t1 to time t2. Then, starting from time t2, after an interval of time length T2, it plays an ultrasonic signal s2 with increasing frequency through the right speaker within a time length T3 corresponding to time t3 to time t4.
[0112] After receiving the ultrasonic signal s1 from the left speaker of electronic device 1 and the ultrasonic signal s2 from the right speaker of electronic device 1, electronic device 2 determines the time difference between the arrival times based on the time t5 when the ultrasonic signal s1 played by the left speaker of electronic device 1 arrives at the recording module of electronic device 2 and the time t6 when the ultrasonic signal s2 played by the right speaker of electronic device 1 arrives at the recording module of electronic device 2, i.e., t6-t5-(T1+T2).
[0113] If t6-t5-(T1+T2) is greater than 0, it means that the ultrasonic signal s1 from the left speaker of electronic device 1 arrives at the recording module of electronic device 2 earlier, thus indicating that electronic device 2 is located to the left of electronic device 1. Alternatively, if t6-t5-(T1+T2) is less than 0, it means that the ultrasonic signal s2 from the right speaker of electronic device 1 arrives at the recording module of electronic device 2 earlier, thus indicating that electronic device 2 is located to the right of electronic device 1.
[0114] exist Figure 3 In the scenario shown, electronic device 2 determines that t6-t5-(T1+T2) is greater than 0, and thus electronic device 2 can determine that it is located to the left of electronic device 1.
[0115] Accordingly, electronic device 3 can determine that it is located to the right of electronic device 1. For the method by which electronic device 3 determines its relative position to electronic device 1, please refer to the above description; for brevity, it will not be repeated here. It is worth mentioning that, for the electronic device with display function provided in this embodiment, the distribution of its left and right speakers can be as follows... Figure 5 As shown, for the sake of simplicity, the distribution of the left and right speakers on electronic devices with display functions will not be described in the following text.
[0116] It is worth mentioning that, regarding the value of t6-t5-(T1+T2), in addition to the two cases mentioned above of being greater than 0 or less than 0, there may also be a case where it equals 0. When electronic device 2 determines that t6-t5-(T1+T2) equals 0, it means that electronic device 2 is located directly in front of or behind electronic device 1. In this case, electronic device 2 can prompt the user to adjust the placement position so that the user can adjust the placement position of the relevant electronic devices according to the prompt of electronic device 2, so as to adjust the front-to-back relative position relationship to the left-to-right relative position relationship.
[0117] It should be understood that the ultrasonic signal is merely an example and does not constitute a limitation on the embodiments of this application. For example, in specific implementations, any audio signal that is beyond the range of human hearing should fall within the protection scope of the embodiments of this application.
[0118] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 1, step 407 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 1 to the mouse.
[0119] Step 408: Based on the relative positional relationship between electronic device 2 and electronic device 3 and electronic device 1, the mouse determines that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1.
[0120] After determining that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1, the mouse obtains the relative positional relationship between each pair of electronic devices 1, 2, and 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, and 3, the mouse also needs to inform each device of the relative positional relationship between each pair of electronic devices 1, 2, and 3. In this case, method 400 further includes step 409: the mouse sends the relative positional relationship between each pair of electronic devices 1, 2, and 3 to electronic devices 1, 2, and 3 respectively. For example, the mouse sends to electronic devices 1, 2, and 3 that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1 respectively.
[0121] After obtaining the relative positional relationships between each pair of electronic devices 1, 2, and 3, the mouse can freely switch between electronic devices 1, 2, and 3.
[0122] For example, assuming the mouse cursor is currently on electronic device 1, when the user needs to move the cursor to electronic device 2, the user can control the cursor to move closer to electronic device 2, that is, to move the cursor to the left edge of the display interface of electronic device 1. When the cursor reaches the left edge of electronic device 1, if the user continues to move the cursor to the left, the cursor will appear on electronic device 2. When the user needs to move the cursor to electronic device 3, the user can control the cursor to move closer to electronic device 3, that is, to move the cursor to the right edge of the display interface of electronic device 1. When the cursor reaches the right edge of electronic device 1, if the user continues to move the cursor to the right, the cursor will appear on electronic device 3.
[0123] It is worth mentioning that in method 400, only electronic device 1 is used as the device that plays ultrasonic signals, and electronic devices 2 and 3 are used as the devices that receive ultrasonic signals, to illustrate the method for identifying positions provided in this application embodiment. However, this does not constitute a limitation on the embodiments of this application. For example, in specific implementations, any one of electronic devices 1, 2, and 3 can be used as the device that plays ultrasonic signals, and the other two devices can be used as the devices that receive ultrasonic signals. This application embodiment does not limit this. For example, the device that plays ultrasonic signals can be the device that first establishes a short-range communication connection with the mouse.
[0124] It is worth mentioning that in method 400, the recording function of electronic devices 2 and 3 is only used as an example to illustrate the fact that it is enabled based on the first instruction information. However, this does not constitute a limitation on the embodiments of this application. For example, in a specific implementation, the recording function of electronic devices 2 and 3 can always be enabled. In this case, the mouse may not execute steps 401 and 402 in method 400.
[0125] The following will continue to combine Figure 3 The illustrated scenario, taking the determination of the relative positional relationships between any two electronic devices 1, 2, and 3 using one of these devices as an example, will be used to introduce another method for identifying positions provided in this application's embodiments. Figure 6 An exemplary interactive flowchart of the location identification method 600 is shown. It is worth noting that in method 600, electronic device 1 corresponds to the third electronic device, and electronic devices 2 and 3 each correspond one-to-one with two second electronic devices.
[0126] The electronic devices used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3 can be selected by the user from electronic devices 1, 2, and 3. In other words, any one of electronic devices 1, 2, and 3 may be selected by the user as the electronic device used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3.
[0127] For example, an application with location recognition capabilities can be installed on electronic devices 1, 2, and 3. The user can launch this application on each of these devices; for instance, the user can launch the application by clicking its icon. After the application is launched, electronic device 1 will enter a specific state, such as... Figure 7 The display interface 701 and electronic device 2 shown in Figure (a) enter as follows: Figure 7 The display interface 702 and electronic device 3 shown in Figure (b) enter as follows: Figure 7 As shown in Figure (c), the user can operate the display interface 703 provided by electronic devices 1, 2, and 3 through the display interfaces 701, 702, and 703, thereby achieving the purpose of selecting the electronic device used to determine the relative positional relationship between any two of electronic devices 1, 2, and 3.
[0128] For example, when a user selects electronic device 1 to determine the relative positional relationships between any two of electronic devices 1, 2, and 3, the user can select the "Set Target Electronic Device" option 7011 in display interface 701. When a user selects electronic device 2 to determine the relative positional relationships between any two of electronic devices 1, 2, and 3, the user can select the "Set Target Electronic Device" option 7021 in display interface 702. When a user selects electronic device 3 to determine the relative positional relationships between any two of electronic devices 1, 2, and 3, the user can select the "Set Target Electronic Device" option 7031 in display interface 703. It is worth noting that the target electronic device is the electronic device among electronic devices 1, 2, and 3 used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3.
[0129] After selecting the electronic devices used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3, the user can trigger the start of the location recognition process.
[0130] Suppose the user selects electronic device 1 as the electronic device used to determine the relative positional relationship between any two of electronic devices 1, 2, and 3. For example, the user selects the "Set Target Electronic Device" option 7011 in the display interface 701 of electronic device 1. Based on the detected operation of selecting the "Set Target Electronic Device" option 7011 in the display interface 701, electronic device 1 determines itself as the electronic device used to determine the relative positional relationship between any two of electronic devices 1, 2, and 3.
[0131] After designating electronic device 1 as the device for determining the relative positional relationships between any two of electronic devices 1, 2, and 3, the user can select position recognition option 7012 on the display interface 701 of electronic device 1, thereby triggering the position recognition process. Accordingly, electronic device 1 initiates the position recognition process based on the detected selection of position recognition option 7012.
[0132] After the location identification process begins, electronic device 1 can perform the following steps:
[0133] Step 601: Electronic device 1 sends first instruction information to electronic device 2 and electronic device 3 respectively, instructing electronic device 2 and electronic device 3 to activate their respective recording functions.
[0134] Electronic device 1 can send first instruction information to electronic device 2 and electronic device 3 respectively, to instruct electronic device 2 and electronic device 3 to activate their respective recording functions. For example, electronic device 1 can send first instruction information to electronic device 2 and electronic device 3 respectively based on the short-range communication connection established with electronic device 2 and electronic device 3.
[0135] Step 602: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0136] After electronic device 1 sends the first instruction information to electronic devices 2 and 3, in one implementation, electronic device 1 can directly execute step 604: electronic device 1 plays an ultrasonic signal after sending the first instruction information to electronic devices 2 and 3. For a detailed description of the ultrasonic signal, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0137] In another implementation, after electronic device 1 sends the first instruction information to electronic devices 2 and 3, if electronic device 1 receives confirmation messages from electronic devices 2 and 3, then electronic device 1 executes step 604. Here, the confirmation messages from electronic devices 2 and 3 are responses from electronic devices 2 and 3 to the first instruction information, respectively. In this case, method 600 may also include step 603 before step 604: after electronic devices 2 and 3 have enabled their recording functions, they send confirmation messages to electronic device 1 to inform electronic device 1 that the recording functions of electronic devices 2 and 3 have been enabled.
[0138] Since electronic devices 2 and 3 have their recording functions enabled, when electronic device 1 plays the ultrasonic signal, the ultrasonic signal will be received by electronic devices 2 and 3. Then, electronic devices 2 and 3 can execute step 605, whereby each determines its relative position to electronic device 1 based on the received ultrasonic signal. For the specific methods by which electronic devices 2 and 3 determine their relative position to electronic device 1 based on the received ultrasonic signal, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0139] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 1, step 606 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 1 to electronic device 1.
[0140] Step 607: Based on the relative positional relationships between electronic devices 2 and 3 and electronic devices 1, electronic device 1 determines that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1.
[0141] After determining that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1, electronic device 1 obtains the relative positional relationships between each pair of electronic devices 1, 2, and 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, and 3, electronic device 1 also needs to inform electronic devices 2 and 3 of the relative positional relationships between each pair of electronic devices 1, 2, and 3. In this case, method 600 further includes step 608: electronic device 1 sends the relative positional relationships between each pair of electronic devices 1, 2, and 3 to electronic devices 2 and 3 respectively. For example, electronic device 1 sends to electronic devices 2 and 3 that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1 respectively.
[0142] After obtaining the relative positional relationships between any two electronic devices (electronic devices 1, 2, and 3), the cursor can freely switch between them. For examples of freely switching the cursor between electronic devices 1, 2, and 3, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0143] Figure 8 This illustrates another application scenario of the location identification method provided in the embodiments of this application. Figure 8 The illustration shows three electronic devices, which are referred to as electronic device 1, electronic device 2, and electronic device 3 for ease of description. In one implementation, the relative positional relationship between any two of electronic devices 1, 2, and 3 can be determined by the mouse provided in this embodiment; in another implementation, the relative positional relationship between any two of electronic devices 1, 2, and 3 can be determined by one of the three electronic devices.
[0144] The following is combined Figure 8 The illustrated scenario, using the example of determining the relative positional relationships between any two electronic devices 1, 2, and 3 via a mouse, will be used to introduce an example of a position identification method provided in this application embodiment. Figure 9 An exemplary interactive flowchart of the method 900 for identifying location is shown. It is worth noting that in method 900, the mouse corresponds to the first electronic device, electronic device 1 corresponds to the third electronic device, and electronic devices 2 and 3 each correspond one-to-one with two second electronic devices.
[0145] Step 901: The mouse sends a first instruction message to electronic devices 2 and 3 respectively, instructing them to activate their respective recording functions. For a detailed description of the implementation of step 901, please refer to the relevant description in step 401; for brevity, it will not be repeated here.
[0146] Step 902: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0147] Step 903: After electronic devices 2 and 3 have enabled their respective recording functions, they send a confirmation message to the mouse to indicate that the recording functions of electronic devices 2 and 3 have been enabled.
[0148] Step 904: The mouse sends a second instruction to electronic device 1 to instruct electronic device 1 to play an ultrasonic signal. For example, the mouse sends the first instruction to electronic device 1 based on a short-range communication connection established with electronic device 1. For the specific implementation of steps 902 to 904, please refer to the relevant descriptions in steps 402 to 404. For the sake of brevity, these details will not be repeated here.
[0149] After receiving the second instruction information, electronic device 1 executes step 905, in which it plays an ultrasonic signal. For a detailed description of the implementation of step 905, please refer to the relevant description in step 405; for brevity, it will not be repeated here.
[0150] Step 906: Electronic devices 2 and 3 each determine their relative positional relationship with electronic device 1 based on the received ultrasonic signals.
[0151] Combination Figure 8 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Based on this, electronic device 2 can determine that it is located to the right of electronic device 1. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Based on this, electronic device 3 can determine that it is located to the right of electronic device 1. For the specific methods used by electronic devices 2 and 3 to determine their relative positions to electronic device 1, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0152] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 1, step 907 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 1 to the mouse.
[0153] Step 908: Based on the relative positional relationship between electronic devices 2 and 3 and electronic device 1, the mouse determines that electronic devices 2 and 3 are both located on the same side of electronic device 1, for example, both are located on the right side of electronic device 1.
[0154] Since electronic devices 2 and 3 are both located to the right of electronic device 1, in order to obtain the relative positional relationships between any two electronic devices 1, 2, and 3, the mouse needs to further determine the relative positional relationship between electronic devices 2 and 3. In this case, method 900 may further include the following steps:
[0155] Step 909: The mouse sends a first instruction message to the electronic device 2, which instructs the electronic device 2 to enable the recording function.
[0156] Step 910: Electronic device 2 activates the recording function according to the first instruction information.
[0157] In one implementation, after the mouse sends the first instruction information to the electronic device 2, it can perform step 912: the mouse sends the second instruction information to the electronic device 3 to instruct the electronic device 3 to play an ultrasonic signal. For example, the mouse sends the second instruction information to the electronic device 3 based on the short-range communication connection established between the mouse and the electronic device 3.
[0158] In another implementation, after the mouse sends the first instruction information to the electronic device 2, if the mouse receives a confirmation message from the electronic device 2, the mouse executes step 912. Here, the confirmation message from the electronic device 2 is the electronic device 2's response to the first instruction information. In this case, method 900 may further include step 911 before step 912: After the electronic device 2 activates its recording function, it sends a confirmation message to the mouse to inform the mouse that the recording function of the electronic device 2 has been activated.
[0159] After receiving the second instruction information, electronic device 3 executes step 913: playing ultrasonic signals.
[0160] Since electronic device 2 has the recording function enabled, when electronic device 3 plays the ultrasonic signal, the ultrasonic signal will be received by electronic device 2. Then electronic device 2 can execute step 914, and electronic device 2 determines the relative positional relationship with electronic device 3 based on the received ultrasonic signal.
[0161] Combination Figure 8 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine that the ultrasonic signal that arrived at the recording module of electronic device 2 earlier is the ultrasonic signal output by the left speaker of electronic device 3, based on the difference between the arrival times of the two ultrasonic signals. Based on this, electronic device 2 can determine that it is located to the left of electronic device 3.
[0162] After determining its relative position to electronic device 3, electronic device 2 can execute step 915: electronic device 2 sends its relative position to electronic device 3 to the mouse.
[0163] Step 916: Based on the relative positional relationship between electronic device 2 and electronic device 3 and electronic device 1, the mouse determines that electronic device 2 is located to the left of electronic device 3.
[0164] After determining that electronic device 2 is located to the left of electronic device 3, in conjunction with step 908, the mouse can determine that electronic device 2 is located to the right of electronic device 1 and to the left of electronic device 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, and 3, the mouse also needs to inform each device of the relative positional relationship between each pair of electronic devices 1, 2, and 3. In this case, method 900 also includes step 917: the mouse sends the relative positional relationship between each pair of electronic devices 1, 2, and 3 to electronic devices 1, 2, and 3 respectively. For example, the mouse sends to electronic devices 1, 2, and 3 that electronic device 2 is located to the right of electronic device 1 and to the left of electronic device 3 respectively.
[0165] After obtaining the relative positional relationships between any two electronic devices (electronic devices 1, 2, and 3), the cursor can freely switch between them. For examples of freely switching the cursor between electronic devices 1, 2, and 3, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0166] It should be understood that the above description only illustrates the method of determining the relative positional relationship between electronic devices 2 and 3 by taking the example of electronic device 2 activating the recording function and electronic device 3 playing the ultrasonic signal. However, this does not constitute a limitation on the embodiments of this application. For example, in a specific implementation, the mouse can instruct electronic device 3 to activate the recording function and instruct electronic device 2 to play the ultrasonic signal.
[0167] The following will continue to combine Figure 8 The illustrated scenario, taking the determination of the relative positional relationships between any two electronic devices 1, 2, and 3 using one of these devices, will be used to introduce another example of a position identification method provided in this application. Figure 10An exemplary interactive flowchart of the method 1000 for identifying location is shown. It is worth mentioning that in method 1000, electronic device 1 corresponds to the third electronic device, and electronic devices 2 and 3 each correspond to two second electronic devices.
[0168] The electronic devices used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3 can be selected by the user from electronic devices 1, 2, and 3. In other words, any one of electronic devices 1, 2, and 3 may be selected by the user as the electronic device used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3.
[0169] Assuming the user selects electronic device 1 as the device used to determine the relative positional relationships between any two of electronic devices 1, 2, and 3, and after selecting the device and establishing a short-range communication connection between any one of these devices and the other two, the user can trigger the location identification process. For details regarding the user's selection of the device for determining the relative positional relationships between any two of these devices, the establishment of the short-range communication connection between any one of these devices and the other two, and the user's triggering of the location identification process, please refer to the relevant descriptions in method 600. For brevity, these details will not be repeated here.
[0170] After the location identification process begins, electronic device 1 can perform the following steps:
[0171] In step 1001, electronic device 1 sends first instruction information to electronic devices 2 and 3 respectively, instructing them to activate their respective recording functions. For a detailed description of the implementation of step 1001, please refer to the relevant description in step 601; for brevity, it will not be repeated here.
[0172] Step 1002: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0173] Step 1003: After activating their recording functions, electronic devices 2 and 3 send a confirmation message to electronic device 1 to inform electronic device 1 that the recording functions of electronic devices 2 and 3 have been activated.
[0174] Step 1004: Electronic device 1 plays an ultrasonic signal. For details on the implementation of steps 1002 to 1004, please refer to the relevant descriptions in steps 602 to 604; for brevity, they will not be repeated here.
[0175] Since electronic devices 2 and 3 have their respective recording functions enabled, when electronic device 1 plays an ultrasonic signal, the ultrasonic signal will be received by electronic devices 2 and 3. Then, electronic devices 2 and 3 can execute step 1005, whereby electronic devices 2 and 3 determine their relative positional relationship with electronic device 1 based on the received ultrasonic signal.
[0176] Combination Figure 8 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Based on this, electronic device 2 can determine that it is located to the right of electronic device 1. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Based on this, electronic device 3 can determine that it is located to the right of electronic device 1. For the specific methods used by electronic devices 2 and 3 to determine their relative positions to electronic device 1, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0177] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 1, step 1006 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 1 to electronic device 1.
[0178] Step 1007: Electronic device 1 determines that electronic devices 2 and 3 are both located on the same side of electronic device 1, for example, on the right side of electronic device 1, based on the relative positional relationship between electronic devices 2 and 3 and electronic device 1.
[0179] Since electronic devices 2 and 3 are both located to the right of electronic device 1, in order to obtain the relative positional relationships between any two electronic devices 1, 2, and 3, electronic device 1 needs to further determine the relative positional relationship between electronic devices 2 and 3. In this case, method 1000 may further include the following steps:
[0180] Step 1008: Electronic device 1 sends a first instruction message to electronic device 2, which instructs electronic device 2 to enable the recording function.
[0181] Step 1009: Electronic device 2 activates the recording function according to the first instruction information.
[0182] In one implementation, after sending the first instruction information to the electronic device 2, the electronic device 1 can perform step 1011: the electronic device 1 sends the second instruction information to the electronic device 3 to instruct the electronic device 3 to play the ultrasonic signal. For example, the electronic device 1 sends the second instruction information to the electronic device 3 based on the short-range communication connection established between the electronic device 1 and the electronic device 3.
[0183] In another implementation, after electronic device 1 sends the first instruction information to electronic device 2, if electronic device 1 receives a confirmation message from electronic device 2, then electronic device 1 executes step 1011. Here, the confirmation message from electronic device 2 is electronic device 2's response to the first instruction information. In this case, method 1000 may further include step 1010 before step 1011: After electronic device 2 activates its recording function, it sends a confirmation message to electronic device 1 to inform electronic device 1 that its recording function is activated.
[0184] After receiving the second instruction information, the electronic device 3 executes step 1012: playing the ultrasonic signal.
[0185] Since electronic device 2 has the recording function enabled, when electronic device 3 plays the ultrasonic signal, the ultrasonic signal will be received by electronic device 2. Then electronic device 2 can execute step 1013, and electronic device 2 determines the relative positional relationship with electronic device 3 based on the received ultrasonic signal.
[0186] Combination Figure 8 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine that the ultrasonic signal that arrived at the recording module of electronic device 2 earlier is the ultrasonic signal output by the left speaker of electronic device 3, based on the difference between the arrival times of the two ultrasonic signals. Based on this, electronic device 2 can determine that it is located to the left of electronic device 3.
[0187] After determining its relative position to electronic device 3, electronic device 2 can execute step 1014: electronic device 2 sends its relative position to electronic device 3 to electronic device 1.
[0188] Step 1015: Electronic device 1 determines that electronic device 2 is located to the left of electronic device 3 based on the relative positional relationship between electronic device 2 and electronic device 3 and electronic device 1.
[0189] After determining that electronic device 2 is located to the left of electronic device 3, in conjunction with step 1007, electronic device 1 can determine that electronic device 2 is located to the right of electronic device 1 and to the left of electronic device 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, and 3, electronic device 1 also needs to inform electronic devices 2 and 3 of the relative positional relationships between each pair of electronic devices 1, 2, and 3. In this case, method 1000 also includes step 1016: electronic device 1 sends the relative positional relationships between each pair of electronic devices 1, 2, and 3 to electronic devices 2 and 3 respectively. For example, electronic device 1 sends to electronic devices 2 and 3 that electronic device 2 is located to the right of electronic device 1 and to the left of electronic device 3 respectively.
[0190] After obtaining the relative positional relationships between any two electronic devices (electronic devices 1, 2, and 3), the cursor can freely switch between them. For examples of freely switching the cursor between electronic devices 1, 2, and 3, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0191] Figure 11 This illustrates another application scenario of the location identification method provided in the embodiments of this application. Figure 11 The illustration shows four electronic devices, which, for ease of description, are referred to as electronic device 1, electronic device 2, electronic device 3, and electronic device 4. In one implementation, the relative positional relationship between any two of electronic devices 1, 2, 3, and 4 can be determined by the mouse provided in this embodiment; in another implementation, the relative positional relationship between any two of electronic devices 1, 2, 3, and 4 can be determined by one of the electronic devices 1, 2, 3, and 4.
[0192] The following is combined Figure 11 The illustrated scenario, using the example of determining the relative positional relationships between any two electronic devices 1, 2, 3, and 4 via a mouse, further illustrates another method for position identification provided in this application. Figure 12An exemplary interactive flowchart of the method 1200 for identifying locations is shown. It is worth noting that in method 1200, the mouse corresponds to the first electronic device, electronic device 1 corresponds to the third electronic device, and electronic devices 2, 3, and 4 each correspond to three second electronic devices.
[0193] Step 1201: The mouse sends first instruction information to electronic devices 2, 3, and 4 respectively, to instruct electronic devices 2, 3, and 4 to enable their respective recording functions.
[0194] Before determining the relative positions of any two electronic devices (1, 2, 3, and 4), the mouse needs to establish short-range communication connections with each of them, such as a Bluetooth connection, to facilitate communication during the process of determining the relative positions of any two electronic devices (1, 2, 3, and 4).
[0195] After the mouse establishes short-range communication connections with electronic devices 1, 2, 3, and 4 respectively, the mouse position recognition process can be triggered. For details on how to trigger the mouse position recognition process, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0196] After the location recognition process begins, the mouse can send first instruction information to electronic devices 2, 3, and 4 respectively based on the short-range communication connection established with electronic devices 2, 3, and 4, so as to instruct electronic devices 2, 3, and 4 to activate their respective recording functions.
[0197] Step 1202: Electronic devices 2, 3, and 4 activate their respective recording functions according to the first instruction information they receive.
[0198] After the mouse sends the first instruction information to electronic devices 2, 3, and 4, in one implementation, the mouse can directly execute step 1204 after sending the first instruction information to electronic devices 2, 3, and 4: the mouse sends the second instruction information to electronic device 1 to instruct electronic device 1 to play an ultrasonic signal, for example: sending the second instruction information to electronic device 1 based on the short-range communication connection established with electronic device 1.
[0199] In another implementation, after the mouse sends the first instruction information to electronic devices 2, 3, and 4, if the mouse receives an acknowledgment message from electronic devices 2, 3, and 4, then the mouse executes step 1204. The acknowledgment message from electronic devices 2, 3, and 4 is a response from each of them to the first instruction information. In this case, method 1200 may further include step 1203 before step 1204: After enabling their own recording functions, electronic devices 2, 3, and 4 send an acknowledgment message to the mouse to inform it that the recording functions of electronic devices 2, 3, and 4 are enabled.
[0200] After receiving the second instruction information, electronic device 1 executes step 1205: playing an ultrasonic signal.
[0201] Since electronic devices 2, 3, and 4 have their respective recording functions enabled, when electronic device 1 plays an ultrasonic signal, the ultrasonic signal will be received by electronic devices 2, 3, and 4. Then, electronic devices 2, 3, and 4 can execute step 1206, whereby each of them determines its relative position to electronic device 1 based on the received ultrasonic signal.
[0202] Combination Figure 11 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 2 can determine that it is located to the right of electronic device 1. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 3 can determine that it is located to the right of electronic device 1. Likewise, after receiving two ultrasonic signals, electronic device 4 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the left speaker of electronic device 1. Therefore, electronic device 4 can determine that it is located to the left of electronic device 1. For the specific methods used by electronic devices 2, 3, and 4 to determine their relative positions to electronic device 1, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0203] After electronic devices 2, 3, and 4 determine their relative positional relationship with electronic device 1, step 1207 can be executed: electronic devices 2, 3, and 4 send their relative positional relationship with electronic device 1 to the mouse.
[0204] Step 1208: Based on the relative positions of electronic devices 2, 3, and 4 with respect to electronic device 1, the mouse determines that electronic devices 2 and 3 are both located to the right of electronic device 1, and electronic device 4 is located to the left of electronic device 1.
[0205] Since electronic devices 2 and 3 are both located to the right of electronic device 1, in order to obtain the relative positional relationships between any two electronic devices 1, 2, 3, and 4, the mouse needs to further determine the relative positional relationship between electronic devices 2 and 3. In this case, method 1200 may also include the following steps:
[0206] Step 1209: The mouse sends a first instruction message to the electronic device 2, which instructs the electronic device 2 to enable the recording function.
[0207] Step 1210: Electronic device 2 starts the recording function according to the first instruction information.
[0208] In one implementation, after the mouse sends the first instruction information to the electronic device 2, it can perform step 1212: the mouse sends the second instruction information to the electronic device 3 to instruct the electronic device 3 to play an ultrasonic signal. For example, the mouse sends the second instruction information to the electronic device 3 based on the short-range communication connection established between the mouse and the electronic device 3.
[0209] In another implementation, after the mouse sends the first instruction information to the electronic device 2, if the mouse receives a confirmation message from the electronic device 2, the mouse executes step 1212. Here, the confirmation message from the electronic device 2 is the electronic device 2's response to the first instruction information. In this case, method 1200 may further include step 1211 before step 1212: After the electronic device 2 activates its recording function, it sends a confirmation message to the mouse to inform the mouse that the recording function of the electronic device 2 has been activated.
[0210] After receiving the second instruction information, electronic device 3 executes step 1213: playing ultrasonic signals.
[0211] Since electronic device 2 has the recording function enabled, when electronic device 3 plays the ultrasonic signal, the ultrasonic signal will be received by electronic device 2. Then electronic device 2 can execute step 1214, and electronic device 2 determines the relative positional relationship with electronic device 3 based on the received ultrasonic signal.
[0212] Combination Figure 11 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine that the ultrasonic signal that arrived at the recording module of electronic device 2 earlier is the ultrasonic signal output by the left speaker of electronic device 3, based on the difference between the arrival times of the two ultrasonic signals. Based on this, electronic device 2 can determine that it is located to the left of electronic device 3.
[0213] After determining its relative position to electronic device 3, electronic device 2 can execute step 1215: electronic device 2 sends its relative position to electronic device 3 to the mouse.
[0214] Step 1216: Based on the relative positional relationship between electronic device 2 and electronic device 3 sent by electronic device 2, the mouse determines that electronic device 2 is located to the left of electronic device 3.
[0215] After determining that electronic device 2 is located to the left of electronic device 3, in conjunction with step 1208, the mouse can determine that electronic device 4 is located to the left of electronic device 1, electronic device 2 is located to the right of electronic device 1, and electronic device 2 is located to the left of electronic device 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, 3, and 4, the mouse also needs to inform each device of the relative positional relationship between each pair of electronic devices 1, 2, 3, and 4. In this case, method 1200 also includes step 1217: the mouse sends the relative positional relationship between each pair of electronic devices 1, 2, 3, and 4 to electronic devices 1, 2, 3, and 4 respectively. For example, the mouse sends to electronic devices 1, 2, 3, and 4 that electronic device 4 is located to the left of electronic device 1, electronic device 2 is located to the right of electronic device 1, and electronic device 2 is located to the left of electronic device 3.
[0216] After obtaining the relative positional relationships between each pair of electronic devices 1, 2, 3, and 4, the cursor can freely switch between them. For examples of how the cursor can freely switch between these devices, please refer to the relevant description in Method 400; for brevity, it will not be repeated here.
[0217] The following will continue to combine Figure 11 The illustrated scenario, taking the determination of the relative positional relationships between any two electronic devices 1, 2, 3, and 4 using one of these devices as an example, further illustrates the position identification method provided in this application embodiment. Figure 13 An exemplary interactive flowchart of the location identification method 1300 is shown. It is worth noting that in method 1300, electronic device 1 corresponds to the third electronic device, and electronic devices 2, 3, and 4 each correspond to three second electronic devices.
[0218] The electronic devices used to determine the relative positional relationships between any two of electronic devices 1, 2, 3, and 4 can be selected by the user from among electronic devices 1, 2, 3, and 4. In other words, any one of electronic devices 1, 2, 3, and 4 may be selected by the user as the electronic device used to determine the relative positional relationships between any two of electronic devices 1, 2, 3, and 4.
[0219] Assuming the user selects electronic device 1 as the device used to determine the relative positional relationships between any two of electronic devices 1, 2, 3, and 4, after selecting the device and establishing a short-range communication connection between any one of these devices and the other two, the user can trigger the location identification process. For details regarding the specific implementation of the user's selection of the device for determining the relative positional relationships between any two of these devices, the specific implementation of establishing a short-range communication connection between any one of these devices and the other two, and the specific implementation of the user triggering the location identification process, please refer to the relevant descriptions in Method 600. For simplicity, these details will not be repeated here.
[0220] After the location identification process begins, electronic device 1 can perform the following steps:
[0221] Step 1301: Electronic device 1 sends first instruction information to electronic devices 2, 3, and 4 respectively, to instruct electronic devices 2, 3, and 4 to activate their respective recording functions.
[0222] Electronic device 1 can send first instruction information to electronic devices 2, 3, and 4 respectively based on the short-range communication connection established with electronic devices 2, 3, and 4, so as to instruct electronic devices 2, 3, and 4 to activate their respective recording functions.
[0223] Step 1302: Electronic devices 2, 3, and 4 activate their respective recording functions according to the first instruction information they receive.
[0224] After electronic device 1 sends the first instruction information to electronic devices 2, 3, and 4, in one implementation, electronic device 1 can directly execute step 1304: electronic device 1 plays an ultrasonic signal. For a detailed description of the ultrasonic signal, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0225] In another implementation, after electronic device 1 sends the first instruction information to electronic devices 2, 3, and 4, if electronic device 1 receives confirmation messages from electronic devices 2, 3, and 4, then electronic device 1 executes step 1304. The confirmation messages from electronic devices 2, 3, and 4 are responses from each of them to the first instruction information. In this case, method 1300 may further include step 1303 before step 1304: After activating their own recording functions, electronic devices 2, 3, and 4 send confirmation messages to electronic device 1 to inform electronic device 1 that their recording functions are activated.
[0226] Since electronic devices 2, 3, and 4 have their respective recording functions enabled, when electronic device 1 plays an ultrasonic signal, the ultrasonic signal will be received by electronic devices 2, 3, and 4. Then, electronic devices 2, 3, and 4 can execute step 1305, whereby each of them determines its relative position to electronic device 1 based on the received ultrasonic signal.
[0227] Combination Figure 11As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 2 can determine that it is located to the right of electronic device 1. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 3 can determine that it is located to the right of electronic device 1. Likewise, after receiving two ultrasonic signals, electronic device 4 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the left speaker of electronic device 1. Therefore, electronic device 4 can determine that it is located to the left of electronic device 1. For the specific methods used by electronic devices 2, 3, and 4 to determine their relative positions to electronic device 1, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0228] After electronic devices 2, 3, and 4 determine their relative positional relationship with electronic device 1, step 1306 can be executed: electronic devices 2, 3, and 4 send their relative positional relationship with electronic device 1 to electronic device 1.
[0229] Step 1307: Based on the relative positional relationships between electronic devices 2, 3, and 4 and electronic devices 1, electronic device 1 determines that electronic device 2 is located to the right of electronic device 1, electronic device 3 is located to the right of electronic device 1, and electronic device 4 is located to the left of electronic device 1.
[0230] Since electronic devices 2 and 3 are both located to the right of electronic device 1, in order to obtain the relative positional relationships between any two electronic devices 1, 2, 3, and 4, electronic device 1 needs to further determine the relative positional relationship between electronic devices 2 and 3. In this case, method 1300 may further include the following steps:
[0231] Step 1308: Electronic device 1 sends a first instruction message to electronic device 2, which instructs electronic device 2 to enable the recording function.
[0232] Step 1309: Electronic device 2 activates the recording function according to the first instruction information.
[0233] After electronic device 1 sends the first instruction information to electronic device 2, in one implementation, electronic device 1 can directly execute step 1311 after sending the first instruction information to electronic device 2: electronic device 1 sends the second instruction information to electronic device 3 to instruct electronic device 3 to play the ultrasonic signal. For example, electronic device 1 sends the second instruction information to electronic device 3 based on the short-range communication connection established between electronic device 1 and electronic device 3.
[0234] In another implementation, after electronic device 1 sends the first instruction information to electronic device 2, if electronic device 1 receives a confirmation message from electronic device 2, then electronic device 1 executes step 1311. Here, the confirmation message from electronic device 2 is electronic device 2's response to the first instruction information. In this case, method 1300 may further include step 1310 before step 1311: After electronic device 2 activates its recording function, it sends a confirmation message to electronic device 1 to inform electronic device 1 that its recording function is activated.
[0235] After receiving the second instruction information, electronic device 3 executes step 1312: playing ultrasonic signals.
[0236] Since electronic device 2 has the recording function enabled, when electronic device 3 plays the ultrasonic signal, the ultrasonic signal will be received by electronic device 2. Then electronic device 2 can execute step 1313, and electronic device 2 determines the relative positional relationship with electronic device 3 based on the received ultrasonic signal.
[0237] Combination Figure 11 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine that the ultrasonic signal that arrived at the recording module of electronic device 2 earlier is the ultrasonic signal output by the left speaker of electronic device 3, based on the difference between the arrival times of the two ultrasonic signals. Based on this, electronic device 2 can determine that it is located to the left of electronic device 3.
[0238] After determining its relative position to electronic device 3, electronic device 2 can execute step 1314: electronic device 2 sends its relative position to electronic device 3 to electronic device 1.
[0239] Step 1315: Electronic device 1 determines that electronic device 2 is located to the left of electronic device 3 based on the relative positional relationship between electronic device 2 and electronic device 3 sent by electronic device 2.
[0240] After determining that electronic device 2 is located to the left of electronic device 3, in conjunction with step 1307, electronic device 1 can determine that electronic device 4 is located to the left of electronic device 1, electronic device 2 is located to the right of electronic device 1, and is located to the left of electronic device 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, 3, and 4, electronic device 1 also needs to inform electronic devices 2, 3, and 4 of the relative positional relationships between each pair of electronic devices 1, 2, 3, and 4. In this case, method 1300 also includes step 1316: electronic device 1 sends the relative positional relationships between each pair of electronic devices 1, 2, 3, and 4 to electronic devices 2, 3, and 4. For example, electronic device 1 sends to electronic devices 2, 3, and 4 that electronic device 4 is located to the left of electronic device 1, electronic device 2 is located to the right of electronic device 1, and electronic device 2 is located to the left of electronic device 3.
[0241] After obtaining the relative positional relationships between any two electronic devices (electronic devices 1, 2, 3, and 4), the cursor can freely switch between these devices. For examples of free cursor switching between these devices, please refer to the relevant description in method 400; for brevity, it will not be repeated here.
[0242] Figure 14 This illustrates another application scenario of the location identification method provided in the embodiments of this application. Figure 14 The illustration shows four electronic devices, which, for ease of description, are referred to as electronic device 1, electronic device 2, electronic device 3, and electronic device 4. In one implementation, the relative positional relationship between any two of electronic devices 1, 2, 3, and 4 can be determined by the mouse provided in this embodiment; in another implementation, the relative positional relationship between any two of electronic devices 1, 2, 3, and 4 can be determined by one of the electronic devices 1, 2, 3, and 4.
[0243] The following is combined Figure 14 The illustrated scenario, using the example of determining the relative positional relationships between any two electronic devices 1, 2, 3, and 4 via a mouse, further illustrates another method for position identification provided in this application. Figure 15An exemplary interactive flowchart of the method 1500 for identifying locations is shown. It is worth noting that in method 1500, the mouse corresponds to the first electronic device, electronic device 1 corresponds to the third electronic device, and electronic devices 2, 3, and 4 each correspond to three second electronic devices.
[0244] Step 1501: The mouse sends first instruction information to electronic devices 2, 3, and 4 respectively, to instruct electronic devices 2, 3, and 4 to enable their respective recording functions.
[0245] Step 1502: Electronic devices 2, 3, and 4 activate their respective recording functions according to the first instruction information they receive.
[0246] Step 1503: After activating their own recording functions, electronic devices 2, 3, and 4 send a confirmation message to the mouse to inform it that the recording functions of electronic devices 2, 3, and 4 have been activated.
[0247] Step 1504: The mouse sends a second instruction to the electronic device 1 to instruct the electronic device 1 to play an ultrasonic signal, for example: sending the second instruction to the electronic device 1 based on the short-range communication connection established with the electronic device 1.
[0248] Step 1505: Electronic device 1 plays an ultrasonic signal. For a detailed description of steps 1501 to 1505, please refer to the relevant descriptions of steps 1201 to 1205 in method 1200. For the sake of brevity, they will not be repeated here.
[0249] Since electronic devices 2, 3, and 4 have their respective recording functions enabled, when electronic device 1 plays an ultrasonic signal, the ultrasonic signal will be received by electronic devices 2, 3, and 4. Then, electronic devices 2, 3, and 4 can execute step 1506, whereby each of them determines its relative position to electronic device 1 based on the received ultrasonic signal.
[0250] Combination Figure 14As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 2 can determine that it is located to the right of electronic device 1. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 3 can determine that it is located to the right of electronic device 1. Likewise, after receiving two ultrasonic signals, electronic device 4 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 4 can determine that it is located to the right of electronic device 1. For the specific methods used by electronic devices 2, 3, and 4 to determine their relative positions to electronic device 1, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0251] After electronic devices 2, 3, and 4 determine their relative positional relationship with electronic device 1, step 1507 can be executed, in which electronic devices 2, 3, and 4 send their relative positional relationship with electronic device 1 to the mouse.
[0252] Step 1508: Based on the relative positional relationships between electronic devices 2, 3, and 4 and electronic device 1, the mouse determines that electronic devices 2, 3, and 4 are all located to the right of electronic device 1.
[0253] Since electronic devices 2, 3, and 4 are all located to the right of electronic device 1, in order to obtain the relative positional relationships between any two of electronic devices 1, 2, 3, and 4, the mouse needs to further determine the relative positional relationships between any two of electronic devices 2, 3, and 4. In this case, method 1500 may further include the following steps:
[0254] Step 1509: The mouse sends first instruction information to electronic devices 2 and 3 respectively, instructing electronic devices 2 and 3 to turn on their respective recording functions.
[0255] Step 1510: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0256] After the mouse sends the first instruction information to electronic devices 2 and 3, in one implementation, the mouse can directly execute step 1512 after sending the first instruction information to electronic devices 2 and 3: the mouse sends the second instruction information to electronic device 4 to instruct electronic device 4 to play an ultrasonic signal. For example, the mouse sends the second instruction information to electronic device 4 based on the short-range communication connection established with electronic device 4.
[0257] In another implementation, after the mouse sends the first instruction information to electronic devices 2 and 3, if the mouse receives an acknowledgment message from electronic devices 2 and 3, such as an Ack message, the mouse executes step 1512. Here, the acknowledgment message from electronic devices 2 and 3 is the response of electronic devices 2 and 3 to the first instruction information. In this case, method 1500 may also include step 1511 before step 1512: after electronic devices 2 and 3 have enabled their recording functions, they send an acknowledgment message to the mouse to inform the mouse that the recording functions of electronic devices 2 and 3 have been enabled.
[0258] After receiving the second instruction information, electronic device 4 executes step 1513: playing an ultrasonic signal.
[0259] Since electronic devices 2 and 3 have their respective recording functions enabled, when electronic device 4 plays the ultrasonic signal, the ultrasonic signal will be received by electronic devices 2 and 3. Then, electronic devices 2 and 3 can execute step 1514, whereby electronic devices 2 and 3 determine their relative positional relationship with electronic device 4 based on the received ultrasonic signal.
[0260] Combination Figure 14 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the earlier ultrasonic signal arriving at its recording module is the one output by the left speaker of electronic device 4. Based on this, electronic device 2 can determine that it is located to the left of electronic device 4. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the earlier ultrasonic signal arriving at its recording module is the one output by the left speaker of electronic device 4. Based on this, electronic device 3 can determine that it is located to the left of electronic device 4. For the specific methods used by electronic devices 2 and 3 to determine their relative positions to electronic device 4, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0261] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 4, step 1515 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 4 to the mouse.
[0262] Step 1516: Based on the relative positional relationship between electronic devices 2 and 3 and electronic device 4, the mouse determines that electronic devices 2 and 3 are both located to the left of electronic device 4.
[0263] Since electronic devices 2 and 3 are both located to the right of electronic device 4, in order to obtain the relative positional relationships between any two electronic devices 1, 2, 3, and 4, the mouse needs to further determine the relative positional relationship between electronic devices 2 and 3. In this case, method 1500 may also include the following steps:
[0264] Step 1517: The mouse sends a first instruction message to the electronic device 2, which instructs the electronic device 2 to enable the recording function.
[0265] Step 1518: Electronic device 2 activates the recording function according to the first instruction information.
[0266] In one implementation, after the mouse sends the first instruction information to the electronic device 2, it can perform step 1520: the mouse sends the second instruction information to the electronic device 3 to instruct the electronic device 3 to play an ultrasonic signal. For example, the mouse sends the second instruction information to the electronic device 3 based on the short-range communication connection established between the mouse and the electronic device 3.
[0267] In another implementation, after the mouse sends the first instruction information to the electronic device 2, if the mouse receives a confirmation message from the electronic device 2, the mouse executes step 1520. Here, the confirmation message from the electronic device 2 is the electronic device 2's response to the first instruction information. In this case, method 1500 may further include step 1519 before step 1520: After the electronic device 2 activates its recording function, it sends a confirmation message to the mouse to inform the mouse that the recording function of the electronic device 2 is activated.
[0268] After receiving the second instruction information, electronic device 3 executes step 1521: playing an ultrasonic signal.
[0269] Since electronic device 2 has the recording function enabled, when electronic device 3 plays the ultrasonic signal, the ultrasonic signal will be received by electronic device 2. Then electronic device 2 can execute step 1522, and electronic device 2 determines the relative positional relationship with electronic device 3 based on the received ultrasonic signal.
[0270] Combination Figure 14 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine that the ultrasonic signal that arrived at the recording module of electronic device 2 earlier is the ultrasonic signal output by the left speaker of electronic device 3, based on the difference between the arrival times of the two ultrasonic signals. Based on this, electronic device 2 can determine that it is located to the left of electronic device 3.
[0271] After electronic device 2 determines its relative position to electronic device 3, it can proceed to step 1523:
[0272] Electronic device 2 sends the relative positional relationship between itself and electronic device 3 to the mouse.
[0273] Step 1524: Based on the relative positional relationship between electronic device 2 and electronic device 3 sent by electronic device 2, the mouse determines that electronic device 2 is located to the left of electronic device 3.
[0274] After determining that electronic device 2 is located to the left of electronic device 3, in conjunction with steps 1508, 1516, and 1524, the mouse can determine that electronic device 2 is located to the right of electronic device 1, electronic device 3 is located to the right of electronic device 2, and electronic device 4 is located to the right of electronic device 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, 3, and 4, the mouse also needs to inform each device of the relative positional relationship between each pair of electronic devices 1, 2, 3, and 4. In this case, method 1500 also includes step 1525: the mouse sends the relative positional relationship between each pair of electronic devices 1, 2, 3, and 4 to electronic devices 1, 2, 3, and 4 respectively. For example, the mouse sends to electronic devices 1, 2, 3, and 4 that electronic device 2 is located to the right of electronic device 1, electronic device 3 is located to the right of electronic device 2, and electronic device 4 is located to the right of electronic device 3 respectively.
[0275] After obtaining the relative positional relationships between each pair of electronic devices 1, 2, 3, and 4, the cursor can freely switch between them. For examples of how the cursor can freely switch between these devices, please refer to the relevant description in Method 400; for brevity, it will not be repeated here.
[0276] The following will continue to combine Figure 14The illustrated scenario, taking the determination of the relative positional relationships between any two electronic devices 1, 2, 3, and 4 using one of these devices as an example, further illustrates the position identification method provided in this application embodiment. Figure 16 An exemplary interactive flowchart of the location identification method 1600 is shown. It is worth noting that in method 1600, electronic device 1 corresponds to the third electronic device, and electronic devices 2, 3, and 4 each correspond to three second electronic devices.
[0277] The electronic devices used to determine the relative positional relationships between any two of electronic devices 1, 2, 3, and 4 can be selected by the user from among electronic devices 1, 2, 3, and 4. In other words, any one of electronic devices 1, 2, 3, and 4 may be selected by the user as the electronic device used to determine the relative positional relationships between any two of electronic devices 1, 2, 3, and 4.
[0278] Assuming the user selects electronic device 1 as the device used to determine the relative positional relationships between any two of electronic devices 1, 2, 3, and 4, after selecting the device and establishing a short-range communication connection between any one of these devices and the other two, the user can trigger the location identification process. For details regarding the specific implementation of the user's selection of the device for determining the relative positional relationships between any two of these devices, the specific implementation of establishing a short-range communication connection between any one of these devices and the other two, and the specific implementation of the user triggering the location identification process, please refer to the relevant descriptions in Method 600. For simplicity, these details will not be repeated here.
[0279] After the location identification process begins, electronic device 1 can perform the following steps:
[0280] Step 1601: Electronic device 1 sends first instruction information to electronic devices 2, 3, and 4 respectively, to instruct electronic devices 2, 3, and 4 to activate their respective recording functions.
[0281] Step 1602: Electronic devices 2, 3, and 4 activate their respective recording functions according to the first instruction information they receive.
[0282] Step 1603: After activating their own recording functions, electronic devices 2, 3, and 4 send a confirmation message to electronic device 1 to inform electronic device 1 that the recording functions of electronic devices 2, 3, and 4 have been activated.
[0283] Step 1604: Electronic device 1 plays an ultrasonic signal. For a detailed description of steps 1601 to 1604, please refer to the relevant descriptions of steps 1301 to 1304 in method 1300. For the sake of brevity, they will not be repeated here.
[0284] Since electronic devices 2, 3, and 4 have their respective recording functions enabled, when electronic device 1 plays an ultrasonic signal, the ultrasonic signal will be received by electronic devices 2, 3, and 4. Then, electronic devices 2, 3, and 4 can execute step 1605, whereby each of them determines its relative position to electronic device 1 based on the received ultrasonic signal.
[0285] Combination Figure 14 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 2 can determine that it is located to the right of electronic device 1. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 3 can determine that it is located to the right of electronic device 1. Likewise, after receiving two ultrasonic signals, electronic device 4 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the ultrasonic signal arriving earlier is the one output by the right speaker of electronic device 1. Therefore, electronic device 4 can determine that it is located to the right of electronic device 1. For the specific methods used by electronic devices 2, 3, and 4 to determine their relative positions to electronic device 1, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0286] After electronic devices 2, 3, and 4 determine their relative positional relationship with electronic device 1, step 1606 can be executed: electronic devices 2, 3, and 4 send their relative positional relationship with electronic device 1 to electronic device 1.
[0287] Step 1607: Based on the relative positional relationships between electronic devices 2, 3, and 4 and electronic devices 1, electronic device 1 determines that electronic devices 2, 3, and 4 are all located to the right of electronic device 1.
[0288] Since electronic devices 2, 3, and 4 are all located to the right of electronic device 1, in order to obtain the relative positional relationships between each pair of electronic devices 1, 2, 3, and 4, electronic device 1 needs to further determine the relative positional relationships between each pair of electronic devices 2, 3, and 4. In this case, method 1600 may further include the following steps:
[0289] Step 1608: Electronic device 1 sends first instruction information to electronic devices 2 and 3 respectively, instructing electronic devices 2 and 3 to activate their respective recording functions.
[0290] Step 1609: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0291] After electronic device 1 sends the first instruction information to electronic devices 2 and 3, in one implementation, electronic device 1 can directly execute step 1611 after sending the first instruction information to electronic devices 2 and 3: electronic device 1 sends the second instruction information to electronic device 4 to instruct electronic device 4 to play an ultrasonic signal. For example, electronic device 1 sends the second instruction information to electronic device 4 based on the short-range communication connection established between electronic device 1 and electronic device 4.
[0292] In another implementation, after electronic device 1 sends the first instruction information to electronic devices 2 and 3, if electronic device 1 receives confirmation messages from electronic devices 2 and 3, such as Ack messages, then electronic device 1 executes step 1611. In this case, the confirmation messages from electronic devices 2 and 3 are responses from electronic devices 2 and 3 to the first instruction information. Method 1600 may also include step 1610 before step 1611: After electronic devices 2 and 3 have enabled their recording functions, they send confirmation messages to electronic device 1 to inform electronic device 1 that the recording functions of electronic devices 2 and 3 have been enabled.
[0293] After receiving the second instruction information, electronic device 4 executes step 1612: playing an ultrasonic signal.
[0294] Since electronic devices 2 and 3 have their respective recording functions enabled, when electronic device 4 plays the ultrasonic signal, the ultrasonic signal will be received by electronic devices 2 and 3. Then, electronic devices 2 and 3 can execute step 1613, whereby electronic devices 2 and 3 determine their relative positional relationship with electronic device 4 based on the received ultrasonic signal.
[0295] Combination Figure 14 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the earlier ultrasonic signal arriving at its recording module is the one output by the left speaker of electronic device 4. Based on this, electronic device 2 can determine that it is located to the left of electronic device 4. Similarly, after receiving two ultrasonic signals, electronic device 3 can determine, based on the difference in the arrival times of the two ultrasonic signals at its recording module, that the earlier ultrasonic signal arriving at its recording module is the one output by the left speaker of electronic device 4. Based on this, electronic device 3 can determine that it is located to the left of electronic device 4. For the specific methods used by electronic devices 2 and 3 to determine their relative positions to electronic device 4, please refer to the relevant description in method 400. For simplicity, it will not be repeated here.
[0296] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 4, step 1614 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 4 to electronic device 1.
[0297] Step 1615: Electronic device 1 determines that electronic devices 2 and 3 are both located to the left of electronic device 4 based on the relative positional relationships between themselves and electronic device 4 sent by electronic devices 2 and 3.
[0298] Since electronic devices 2 and 3 are both located to the right of electronic device 4, in order to obtain the relative positional relationships between any two electronic devices 1, 2, 3, and 4, electronic device 1 needs to further determine the relative positional relationship between electronic devices 2 and 3. In this case, method 1600 may further include the following steps:
[0299] Step 1616: Electronic device 1 sends a first instruction message to electronic device 2, which instructs electronic device 2 to enable the recording function.
[0300] Step 1617: Electronic device 2 activates the recording function according to the first instruction information.
[0301] In one implementation, after sending the first instruction information to the electronic device 2, the electronic device 1 can perform step 1619: the electronic device 1 sends the second instruction information to the electronic device 3 to instruct the electronic device 3 to play the ultrasonic signal. For example, the electronic device 1 sends the second instruction information to the electronic device 3 based on the short-range communication connection established between the electronic device 1 and the electronic device 3.
[0302] In another implementation, after electronic device 1 sends the first instruction information to electronic device 2, if electronic device 1 receives a confirmation message from electronic device 2, then electronic device 1 executes step 1619. Here, the confirmation message from electronic device 2 is electronic device 2's response to the first instruction information. In this case, method 1600 may further include step 1618 before step 1619: After electronic device 2 activates its recording function, it sends a confirmation message to electronic device 1 to inform electronic device 1 that its recording function is activated.
[0303] After receiving the second instruction information, electronic device 3 executes step 1620: playing an ultrasonic signal.
[0304] Since electronic device 2 has the recording function enabled, when electronic device 3 plays the ultrasonic signal, the ultrasonic signal will be received by electronic device 2. Then electronic device 2 can execute step 1621, and electronic device 2 determines the relative positional relationship with electronic device 3 based on the received ultrasonic signal.
[0305] Combination Figure 14 As shown in the scenario, after receiving two ultrasonic signals, electronic device 2 can determine that the ultrasonic signal that arrived at the recording module of electronic device 2 earlier is the ultrasonic signal output by the left speaker of electronic device 3, based on the difference between the arrival times of the two ultrasonic signals. Based on this, electronic device 2 can determine that it is located to the left of electronic device 3.
[0306] After determining its relative position to electronic device 3, electronic device 2 can execute step 1622, in which electronic device 2 sends the relative position to electronic device 3 to electronic device 1.
[0307] Step 1623: Electronic device 1 determines that electronic device 2 is located to the left of electronic device 3 based on the relative positional relationship between itself and electronic device 3 sent by electronic device 2.
[0308] After determining that electronic device 2 is located to the left of electronic device 3, in conjunction with steps 1607, 1615, and 1623, electronic device 1 can determine that electronic device 2 is located to the right of electronic device 1, electronic device 3 is located to the right of electronic device 2, and electronic device 4 is located to the right of electronic device 3. In this case, in order for the cursor to be able to switch freely between electronic devices 1, 2, 3, and 4, electronic device 1 also needs to inform each device of the relative positional relationship between each pair of electronic devices 1, 2, 3, and 4. In this case, method 1600 also includes step 1624: electronic device 1 sends the relative positional relationship between each pair of electronic devices 1, 2, 3, and 4 to electronic devices 1, 2, 3, and 4 respectively. For example, electronic device 1 sends to electronic devices 1, 2, 3, and 4 that electronic device 2 is located to the right of electronic device 1, electronic device 3 is located to the right of electronic device 2, and electronic device 4 is located to the right of electronic device 3.
[0309] After obtaining the relative positional relationships between each pair of electronic devices 1, 2, 3, and 4, the cursor can freely switch between them. For examples of how the cursor can freely switch between these devices, please refer to the relevant description in Method 400; for brevity, it will not be repeated here.
[0310] It should be noted that the functions of the mouse described in the above method for determining the relative positional relationship between multiple electronic devices are only illustrative and do not constitute a limitation on the embodiments of this application. In the embodiments of this application, the functions of the mouse for determining the relative positional relationship between multiple electronic devices can also be implemented in the following ways:
[0311] When determining the relative positional relationships between multiple electronic devices, after receiving the relative positional relationships between the other electronic devices and electronic device 1, the mouse can choose not to perform the step of determining the relative positional relationships between the pairs of electronic devices. Instead, it can send the relative positional relationships between the other devices and electronic device 1 to electronic device 1, which then determines the relative positional relationships between the pairs of devices. Afterward, electronic device 1 sends the relative positional relationships between the pairs of electronic devices to the mouse. Finally, the mouse sends the relative positional relationships between the pairs of electronic devices to each individual electronic device. Based on this, the following will illustrate... Figure 3Taking the illustrated scenario as an example, the method 1700 for identifying location provided in this application embodiment will be described. Figure 17 An exemplary interactive flowchart of a method 1700 for identifying a location is shown. Method 1700 includes at least the following steps.
[0312] Step 1701: The mouse sends a first instruction message to electronic device 2 and electronic device 3 respectively, instructing electronic device 2 and electronic device 3 to activate their respective recording functions. For the specific implementation of step 1701, please refer to the relevant description in step 401; for brevity, it will not be repeated here.
[0313] Step 1702: Electronic devices 2 and 3 activate their respective recording functions according to the first instruction information they receive.
[0314] Step 1703: After electronic devices 2 and 3 have enabled their respective recording functions, they send confirmation messages to the mouse to indicate that the recording functions of electronic devices 2 and 3 have been enabled.
[0315] In step 1704, the mouse sends a second instruction to electronic device 1 to instruct electronic device 1 to play an ultrasonic signal. For example, the mouse sends the second instruction to electronic device 1 based on a short-range communication connection established with electronic device 1. For the specific implementation of steps 1702 to 1704, please refer to the relevant descriptions in steps 402 to 404; for brevity, they will not be repeated here.
[0316] After receiving the second instruction information, electronic device 1 executes step 1705: play the ultrasonic signal. For a detailed description of the implementation of step 1705, please refer to the relevant description in step 405; for brevity, it will not be repeated here.
[0317] Since electronic devices 2 and 3 have their respective recording functions enabled, when electronic device 1 plays the ultrasonic signal, the ultrasonic signal will be received by electronic devices 2 and 3. Then, electronic devices 2 and 3 can execute step 1706, whereby each determines its relative position to electronic device 1 based on the received ultrasonic signal. For a detailed description of the implementation of step 1706, please refer to the relevant description in step 406; for brevity, it will not be repeated here.
[0318] After electronic devices 2 and 3 determine their relative positional relationship with electronic device 1, step 1707 can be executed: electronic devices 2 and 3 send their relative positional relationship with electronic device 1 to the mouse. For a detailed description of the implementation of step 1707, please refer to step 407; for brevity, it will not be repeated here.
[0319] Step 1708: The mouse sends the relative positional relationships between electronic devices 2 and 3 and electronic device 1 to electronic device 1.
[0320] After receiving the relative positional relationship between electronic device 2 and electronic device 1 sent by electronic device 2, and the relative positional relationship between electronic device 3 and electronic device 1 sent by electronic device 3, the mouse can send the relative positional relationship between electronic device 2 and electronic device 1, and the relative positional relationship between electronic device 3 and electronic device 1, back to electronic device 1.
[0321] It is worth mentioning that in step 1708, the mouse can also send the relative positional relationships between electronic devices 2 and 3 and electronic device 1 to electronic device 2 or electronic device 3. In one implementation, the mouse can send the relative positional relationship between electronic device 3 and electronic device 1 to electronic device 2, so that electronic device 2 can determine the relative positional relationships between any two of electronic devices 1, 2, and 3 based on the relative positional relationships between electronic devices 2 and 1 and between electronic devices 3 and 1. In another implementation, the mouse can send the relative positional relationship between electronic devices 2 and 1 to electronic device 3, so that electronic device 3 can determine the relative positional relationships between any two of electronic devices 1, 2, and 3 based on the relative positional relationships between electronic devices 2 and 1 and between electronic devices 3 and 1. In addition, the mouse can send both the relative positional relationships between electronic devices 2 and 1 and between electronic devices 3 and 1 to electronic device 2, or send both the relative positional relationships between electronic devices 2 and 1 and between electronic devices 3 and 1 to electronic device 3. This embodiment does not limit this.
[0322] Step 1709: Based on the relative positional relationship between electronic device 2 and electronic device 1 sent by the mouse, and the relative positional relationship between electronic device 3 and electronic device 1, electronic device 1 determines that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1.
[0323] After determining that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1, electronic device 1 obtains the relative positional relationships between each pair of electronic devices 1, 2, and 3. Then, electronic device 1 can execute step 1710: electronic device 1 sends the relative positional relationships between each pair of electronic devices 1, 2, and 3 to the mouse.
[0324] After receiving the relative positional relationships between any two of electronic devices 1, 2, and 3 from electronic device 1, the mouse needs to inform each device of these relative positional relationships in order to allow the cursor to switch freely between them. In this case, method 1700 further includes step 1711: the mouse sends the relative positional relationships between any two of electronic devices 1, 2, and 3 to electronic devices 1, 2, and 3 respectively. For example, the mouse sends the information that electronic device 2 is located to the left of electronic device 1 and electronic device 3 is located to the right of electronic device 1.
[0325] After obtaining the relative positional relationships between each pair of electronic devices 1, 2, and 3, the mouse can freely switch between electronic devices 1, 2, and 3.
[0326] For an example of how the cursor can freely switch between electronic devices 1, 2, and 3, please refer to the relevant description in method 400. For the sake of brevity, it will not be repeated here.
[0327] It is worth mentioning that in method 1700, only electronic device 1 is used as the device that plays ultrasonic signals, and electronic devices 2 and 3 are used as the devices that receive ultrasonic signals, to illustrate the method for identifying positions provided in this application embodiment. However, this does not constitute a limitation on the embodiments of this application. For example, in specific implementation, any one of electronic devices 1, 2, and 3 can be used as the device that plays ultrasonic signals, and the other two devices can be used as the devices that receive ultrasonic signals. This application embodiment does not limit this. For example, the device that plays ultrasonic signals can be the device that first establishes a short-range communication connection with the mouse. It should be understood that the changes made by method 1700 to method 400 regarding the functions of the mouse in determining the relative positional relationship between multiple electronic devices are also applicable to other scenarios in the embodiments of this application, i.e. Figure 8 The scene shown Figure 11 The scene shown and Figure 14 The scene shown.
[0328] It should be understood that the embodiments of this application only describe the method of identifying the location by taking the example of starting the recording function first and then playing the ultrasonic signal. However, this does not constitute a limitation on the embodiments of this application. In specific implementation, the ultrasonic signal can also be played first and the recording function can be started later, as long as it can be ensured that the electronic device with the recording function started can receive at least one set of ultrasonic signals from the left and right speakers of the device playing the ultrasonic signal.
[0329] For example, the device may instruct the playback of an ultrasonic signal before or at the same time as instructing the recording function to be activated, and simultaneously instruct the electronic device to play the ultrasonic signal after a specified time. In this case, at least one set of ultrasonic signals from the left and right speakers of the device playing the ultrasonic signal can be understood as follows: In method 400, the ultrasonic signal s1 played by the electronic device 1 through the left speaker within a time length T1 and the ultrasonic signal s2 played by the right speaker within a time length T3 are a set of ultrasonic signals from the left and right speakers of the electronic device 1.
[0330] It is worth mentioning that, in the embodiments of this application, "same side" and "same side" have the same meaning, and "opposite side" and "different side" have the same meaning.
[0331] The method for identifying positions provided in this application involves a first electronic device instructing at least two second electronic devices to activate their respective recording functions and instructing a third electronic device to send ultrasonic signals. After activating their recording functions, the at least two second electronic devices determine their relative positional relationship with the third electronic device based on the ultrasonic signals detected by their respective recording functions. They then send their relative positional relationship with the third electronic device to the first electronic device. Finally, the first electronic device determines the relative positional relationship between each pair of multiple electronic devices based on the relative positional relationships between each pair of the at least two second electronic devices and the third electronic device, thereby automatically identifying the relative positional relationship between each pair of multiple electronic devices. This method eliminates the need for users to manually set the relative positional relationship between each pair of multiple devices, making it simple to operate.
[0332] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0333] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0334] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0335] The electronic device provided in this embodiment is used to perform the above-described method for identifying the location, and therefore can achieve the same effect as the above-described implementation method.
[0336] When using integrated units, the electronic device may further include a processing module, a storage module, and a communication module. The processing module is used to control and manage the operation of the electronic device. The storage module supports the execution of stored program code and data. The communication module supports communication between the electronic device and other devices.
[0337] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
[0338] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment can be a device having... Figure 1 The device or structure shown Figure 2 The device shown has the following structure.
[0339] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to achieve the location identification method in the above embodiment.
[0340] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement the location identification method in the above embodiment.
[0341] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the location identification method in the above method embodiments.
[0342] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0343] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0344] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0345] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0346] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0347] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0348] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for identifying location, characterized in that, Applied to a first electronic device, the method includes: Send a first instruction message to at least two second electronic devices, the first instruction message instructing the corresponding second electronic devices to enable the recording function; Send a second instruction message to a third electronic device, the second instruction message instructing the third electronic device to send an ultrasonic signal, the ultrasonic signal being used to determine the relative positional relationship between the third electronic device and the at least two second electronic devices; Receive the relative positional relationship between each of the at least two second electronic devices and the third electronic device, wherein the at least two second electronic devices include two second electronic devices; When the relative positional relationship between the two second electronic devices and the third electronic device is such that both second electronic devices are located to the left or right of the third electronic device, the first instruction information is sent to one of the two second electronic devices. A third instruction message is sent to the other of the two second electronic devices, the third instruction message instructing the other second electronic device to play an ultrasonic signal, the ultrasonic signal being used to determine the relative positional relationship between the two second electronic devices; Receive the relative positional relationship between the two second electronic devices sent by the other second electronic device; Send the relative positional relationships between any two of the two second electronic devices and the third electronic device to the two second electronic devices and the third electronic device.
2. The method according to claim 1, characterized in that, The relative positional relationship between the two second electronic devices and the third electronic device further includes: one of the two second electronic devices is located on the first side of the third electronic device, and the other of the two second electronic devices is located on the second side of the third electronic device, wherein the first side is either the left or right side, and the second side is opposite to the first side.
3. The method according to claim 1, characterized in that, Before sending a third instruction message to the other of the two second electronic devices, the method further includes: The system receives a confirmation message from one of the two second electronic devices regarding the first indication information, wherein the confirmation message indicates that one of the two second electronic devices has enabled the recording function.
4. The method according to any one of claims 1 to 3, characterized in that, Before sending the second indication information to the third electronic device, the method further includes: The system receives confirmation messages from the at least two second electronic devices in response to the first indication information, the confirmation messages indicating that the corresponding second electronic devices have enabled the recording function.
5. A method for identifying location, applied to a second electronic device, characterized in that, The method includes: Receive a first instruction message from a first electronic device, the first instruction message instructing the second electronic device to enable the recording function; Start the recording function according to the first instruction information; The relative positional relationship between the second electronic device and the third electronic device is determined based on the ultrasonic signal detected from the third electronic device based on the recording function. Send the relative positional relationship between the second electronic device and the third electronic device to the first electronic device; The system receives the relative positional relationship between at least two second electronic devices and the third electronic device sent by the first electronic device, wherein the at least two second electronic devices include two electronic devices, and the second electronic device is one of the two electronic devices. The system receives the first instruction information sent by the first electronic device; activates the recording function according to the first instruction information; determines the relative positional relationship between the second electronic device and the other second electronic device based on the ultrasonic signal detected by the recording function from the other second electronic device; and sends the relative positional relationship between the second electronic device and the other second electronic device to the first electronic device; or... The system receives a second instruction message sent by the first electronic device, which instructs the second electronic device to play an ultrasonic signal; and plays the ultrasonic signal according to the second instruction message, the ultrasonic signal being used to determine the relative positional relationship between the two second electronic devices.
6. The method according to claim 5, characterized in that, The relative positional relationship between the second electronic device and the third electronic device further includes: the second electronic device is located on a first side of the third electronic device, the first side is opposite to the second side, the second side is the relative positional relationship between the other second electronic device and the third electronic device, wherein the first side is either the left or the right side.
7. The method according to claim 5 or 6, characterized in that, After the second electronic device activates the recording function, the method further includes: A confirmation message for the first instruction information is sent to the first electronic device, and the confirmation message for the first instruction information instructs the second electronic device to enable the recording function.
8. An electronic device, characterized in that, include: One or more processors; Memory; and one or more programs, wherein the one or more programs are stored in the memory, and when the one or more programs are executed by the processor, cause the electronic device to perform the method as described in any one of claims 1 to 4.
9. An electronic device, characterized in that, include: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory, and when the one or more programs are executed by the processor, cause the electronic device to perform the method as described in any one of claims 5 to 7.
10. A computer storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform a method for identifying a location as described in any one of claims 1 to 4, or 5 to 7.
11. A computer program product, characterized in that, When the computer program product is run on a computer The computer is made to perform the method of identifying a location as described in any one of claims 1 to 4, or 5 to 7.