Distance measuring method, readable medium, and electronic device
The method enables real-time distance measurement between electronic devices by using sound wave signals, addressing the limitations of existing methods and enhancing user experience in various applications.
Patent Information
- Application Number
- JP2024550686
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-02-28
- Filing Date
- 2023-02-10
- Publication Date
- 2025-04-10
- Estimated Expiration
- 2043-02-10
AI Technical Summary
Existing distance measurement methods are cumbersome and lack real-time updates, making it difficult for users to accurately determine the distance between electronic devices, especially in scenarios like searching for tagged items or multi-screen collaborations.
A method involving an electronic device establishing a communication connection with another device, generating distance measurement instructions, and calculating real-time distance based on sound wave signals transmitted by the second device, allowing continuous refresh and display of the distance.
This method provides an easy-to-use and user-friendly experience by offering real-time distance updates, improving accuracy and efficiency in various applications, such as item searching and multi-screen collaborations.
Smart Images

Figure 2025508880000001_ABST
Abstract
Description
[Technical field]
[0001] This application claims priority to Chinese Patent Application No. 202210190807.0, entitled “Distance Measuring Method, Readable Medium, and Electronic Device,” filed with the State Intellectual Property Office of the People's Republic of China on February 28, 2022, which is hereby incorporated by reference in its entirety. The present invention relates to the field of communication technology, and in particular to a distance measurement method, a readable medium, and an electronic device. [Background technology]
[0002] Distance is an important parameter that needs to be detected in various scenarios and controls. For example, when an electronic device is used to search for another electronic device, the distance and the included angle between the two electronic devices can be accurately measured by using wireless carrier (Ultra-wideband, UWB) technology to notify the user of the searched another electronic device at a specific distance and in a specific direction, thereby realizing accurate searching of the other electronic device. In another example, when an electronic device performs multi-screen collaboration with another electronic device, for security reasons, the electronic device can only perform multi-screen collaboration with another electronic device within a short distance range. In this case, the distance between the electronic device and the other electronic device can be measured to determine when to perform multi-screen collaboration between the electronic device and the other electronic device and when to end multi-screen collaboration between the electronic device and the other electronic device. Summary of the Invention
[0003] This application provides a distance measurement method, a readable medium, and an electronic device. The distance measurement method includes: a first electronic device establishes a communication connection to a second electronic device. The first electronic device generates a distance measurement command based on a user's associated operation. The first electronic device receives a plurality of groups of sound signals transmitted by a speaker of the second electronic device, and determines a start band of each group of the received sound signals through correlation calculation to determine a reception time when each group of sound signals is received by the first electronic device. Then, the first electronic device determines a real-time distance between the first electronic device and the second electronic device when each group of sound signals is received by the first electronic device based on the reception time of each group of sound signals, the transmission time of each group of sound signals, and the sound velocity. Finally, the first electronic device continuously refreshes and displays the real-time distance between the first electronic device and the second electronic device obtained through calculation.
[0004] In the above-mentioned distance measuring method, a user performs a related operation on a first electronic device. The second electronic device continuously transmits a plurality of groups of sound signals, and the first electronic device can determine the arrival time corresponding to each group of sound signals based on the received plurality of groups of sound signals. The first electronic device can calculate the real-time distance between the first electronic device and the second electronic device when each group of sound signals arrives at the first electronic device based on the arrival time corresponding to each group of sound signals, the transmission time corresponding to each group of sound signals, and the sound wave speed. Based on this, the first electronic device can continuously refresh the real-time distance between the first electronic device and the second electronic device. The above-mentioned distance measuring method is easy for a user to operate and improves the user experience. In addition, since the frequency of sound waves is high, the transmission interval between two adjacent groups of sound signals can be flexibly adjusted. Therefore, the frequency of refreshing the real-time distance by the first electronic device can be guaranteed. Even if a user moves a little while carrying the first electronic device, the first electronic device can accurately display the change in the distance between the first electronic device and the second electronic device in real time.
[0005] A first aspect of this application provides a distance measurement method. The method includes: a first electronic device establishing a communication connection to a second electronic device; the first electronic device detects a distance measurement command; the first electronic device detects a first group of sonic signals transmitted by the second electronic device at a first time point, and determines a first distance corresponding to the first time point between the first electronic device and the second electronic device based on the first group of sonic signals and first information corresponding to the first group of sonic signals, the first information including first transmission time information of transmitting the first group of sonic signals by the second electronic device; after determining the first distance, the first electronic device displays the first distance; the first electronic device detects a second group of sonic signals transmitted by the second electronic device at a second time point after the first time point, and determines a second distance corresponding to the second time point between the first electronic device and the second electronic device based on the second group of sonic signals and second information corresponding to the second group of sonic signals, the second information including second transmission time information of transmitting the second group of sonic signals by the second electronic device. After determining the second distance, the first electronic device displays the second distance. The first transmission time information includes a transmission time point when the second electronic device transmits the first group of sonic signals. The second transmission time information includes a transmission time point when the second electronic device transmits the second group of sonic signals. Alternatively, the second transmission time information includes a transmission time point when the second electronic device transmits the first group of sonic signals and a transmission interval between the first group of sonic signals and the second group of sonic signals transmitted by the second electronic device. This is not particularly limited in this application.
[0006] There are various ways for the first electronic device to establish a communication connection to the second electronic device, which is not particularly limited in this application. For example, the first electronic device and the second electronic device are connected via Bluetooth. The distance measurement command refers to command information generated by the first electronic device based on a user operation, which instructs the first electronic device to interact with the second electronic device to obtain a real-time distance between the first electronic device and the second electronic device. It can be understood that in some implementations, the distance measurement command further carries identification information of the second electronic device, so that the interaction with the second electronic device can be accurately established when there are multiple related electronic devices around the first electronic device.
[0007] The first group of sonic signals refers to a segment of the sonic signals received by the first electronic device from the multiple groups of sonic signals transmitted by the second electronic device. In other words, the second electronic device transmits multiple segments of sonic signals, and the first electronic device receives the first group of sonic signals at a first time point. The second group of sonic signals refers to another segment of the sonic signals received by the first electronic device from the multiple groups of sonic signals transmitted by the second electronic device. In other words, the second electronic device transmits multiple segments of sonic signals, and the first electronic device receives the second group of sonic signals at a second time point. It can be understood that in some implementations of this application, after the first electronic device receives the first group of sonic signals, another segment of the sonic signals subsequently received is the second group of sonic signals. In some other alternative implementations of this application, after receiving the first group of sonic signals, the first electronic device receives another segment of the sonic signals, and yet another segment of the sonic signals subsequently received is the second group of sonic signals. In other words, the first electronic device further receives another group of sonic signals between the first group of sonic signals and the second group of sonic signals, for example, the first electronic device receives the first group of sonic signals, the third group of sonic signals, and the second group of sonic signals in sequence.
[0008] Also, the first distance between the first electronic device and the second electronic device corresponding to the first time point is not necessarily determined at the first time point or is not the distance between the first electronic device and the second electronic device displayed at the first time point. The first distance between the first electronic device and the second electronic device corresponding to the first time point refers to the distance between the first electronic device and the second electronic device corresponding to the first time point. The first distance may be determined after a short delay with respect to the first time point, or the first distance may be the distance displayed on the first electronic device after a short delay with respect to the first time point. The first distance represents the distance between the first electronic device and the second electronic device when the first group of sound wave signals arrive at the first electronic device. Similarly, it can be seen that the principle of the second distance between the first electronic device and the second electronic device is similar to the principle of the first distance, so it will not be described in detail in this application.
[0009] It should also be noted that in the above implementation, only the manner of determining the first distance and the second distance in the first electronic device and the second electronic device is described. However, in the actual distance measurement manner, the second distance is a group of data. In other words, after the first electronic device determines the second distance between the first electronic device and the second electronic device, the first electronic device continues to update the second distance between the first electronic device and the second electronic device, and therefore the first electronic device continuously displays the distance between the first electronic device and the second electronic device.
[0010] In the above-mentioned distance measuring method, the first electronic device can continuously refresh the real-time distance between the first electronic device and the second electronic device. The above-mentioned distance measuring method is easy for users to operate and improves the user experience. In addition, since the frequency of the sound wave is high, the transmission interval between two adjacent groups of sound wave signals can be flexibly adjusted. Therefore, the frequency of refreshing the real-time distance by the first electronic device can be guaranteed. Even if the user carries the first electronic device and moves a little, the first electronic device can accurately display the change in the distance between the first electronic device and the second electronic device in real time.
[0011] In one possible implementation of the first aspect, in the distance measurement method, the first electronic device receives the first information and the second information from the second electronic device, in other words, the first electronic device receives the first transmission time information and the second transmission time information from the second electronic device.
[0012] In other words, in the possible implementation of this application, the first information and the second information are determined by the second electronic device. The second electronic device can transmit a first group of sonic signals based on the first information determined by the second electronic device, and can transmit a second group of sonic signals based on the second information. Then, the second electronic device transmits the first information and the second information to the first electronic device, so that the first electronic device can determine a first distance between the first electronic device and the second electronic device when the sonic signals of the first group arrive at the first electronic device based on the received sonic signals of the first group and the first information, and at the same time, the first electronic device can determine a second distance between the first electronic device and the second electronic device when the sonic signals of the second group arrive at the first electronic device based on the received sonic signals of the second group and the second information.
[0013] In the above-mentioned distance measuring method, the second electronic device does not need to receive the first information and the second information from the first electronic device or another electronic device before the second electronic device transmits the first and second acoustic signals, which can effectively shorten the response time before the second electronic device transmits the first and second acoustic signals, properly arrange the response periodicity of the first and second electronic devices, and further improve the user experience.
[0014] In one possible implementation of the first aspect, in the distance measurement method, the first electronic device transmits the first transmission time information and the second transmission time information to the second electronic device, such that the second electronic device transmits a first group of sound wave signals based on the first transmission time information and the second electronic device transmits a second group of sound wave signals based on the second transmission time information, where the first information includes the first transmission time information and the second information includes the second transmission time information.
[0015] In other words, in this possible implementation of the present application, the first information and the second information are determined by the first electronic device. After determining the first information and the second information, the first electronic device transmits the first information and the second information to the second electronic device.
[0016] Then, the second electronic device transmits a first group of sonic signals based on the first information and transmits a second group of sonic signals based on the second information. Then, the first electronic device can determine a first distance between the first electronic device and the second electronic device when the first group of sonic signals arrive at the first electronic device based on the received first group of sonic signals and the first information, and at the same time, the first electronic device can determine a second distance between the first electronic device and the second electronic device when the second group of sonic signals arrive at the first electronic device based on the received second group of sonic signals and the second information.
[0017] In the above distance measurement method, the first electronic device does not need to receive the first information of the first group of sonic signals and the second information of the second group of sonic signals from the second electronic device, so that the interaction between the first information and the second information between the first electronic device and the second electronic device is reduced, and the timeliness and accuracy of the distance measurement method are improved. In addition, the first electronic device can further appropriately adjust the transmission time information corresponding to the subsequent group of sonic signals according to the distance between the first electronic device and the second electronic device determined by the first electronic device.
[0018] For example, when the value of the first distance determined by the first electronic device is small, it indicates that the first electronic device is close to the second electronic device and the user is about to find the second electronic device. In this case, in order to improve the display accuracy of the distance between the first electronic device and the second electronic device, the transmission time interval between the sound wave signals of the first group and the sound wave signals of the second group may be shortened, in other words, the difference between the first time and the second time may be reduced, so that the first electronic device can also accurately capture the distance difference between the first electronic device and the second electronic device when the first electronic device moves a little.
[0019] In another example, when the value of the first distance determined by the first electronic device is small, it indicates that the first electronic device is close to the second electronic device and the user is about to find the second electronic device. In this case, when the first electronic device moves a little, the relative moving speed between the first electronic device and the second electronic device may be slowed down to improve the display accuracy of the distance between the first electronic device and the second electronic device, so that the first electronic device can also accurately capture the distance difference between the first electronic device and the second electronic device.
[0020] Also, in one possible implementation of the first aspect, in the distance measurement method, the first information is determined by the first electronic device, the second information is determined by the second electronic device, the first electronic device transmits the first information to the second electronic device, and the second electronic device transmits the second information to the first electronic device, or the second information is determined by the first electronic device, the first information is determined by the second electronic device, the first electronic device transmits the second information to the second electronic device, and the second electronic device transmits the first information to the first electronic device.
[0021] In addition, in one possible implementation of the first aspect, in the distance measurement method, the first information and the second information are determined by the third electronic device, and the first electronic device and the second electronic device acquire the first information and the second information.
[0022] It can be understood that any combination of the above implementations falls within the scope of protection of this application, which is not specifically limited in this application.
[0023] In one possible implementation of the first aspect, the distance measuring method further includes the first electronic device detecting a third group of sonic signals transmitted by the second electronic device at a fifth time point, the fifth time point being between the first time point and the second time point. The first electronic device further determines a first distance between the first electronic device and the second electronic device corresponding to the first time point based on the first group of sonic signals, the third group of sonic signals, the first information, and third information corresponding to the third group of sonic signals. The first electronic device determines a second distance between the first electronic device and the second electronic device corresponding to the second time point based on the second group of sonic signals, the third group of sonic signals, the second information, and the third information.
[0024] In other words, in the possible implementation of this application, the first electronic device receives the first group of sonic signals and the third group of sonic signals at a first time point, and the first electronic device determines a first distance between the first electronic device and the second electronic device corresponding to the first time point based on the first group of sonic signals, the third group of sonic signals, the first information corresponding to the first sonic signals, and the third information corresponding to the third group of sonic signals. The third information includes third transmission time information of the transmission of the third group of sonic signals by the second electronic device. For example, the third information includes a transmission time when the second electronic device transmits the third group of sonic signals. In another example, the third information includes a transmission time when the second electronic device transmits the third group of sonic signals, and a transmission interval between the third group of sonic signals and the first sonic signals. This is not particularly limited in this application.
[0025] In the above distance measuring method, when receiving multiple groups of sound wave signals transmitted by the second electronic device, the first electronic device can determine and display the distance between the first electronic device and the second electronic device based on a preset display frequency. Thus, the first electronic device can appropriately adjust the display manner of the distance between the first electronic device and the second electronic device based on the actual display requirements. This implements an effective display between the first electronic device and the second electronic device and improves the user experience.
[0026] In one possible implementation of the first aspect, the distance measurement method further includes the first electronic device sending a sound emission command to the second electronic device, the sound emission command instructing the second electronic device to transmit a sound wave signal, the sound wave signal including a first group of sound wave signals and a second group of sound wave signals.
[0027] The sound emission command refers to command information sent by the first electronic device to the second electronic device to instruct the second electronic device to start transmitting a sound signal. It can be understood that the sound emission command may further include parameters of the sound signal transmitted by the second electronic device, such as a transmission time, a transmission interval, or a sound wavelength (i.e., a sound frequency band), which is not particularly limited in this application.
[0028] In other words, in the possible implementation of this application, after establishing a communication connection to the second electronic device, the first electronic device can send a sound emission command to the second electronic device, so that the second electronic device starts to transmit a sound wave signal in response to the sound emission command. In the distance measurement method, the first electronic device can control when the second electronic device emits a sound, so as to avoid the second electronic device still continuously emitting a sound in a situation where distance measurement is not required. This improves energy utilization efficiency.
[0029] In one possible implementation of the first aspect, in the distance measuring method, the sound emission command instructs the second electronic device to transmit a sound wave signal, and the frequency range of the sound wave signal is a preset frequency range.
[0030] In other words, in this possible implementation of the application, the first electronic device is configured to instruct the second electronic device to transmit a sound signal within a preset frequency range, which makes it easy for the first electronic device to distinguish the sound signal of the second electronic device and avoids confusion with the sound signal transmitted by another electronic device. This also narrows the frequency range of the sound signal, which reduces the difficulty in processing the sound signal by the first electronic device, and improves the efficiency of processing the sound signal by the first electronic device.
[0031] In one possible implementation of the first aspect, the distance measurement method further includes the first electronic device establishing a Bluetooth connection to the second electronic device, and when a received signal strength of a Bluetooth signal transmitted by the second electronic device and received by the first electronic device is higher than a preset strength threshold, the first electronic device beginning to detect an acoustic signal transmitted by the second electronic device, the acoustic signal including a first acoustic signal and a second acoustic signal.
[0032] The received signal strength of the Bluetooth signal represents the strength of the Bluetooth signal transmitted by the second electronic device and received by the first electronic device, and may also be understood as the association between the first electronic device and the second electronic device in the current state. For example, the higher the received signal strength value, the closer the first electronic device is to the second electronic device, in other words, the stronger the association between the second electronic device and the first electronic device, the higher the stability of the Bluetooth connection between the first electronic device and the second electronic device, and the easier it is for the user to search for the second electronic device by using the first electronic device. The lower the received signal strength value, the farther the first electronic device is from the second electronic device, in other words, the weaker the association between the second electronic device and the first electronic device, and the higher the possibility that the user cannot search for the second electronic device by using the first electronic device. The preset strength threshold is an approximation of the received signal strength indication determined based on the association strength between the first electronic device and the second electronic device. The preset strength threshold is used to determine whether the first electronic device is near the second electronic device.
[0033] In other words, in this possible implementation of the application, when a first electronic device is connected to a second electronic device via Bluetooth, the first electronic device roughly determines the degree of distance between the first electronic device and the second electronic device by using the received signal strength of a Bluetooth signal received by the first electronic device from the second electronic device, and when the first electronic device is near the second electronic device, the first electronic device begins to detect an acoustic signal transmitted by the second electronic device, where the acoustic signal includes a first acoustic signal and a second acoustic signal.
[0034] In the above distance measuring method, the time when the first electronic device starts to detect the sound wave signal transmitted by the second electronic device can be determined based on the received signal strength of the Bluetooth signal received by the first electronic device from the second electronic device, which improves the effectiveness of the first electronic device determining the distance between the first electronic device and the second electronic device, and avoids the first electronic device making an invalid measurement of the distance between the first electronic device and the second electronic device when the Bluetooth connection strength between the first electronic device and the second electronic device is weak.
[0035] In one possible implementation of the first aspect, the distance measurement method further includes the first electronic device performing Bluetooth time synchronization with the second electronic device at a third time point to determine a first time offset between the first electronic device and the second electronic device corresponding to the third time point, the first electronic device determining a first distance after the third time point based on the first time offset, the first group of sonic signals, and the first information, and the first electronic device determining a second distance after the third time point based on the first time offset, the second group of sonic signals, and the second information.
[0036] Bluetooth time synchronization refers to determining a time offset between the first electronic device and the second electronic device by using a Bluetooth module in the first electronic device and a Bluetooth module in the second electronic device. The time offset refers to the difference in time displayed on the first electronic device and the second electronic device. The first time offset refers to the difference in time displayed on the first electronic device and the second electronic device after a third time point.
[0037] It is easy to understand that the first electronic device and the second electronic device each have a clock, and therefore the time corresponding to the first electronic device and the time corresponding to the second electronic device can be obtained separately through statistics. However, in some cases, due to setting errors or structural errors, the time corresponding to the first electronic device may not match the time corresponding to the second electronic device, and this mismatch can be reduced through Bluetooth time synchronization. A specific implementation of obtaining a time offset between the first electronic device and the second electronic device during Bluetooth time synchronization will be described in detail below, and the details will not be described again here. In addition, the third time point is only used to distinguish between the first time point and the second time point, and does not represent an order relationship. In some implementations, the third time point is before the first time point. In another alternative implementation, the third time point is after the first time point. For example, the third time point is between the first time point and the second time point. This is not particularly limited in this application.
[0038] In the above-mentioned distance measurement method, the time offset between the first electronic device and the second electronic device is comprehensively taken into account, so that the measurement result error caused in the distance measurement calculation due to the inconsistent display times of the first electronic device and the second electronic device can be reduced, and the accuracy of the measured distance between the first electronic device and the second electronic device can be improved.
[0039] In one possible implementation of the first aspect, the distance measurement method further includes the first electronic device performing Bluetooth time synchronization with the second electronic device at a fourth time point after the preset time from the third time point to determine a second time offset between the first electronic device and the second electronic device corresponding to the fourth time point, the first electronic device determining a first distance after the fourth time point based on the second time offset, the first group of sonic signals, and the first information, and the first electronic device determining a second distance after the fourth time point based on the second time offset, the second group of sonic signals, and the second information.
[0040] The second time offset refers to a time difference displayed on the first electronic device and the second electronic device after the fourth time point. The fourth time point is after the third time point. Also, the fourth time point is only used to distinguish the first time point, the second time point, and the third time point, and does not represent an order relationship between the fourth time point and the first time point, and an order relationship between the fourth time point and the second time point. In some implementations, the fourth time point is after the first time point and the second time point. In another alternative implementation, the fourth time point is after the second time point. This is not particularly limited in this application.
[0041] In one possible implementation of the first aspect, the time interval between the third time point and the fourth time point is a fixed value. For example, the time interval between the third time point and the fourth time point is a preset time threshold. In other words, each time the preset time threshold is reached, the first electronic device and the second electronic device perform Bluetooth time synchronization.
[0042] In the above distance measurement method, when the first electronic device and the second electronic device start Bluetooth time synchronization again at the fourth time point, after the Bluetooth time synchronization is finished, an updated time offset is obtained and the real-time distance calculation formula is updated. Based on this, the first electronic device and the second electronic device periodically perform Bluetooth time synchronization, so that the time drift (i.e., time offset) between the first electronic device and the second electronic device can be corrected. This ensures the accuracy of the distance measurement result.
[0043] In one possible implementation of the first aspect, the distance measurement method further includes the first electronic device detecting a distance measurement command when detecting a distance measurement operation performed by a user on the first electronic device and the second electronic device, and / or a search operation performed by a user on the second electronic device.
[0044] In one possible implementation of the first aspect, in the distance measurement method, the frequency range of the sound wave signal is from 20 Hz to 2*10 4 Hz. Or, the frequency range of the sound signal is 2*10 4 Hz to 10 12 Hz. Alternatively, the frequency range of the sound signal is 20 Hz to 10 12 Hz. For example, the frequency range of a sound signal is 1.8*10 4 Hz to 2.2*10 4 Hz.
[0045] A second aspect of the present application provides an electronic device, the electronic device comprising: a memory configured to store instructions; and one or more processors, which, when executed by the one or more processors, cause the processors to perform a distance measurement method according to the first aspect or any one of the possible implementations of the first aspect.
[0046] A third aspect of the application provides a computer readable storage medium having stored thereon instructions which, when executed on an electronic device, enable the electronic device to perform a distance measurement method according to the first aspect or any one of the possible implementations of the first aspect.
[0047] A fourth aspect of the application provides a computer program product comprising instructions which, when executed by one or more processors, are used to perform a distance measurement method according to the first aspect or any one of the possible implementations of the first aspect. [Brief description of the drawings]
[0048] [Figure 1(a)] 1 illustrates some application scenarios in which the distance measurement method according to this application can be applied. [Figure 1(b)] 1 illustrates some other application scenarios in which the distance measurement method according to this application can be applied. [Diagram 2] 1 illustrates a search scenario in which the distance measurement method according to this application can be applied. [Figure 3(a)] 1 shows a home screen of a mobile phone 100 applicable to a distance measuring method according to some embodiments of the present application. [Figure 3(b)] 1 illustrates an operation interface of a mobile phone 100 applicable to a distance measuring method according to some embodiments of the present application. [Figure 4] 2 is a diagram of distance measurement between a mobile phone 100 and a Tag device 200 according to some embodiments of the present application. [Figure 5(a)] Illustrated is the distance d1 between the mobile phone 100 and the Tag device 200 at time t31. [Figure 5(b)] Illustrated is the distance d2 between the mobile phone 100 and the Tag device 200 at time t32. [Figure 5(c)] The distance d3 between the mobile phone 100 and the Tag device 200 at time t33 is shown. [Figure 6] 1 is a diagram of a configuration of a mobile phone 100 and a Tag device 200 according to some embodiments of the present application. [Figure 7] 1 is a diagram of a specific configuration of a mobile phone 100 and a Tag device 200 according to some embodiments of the present application. [Figure 8] 1 is a flowchart of a distance measurement method according to some embodiments of the present application. [Figure 9] FIG. 2 is a diagram of Bluetooth time synchronization in a distance measurement method according to some embodiments of the present application. [Figure 10(a)] 1 is a diagram of a distance measurement method according to some embodiments of the present application, where the first information includes transmission times of the acoustic signals and the second information includes transmission times of a second group of acoustic signals. [Figure 10(b)] FIG. 1 is a diagram of a distance measurement method according to some embodiments of the present application, where the first information includes a transmission time point of an acoustic signal and the second information includes a transmission interval between a second group of acoustic signals and a first group of acoustic signals. [Figure 10(c)] FIG. 1 is a diagram of a distance measurement method according to some embodiments of the present application, in which first information includes a transmission time point of an acoustic signal, and second information includes a transmission interval between a second group of acoustic signals and a first group of acoustic signals, the transmission interval being a fixed value. [Figure 11A] 11A and 11B are interaction diagrams corresponding to the distance measurement method of FIG. 8, according to some embodiments of the present application. [Figure 11B] 11A and 11B are interaction diagrams corresponding to the distance measurement method of FIG. 8, according to some embodiments of the present application. [Figure 12] 1 is a flowchart of a distance measurement method according to some embodiments of the present application. [Figure 13A] 13A and 13B are interaction diagrams corresponding to the distance measurement method of FIG. 12, according to some embodiments of the present application. [Figure 13B] 13A and 13B are interaction diagrams corresponding to the distance measurement method of FIG. 12, according to some embodiments of the present application. [Figure 14] 1 is a flowchart of a distance measurement method according to some embodiments of the present application. [Figure 15A] 15A and 15B are interaction diagrams corresponding to the distance measurement method of FIG. 14, according to some embodiments of the present application. [Figure 15B] 15A and 15B are interaction diagrams corresponding to the distance measurement method of FIG. 14, according to some embodiments of the present application. [Figure 16] FIG. 1 is a diagram of the hardware configuration of a mobile phone 100 according to this application. [Figure 17] 4 is a diagram of a notebook computer 400 according to the present application. [Figure 18]1 is an architecture diagram of a mobile phone 100 according to some embodiments of the present application.
[0049] Reference sign: 100-mobile phone, 101-communication module, 101a-bluetooth module, 102-audio module, 102a-microphone, 103-processor, 104-memory, 105-display module, 200-tag device, 201-communication module, 201a-bluetooth module, 202-audio module, 202a-speaker, 203-processor, 204-memory, 205-display module. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0050] Exemplary embodiments of this application include, but are not limited to, distance measurement methods, apparatus, readable media, and electronic devices.
[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the following further describes the implementation of the present application in detail with reference to the accompanying drawings.
[0052] A measurement system applicable to the distance measurement method in this application includes a first electronic device (e.g., a mobile phone 100 in FIG. 1(a) or FIG. 1(b)) and a second electronic device (e.g., an electronic tag device 200 in FIG. 1(a) or a wristwatch 300 in FIG. 1(b)), and the distance measurement solution can be applied to multiple scenarios.
[0053] In some application scenarios, for example, as shown in FIG. 1(a), the distance measurement method provided in this application can be applied to an application scenario in which a user searches for a Tag device 200 by using a mobile phone 100 to find an item, such as a backpack, a bicycle, or a key. The Tag device 200 is an electronic tag device that indicates an item, and generally includes a Bluetooth module and a speaker. Specifically, in order to facilitate the search of an item, such as a backpack, a bicycle, or a key, which cannot be directly identified by an electronic device, the Tag device 200 is generally attached to this type of item. When a user wants to know the specific location of a backpack, a bicycle, or a key, the user can operate the mobile phone 100 to connect to the Tag device 200 via Bluetooth, and determine the distance between the mobile phone 100 and the Tag device 200 by receiving the sound wave transmitted by the speaker of the Tag device 200, thereby providing a reference for the user to find an item, such as a backpack, a bicycle, or a key, and reducing the difficulty of the user's search.
[0054] In some other application scenarios, in another example, as shown in FIG. 1(b), the distance measurement method provided in this application can be applied instead to an application scenario in which the mobile phone 100 and the watch 300 are paired and interact. For example, in multi-screen collaboration, for security reasons, the multi-screen collaboration can be performed only when the distance between the mobile phone 100 and the watch 300 is within a certain range. When a user wants to perform multi-screen collaboration between the mobile phone 100 and the watch 300, the user can determine when to perform the multi-screen collaboration between the mobile phone 100 and the watch 300 and when to end the multi-screen collaboration between the mobile phone 100 and the watch 300 by measuring the distance between the mobile phone 100 and the watch 300, so as to accurately determine the multi-screen collaboration conditions and improve the multi-screen collaboration security.
[0055] In order to better understand the technical solution of the embodiments of this application, the following describes the technical solution of this application in detail by using an application scenario in which a user uses a mobile phone 100 to search for a Tag device 200 as an example.
[0056] As shown in FIG. 2 , when a user wants to search for the Tag device 200 using the mobile phone 100, the user performs a first search operation for the Tag device 200 on the mobile phone 100 (e.g., taps / clicks a search button corresponding to the Tag device 200) and at a time t 01 A first distance d1 between the mobile phone 100 and the Tag device 200 at time t can be obtained, and the first distance d1 can be presented to the user, so that the user can adjust the position of the mobile phone 100 based on the first distance d1. Then, the user performs a second search operation for the Tag device 200 on the mobile phone 100 (e.g., taps / clicks the search button corresponding to the Tag device 200 for a second time) to search for the Tag device 200 at time t 02 It is necessary to obtain a second distance d2 between the mobile phone 100 and the Tag device 200 at and present the second distance d2 to the user so that the user can continue to adjust the position of the mobile phone 100 based on the first distance d1 and the second distance d2 until the distance d3 between the mobile phone 100 and the Tag device 200 meets the requirements, for example, until the user finds the Tag device 200.
[0057] It can be seen that in the application scenario shown in FIG. 2, when the mobile phone 100 displays the real-time distance between the mobile phone 100 and the Tag device 200, it is easier to find the Tag device 200 by using the mobile phone 100. However, the current distance measurement method can only measure the distance between the mobile phone 100 and the Tag device 200 at a time point after the user performs a search operation each time. Therefore, the user needs to operate the mobile phone 100 multiple times to measure the distance between the mobile phone 100 and the Tag device 200 multiple times at multiple times. In this case, the operation is complicated and the user experience is poor. In addition, the current distance measurement method cannot timely refresh the distance between the mobile phone 100 and the Tag device 200 when the mobile phone 100 moves relative to the Tag device 200, in other words, cannot provide the user with a timely reference. As a result, it is difficult for the user to use the mobile phone 100 to find the Tag device 200, and the search efficiency is low.
[0058] Therefore, one embodiment of this application provides a method for measuring distance between electronic devices. As shown in Fig. 3(a) to Fig. 5(c), after the mobile phone 100 establishes a wireless communication connection to the Tag device 200, the user performs a search operation for the Tag device 200 on the mobile phone 100. For example, the search operation may include a start operation for starting a search program in Fig. 3(a) and a search confirmation operation for the Tag device 200 in Fig. 3(b). Then, the mobile phone 100 receives multiple groups of sonic signals transmitted by the speaker of the Tag device 200, and determines the start band of each group of the received sonic signals of the multiple groups through correlation calculation, and calculates the reception time (e.g., t in Fig. 4) at which the sonic signals of each group are received by the mobile phone 100. 21 , t 22 , t 23 , and t 2k Then, the mobile phone 100 determines the reception time of the sound wave signal of each group (for example, t 21 , t 22 , t 23 , and t 2k) and the time point when the sonic signal of each group is transmitted (e.g., t 11 , t 12 , t 13 , and t 1k ) and the acoustic wave speed (e.g., v in FIG. 4), the real-time distance (e.g., d1, d2, d3, and d4 in FIG. 4) between the mobile phone 100 and the Tag device 200 when the acoustic wave signals of each group are received by the mobile phone 100 is calculated. k Finally, the mobile phone 100 continuously refreshes and displays the real-time distance between the mobile phone 100 and the Tag device 200 obtained through the calculation. For example, as shown in FIG. 5(a), the mobile phone 100 determines the distance between the mobile phone 100 and the Tag device 200 at time t 01 In another example, as shown in FIG. 5(b), the mobile phone 100 displays “You are 5.3 m away from the Tag device” at time t 02 In another example, as shown in FIG. 5(c), the mobile phone 100 displays “You are 5.7 m away from the Tag device” at time t 03 It displays "You are 4.9m away from the Tag device."
[0059] In the above-mentioned distance measurement method, the user performs a search operation once on the mobile phone 100, and the Tag device 200 continuously transmits multiple groups of sound signals, and the mobile phone 100 can determine the arrival time corresponding to each group of sound signals based on the received multiple groups of sound signals. The mobile phone 100 can calculate the real-time distance between the mobile phone 100 and the second electronic device when each group of sound signals arrives at the mobile phone 100 based on the arrival time corresponding to each group of sound signals, the transmission time corresponding to each group of sound signals, and the sound wave speed. Based on this, the mobile phone 100 can continuously refresh the real-time distance between the mobile phone 100 and the Tag device 200. The distance measurement method is easy for users to operate and improves the user experience. In addition, since the frequency of the sound wave is high, the transmission interval between the sound signals of two adjacent groups can be flexibly adjusted. Therefore, the frequency of refreshing the real-time distance by the mobile phone 100 can be guaranteed. Even if the user moves a little while carrying the mobile phone 100, the mobile phone 100 can accurately display the change in the distance between the mobile phone 100 and the Tag device 200 in real time, so that the user can timely adjust the solution for searching for the Tag device 200. This reduces the difficulty for the user when searching for the Tag device 200.
[0060] It can be understood that in addition to the mobile phone 100, the first electronic device mentioned above in this application may be any portable and mobile electronic device, such as a wristwatch, a tablet computer, a notebook computer, a Tag device, a laptop computer, a wearable device, a head-mounted display, a portable game console, a portable music player, or a reader device. In addition to the Tag device 200, the second electronic device may also be any portable and mobile electronic device, such as a mobile phone, a wristwatch, a tablet computer, a notebook computer, a laptop computer, a wearable device, a head-mounted display, a portable game console, a portable music player, or a reader device. Also, the example embodiments of the first electronic device and the second electronic device include, but are not limited to, various electronic devices running Linux operating system, operating system developed by Microsoft (Windows), mobile operating system developed by Apple (iOS), Android (Android) open source operating system, Harmony operating system (HUAWEI Harmony OS), or other operating systems. This is not particularly limited in this application.
[0061] For ease of explanation, the following continues to describe in detail the distance measurement method in this application with reference to Figures 3 and 4 by using an example in which the first electronic device is a mobile phone 100 and the second electronic device is a Tag device 200.
[0062] FIG. 6 is a diagram of the configuration of the mobile phone 100 and the Tag device 200 according to some embodiments of this application. As shown in FIG. 6, in some embodiments of this application, the mobile phone 100 includes a communication module 101, an audio module 102, a processor 103, a memory 104, and a display module 105. The Tag device 200 includes a communication module 201 and an audio module 202. The communication module 101, the audio module 102, the processor 103, and the display module 105 are connected via a bus to perform data exchange. The communication module 201 establishes a signal connection with the audio module 202 to perform data exchange. The communication module 101 and the communication module 201 are configured to establish a communication connection between the mobile phone 100 and the Tag device 200. For example, the communication module 101 and the communication module 201 may be a Bluetooth module. The audio module 102 and the audio module 202 are configured to transmit and / or receive sound wave signals. For example, the audio module 102 can be a microphone, and the audio module 202 can be a speaker. The processor 103 can call relevant instructions to control the audio module 101 and the audio module 202 to execute the distance measurement method in this application, and can obtain the real-time distance between the mobile phone 100 and the Tag device 200 based on the execution result of the audio module 101 and the audio module 202. For example, the processor 103 can be a processing chip integrated in the mobile phone 100. The memory 104 is configured to store distance measurement related instructions and data, such as multiple groups of received sound wave signals. The display module 105 is configured to display the real-time distance obtained by the processor 103. For example, the display module 105 can be a display or a speaker. The display manner of the real-time distance is not particularly limited in this application.
[0063] In some other embodiments of this application, the mobile phone 100 includes a communication module 101, an audio module 102, a processor 103, a memory 104, and a display module 105. The Tag device 200 includes a communication module 201, an audio module 202, a processor 203, and a memory 204. The communication module 101, the audio module 102, the processor 103, the memory 104, the display module 105, the communication module 201, and the audio module 202 are the same as those in the previous embodiment, and the details are not described again here. The processor 203 is configured to obtain the transmission time points corresponding to the sonic signals of each group through processing based on related instructions, and the memory 204 is configured to store distance measurement related instructions and the transmission time points corresponding to the sonic signals of each group. For example, the processor 203 can be a processing chip integrated into the Tag device 200.
[0064] In some other embodiments of this application, the mobile phone 100 includes a communication module 101, an audio module 102, and a display module 105. The Tag device 200 includes a communication module 201, an audio module 202, a processor 203, and a memory 204. The communication module 101, the audio module 102, the display module 105, the communication module 201, and the audio module 202 are the same as those in the previous embodiment, and the details are not described again here. The processor 203 is not only configured to obtain the transmission time point corresponding to each group of sonic signals through processing based on related instructions, but also configured to obtain the real-time distance between the mobile phone 100 and the Tag device 200 through processing based on related instructions. The memory 204 is configured to store instructions on distance measurement, the transmission time point corresponding to each group of sonic signals, and the real-time distance between the mobile phone 100 and the Tag device 200.
[0065] FIG. 7 is a diagram of a specific configuration of a mobile phone 100 and a Tag device 200 according to some embodiments of the present application.
[0066] As shown in Fig. 7, the mobile phone 100 includes a Bluetooth module 101a, a microphone 102a, a processor 103, a memory 104, and a display module 105. The Tag device 200 includes a Bluetooth module 201a and a speaker 202a. The mobile phone 100 establishes a communication connection to the Tag device 200 by using the Bluetooth module 101a and the Bluetooth module 201a to transmit data and instructions between the mobile phone 100 and the Tag device 200. The Tag device 200 transmits sound wave signals through the speaker 202a, and the mobile phone 100 receives and collects the sound wave signals through the microphone 102a.
[0067] It can be understood that the sonic signal transmitted by the speaker 202a and the sonic signal received by the microphone 102a are not particularly limited in this application, as long as it is ensured that the frequency band of the sonic signal transmitted by the speaker 202a is within the frequency band range that can be received by the microphone 210a. For example, in some implementations of this application, the Tag device 200 may transmit an ultrasonic signal through the speaker 202a, and the mobile phone 100 can receive and collect the ultrasonic signal through the microphone 102a. In this measurement method, the mobile phone, the tablet computer, and the notebook computer all have a microphone and a speaker, and the Tag device has a speaker. For example, the distance between any one of the items such as the mobile phone, the tablet computer, and the notebook computer and the Tag device, and the distance between any two of the mobile phone, the tablet computer, and the notebook computer can be measured by using ultrasonic waves. In this case, the application scope of this application is expanded, the hardware cost is reduced, and the economic benefit is improved.
[0068] The measurement solution of the measurement system provided in this application will be described in detail below with reference to specific embodiments.
[0069] 8 is a flowchart of a distance measurement method according to some embodiments of this application. The distance measurement method provided in this application will be described below with reference to FIG. 8. Specifically, as shown in FIG. 8, the distance measurement method provided in this application includes the following steps:
[0070] Step S801: The mobile phone 100 establishes a Bluetooth connection to the Tag device 200, and the mobile phone 100 receives a distance measurement command.
[0071] In this application, when a user wants to find the Tag device 200 by using the mobile phone 100, the user may execute a search operation for the Tag device 200 on the mobile phone 100 (e.g., the above-mentioned related description of the user operation in FIG. 3(a) and FIG. 3(b)). The mobile phone 100 receives a distance measurement command generated based on the search operation. The distance measurement command refers to instruction information generated by the mobile phone 100 based on a user operation, which instructs the mobile phone 100 to interact with the Tag device 200 to obtain a real-time distance between the mobile phone 100 and the Tag device 200. In some implementations, the distance measurement command further carries the identification information of the Tag device 200, so that the interaction with the Tag device 200 can be accurately established when there are multiple related electronic devices around the mobile phone 100.
[0072] Also, the mobile phone 100 establishes a Bluetooth connection to the Tag device 200 based on the distance measurement command. Certainly, it is not difficult to understand that the mobile phone 100 may implement the communication connection between the mobile phone 100 and the Tag device 200 in another manner, for example, the communication connection between the mobile phone 100 and the Tag device 200 may be established in a manner such as a Nearby module or near-field communication (NFC). However, it should be noted that since the user (i.e., the mobile phone 100) does not know the specific location of the Tag device 200, only a wireless communication connection can be made between the mobile phone 100 and the Tag device 200. Based on this, any manner capable of implementing a wireless communication connection between the mobile phone 100 and the Tag device 200 falls within the scope of protection of this application. This is not particularly limited in this application.
[0073] In some implementations of this application, the mobile phone 100 establishes a communication connection to the Tag device 200, and then the mobile phone 100 generates a distance measurement command based on the user's touch operation. In some other alternative implementations of this application, the mobile phone 100 generates a distance measurement command based on the user's touch operation, and the first electronic device establishes a communication connection to the second electronic device. In some other alternative implementations of this application, the first electronic device establishes a communication connection to the second electronic device, and the mobile phone 100 simultaneously generates a distance measurement command based on the user's touch operation. In other words, in this application, the order in which the first electronic device establishes a communication connection to the second electronic device and the mobile phone 100 receives the distance measurement command is not particularly limited in this application.
[0074] Step S802: The mobile phone 100 calculates the RSSI of the Tag device 200.
[0075] In this application, the Bluetooth module 101a in the mobile phone 100 calculates the RSSI corresponding to the Tag device 200 based on the Bluetooth signal received from the Bluetooth module 200a in the tag device 201. RSSI refers to a Received Signal Strength Indication (RSSI) obtained based on the received Bluetooth signal. RSSI represents the strength of the Bluetooth signal transmitted by the Tag device 200 and received by the mobile phone 100, and can also be understood as the association between the mobile phone 100 and the Tag device 200 in the current state.
[0076] For example, a larger RSSI value indicates that the mobile phone 100 is closer to the Tag device 200, in other words, the association between the Tag device 200 and the mobile phone 100 is stronger, the stability of the Bluetooth connection between the mobile phone 100 and the Tag device 200 is higher, and it is easier for the user to find the Tag device 200 by using the mobile phone 100. A smaller RSSI value indicates that the mobile phone 100 is farther away from the Tag device 200, in other words, the association between the Tag device 200 and the mobile phone 100 is weaker, and it is more likely that the user will not be able to find the Tag device 200 by using the mobile phone 100.
[0077] Step S803: The mobile phone 100 determines whether the RSSI of the Tag device 200 is greater than a preset strength threshold.
[0078] If the RSSI of the Tag device 200 is greater than the preset intensity threshold, it indicates that the intensity of the Bluetooth signal received by the Bluetooth module 101a is strong, in other words, the Bluetooth module 101a is close to the Bluetooth module 201a, which means that the mobile phone 100 is close to the Tag device 200. Therefore, the distance between the mobile phone 100 and the Tag device 200 needs to be further determined, and step S804 is performed. If the RSSI of the Tag device 200 is not greater than the preset intensity threshold, it indicates that the intensity of the Bluetooth signal received by the Bluetooth module 101a is weak, in other words, the Bluetooth module 101a is far away from the Bluetooth module 201a, which may even cause inaccurate distance measurement. In this case, return to step S802.
[0079] In this application, after obtaining the RSSI, the mobile phone 100 determines whether the RSSI is greater than a preset strength threshold, which is an approximation of the received signal strength indication determined based on the association strength between the mobile phone 100 and the Tag device 200. The preset strength threshold is used to determine whether the mobile phone 100 is near the Tag device 200.
[0080] Step S804: The mobile phone 100 performs Bluetooth time synchronization with the Tag device 200 to obtain the time offset between the mobile phone 100 and the Tag device 200.
[0081] Bluetooth time synchronization refers to determining the time offset between the mobile phone 100 and the Tag device 200 by using the Bluetooth module 101a in the mobile phone 100 and the Bluetooth module 201a in the Tag device 200. The time offset refers to the difference in time displayed on the mobile phone 100 and the Tag device 200. It is easy to understand that the mobile phone 100 and the Tag device 200 each have their own clock, so the time corresponding to the mobile phone 100 and the time corresponding to the Tag device 200 can be obtained separately by statistics. However, in some cases, due to setting errors or construction errors, the time corresponding to the mobile phone 100 may not match the time corresponding to the Tag device 200. In order to reduce the distance error in the distance measurement calculation caused by such a discrepancy, in some embodiments of this application, the time offset between the mobile phone 100 and the Tag device 200 needs to be further measured.
[0082] In some embodiments of this application, the time offset is Δ=T T -T P where Δ represents a time offset between the mobile phone 100 and the Tag device 200, with a positive value representing that the time corresponding to the Tag device 200 is earlier than the time corresponding to the mobile phone 100 and a negative value representing that the time corresponding to the Tag device 200 is later than the time corresponding to the mobile phone 100; T T represents the time corresponding to the Tag device 200 at a given time, and T P represents the time corresponding to the mobile phone 100 at a given point in time.
[0083] The transmission speed of electromagnetic waves is about 3×10 8m / s, when the mobile phone 100 is near the Tag device 200, the transmission time is approximately 0. Based on this, when a group of electromagnetic waves is transmitted between the mobile phone 100 and the Tag device 200 at one time, the transmission time and arrival time of the electromagnetic waves approximately represent the time offset between the mobile phone 100 and the Tag device 200. That is, T P1 ≒T T1 -Δ1, where Δ1 is the time offset corresponding to the first group, T P1 represents the departure time when the electromagnetic wave leaves the mobile phone 100 or the arrival time when the electromagnetic wave arrives at the mobile phone 100, and T T1 represents the departure time when the electromagnetic wave leaves the Tag device 200, or the arrival time when the electromagnetic wave arrives at the Tag device 200. Similarly, T Pi ≒T Ti -Δ i where the value of i ranges from 1 to k, which is not particularly limited in this application; Δ i is the time offset corresponding to the i-th group, and T Pi represents the departure time when the electromagnetic wave leaves the mobile phone 100 or the arrival time when the electromagnetic wave arrives at the mobile phone 100, and T Ti represents the departure time when the electromagnetic wave leaves the Tag device 200, or the arrival time when the electromagnetic wave arrives at the Tag device 200.
[0084] The Bluetooth time synchronization method in this application will be described in detail below with reference to Fig. 9. It can be understood that the time offset Δ of each transmission cycle is affected by system scheduling, so that in order to reduce the error, a method of performing time synchronization multiple times to obtain an average value can be used to suppress the influence of system scheduling on the time offset Δ. In some embodiments of this application, first, the mobile phone 100 receives a time T P1 At time T T1 Receive a Bluetooth time synchronization signal SEQ1 at T P1is the time recorded by the local clock of the mobile phone 100, and T T1 is the time recorded by the local clock of the Tag device 200, i.e., Δ1 ≈ T T1 -T P1 where Δ1 is the time offset obtained in the first measurement. After receiving the Bluetooth time synchronization signal SEQ1, the Tag device 200 T2に At time T P2 Receive the Bluetooth time synchronization signal SEQ2 at T P2 is the time recorded by the local clock of the mobile phone 100, and T T2 is the time recorded by the local clock of the Tag device 200, i.e., Δ2 ≈ T T2 -T P2 By analogy, T P2n is the time recorded by the local clock of the mobile phone 100, and T T2n is the time recorded by the local clock of the Tag device 200, i.e., Δ 2n ≒T T2n -T P2n It is.
[0085] Based on this, after 2n iterations, the average time offset is
number
[0086] It is not difficult to find Δ1, Δ2, Δ3, …, Δ 2n-1 , Δ 2n After each expansion, the following equation (1) is obtained:
number
[0087] After transformation, we obtain the following equation (2):
number
[0088] After transformation, we obtain the following equation (3):
number
[0089] In some implementations, each time a SEQ signal is transmitted, the Tag device 200 receives the SEQ signal at a reception time T T(2i-1) And the reception time is T T(2i-1) The transmission time T corresponding to the Bluetooth time synchronization signal is T(2i) and may be fed back to the mobile phone 100. After receiving the data, the mobile phone 100 obtains the time offset Δ through calculation based on equation (3).
[0090] In some other implementations, since the left part of equation (3) (i.e., equation (4)) only relates to the receiving and transmitting times of the Tag device 200, the average values of the receiving and transmitting times may first be calculated by using equation (4), and then the average values are fed back to the mobile phone 100 at once via Bluetooth.
number
[0091] Step S805: The mobile phone 100 notifies the Tag device 200 to transmit multiple groups of sound wave signals, and detects the multiple groups of sound wave signals transmitted by the Tag device 200.
[0092] In this application, the mobile phone 100 generates a sound emission command to notify the Tag device 200 to start transmitting a sound signal, and sends the sound emission command to the Tag device 200. In response to the sound emission command, the Tag device 200 continuously transmits multiple groups of sound signals. The mobile phone 100 can continuously receive the multiple groups of sound signals. The sound emission command refers to instruction information sent by the mobile phone 100 to the Tag device 200 to instruct the Tag device 200 to start transmitting a sound signal. It can be understood that the sound emission command can further include parameters of the sound signal transmitted by the Tag device 200, such as a transmission time point, a transmission interval, or a sound wavelength (i.e., a sound frequency band), which will be described in detail below, and the concept of the sound emission command will not be described in detail below.
[0093] In some application scenarios, the Tag device 200 transmits an acoustic signal in a use state, and the Tag device 200 does not transmit an acoustic signal in a natural state. In some embodiments of this application, before the mobile phone 100 establishes a communication connection to the Tag device 200 and the mobile phone 100 receives a distance measurement command, the Tag device 200 needs to be further bound to a related application of the mobile phone 100. Based on this, after the mobile phone 100 establishes a communication connection to the Tag device 200 and the mobile phone 100 receives a distance measurement command, the mobile phone 100 can send an acoustic signal transmission request to the Tag device 200, so that the Tag device 200 transmits an acoustic signal and devices other than the Tag device 200 do not transmit acoustic signals. Based on this, the method can avoid the mobile phone 100 receiving an acoustic signal transmitted by a device other than the Tag device 200, reduce the processing difficulty of the mobile phone 100, improve the processing efficiency of the mobile phone 100, improve the response speed of the mobile phone 100, and further improve the user experience.
[0094] In some other application scenarios, the Tag device 200 transmits an acoustic signal in a use state, and the Tag device 200 also transmits an acoustic signal in a natural state. Specifically, in some other embodiments, the Tag device 200 always transmits an acoustic signal, and the mobile phone 100 determines whether it needs to receive the acoustic signal transmitted by the Tag device 200 based on the RSSI. If the mobile phone 100 determines that it needs to receive the acoustic signal transmitted by the Tag device 200, the mobile phone 100 starts to receive the acoustic signal transmitted by the Tag device 200. If the mobile phone 100 determines that it does not need to receive the acoustic signal transmitted by the Tag device 200, the mobile phone 100 does not receive the acoustic signal transmitted by the Tag device 200.
[0095] However, in these application scenarios, in addition to the Tag device 200, other electronic devices may be distributed around the mobile phone 100 and may also transmit sonic signals. In this case, the mobile phone 100 cannot identify the sonic signal transmitted by the Tag device 200 from the received sonic signals. Based on this, in some implementations of this application, the sonic signal transmitted by the Tag device 200 further carries the device identifier of the Tag device 200. The mobile phone 100 identifies which sonic signal is the sonic signal transmitted by the Tag device 200 by using the device identifier of the Tag device 200. Also, in some other implementations of this application, when the Tag device 200 transmits time information to the mobile phone 100, the time information further carries the device identifier of the Tag device 200.
[0096] In some embodiments of this application, the mobile phone 100 detects (i.e., receives) a first group of sound wave signals at a first time point, and detects (i.e., receives) a second group of sound wave signals at a second time point after the first time point. The first group of sound wave signals is a segment of a sound wave signal, and the second group of sound wave signals is another segment of a sound wave signal. The mobile phone 100 can continuously detect the first group of sound wave signals and the second group of sound wave signals, and determine the starting bands of the first group of sound wave signals and the second group of sound wave signals through correlation calculation to separate the first group of sound wave signals and the second group of sound wave signals.
[0097] In some other alternative embodiments of this application, the mobile phone 100 detects (i.e., receives) the first group of sonic signals at a first time point, detects (i.e., receives) the third group of sonic signals at a fifth time point, and detects (i.e., receives) the second group of sonic signals at a second time point after the first time point. The fifth time point is between the first time point and the second time point. Specifically, the mobile phone 100 determines a first distance between the mobile phone 100 and the Tag device 200 corresponding to the first time point based on the first group of sonic signals, the third group of sonic signals, the first information, and the third information corresponding to the third group of sonic signals. The first electronic device determines a second distance between the mobile phone 100 and the Tag device 200 corresponding to the second time point based on the second group of sonic signals, the third group of sonic signals, the second information, and the third information. For example, the mobile phone 100 receives six groups of sound signals transmitted by the Tag device 200 in succession, namely, sound signal 1, sound signal 2, sound signal 3, sound signal 4, sound signal 5, and sound signal 6. Based on the moving speed of the mobile phone 100 and the distance between the mobile phone 100 and the Tag device 200, it is determined that the distance between the mobile phone 100 and the Tag device 200 when the sound signal 1, the sound signal 4, and the sound signal 6 arrive at the mobile phone 100 needs to be displayed on the mobile phone 100. Based on this, the mobile phone 100 can determine the distance between the mobile phone 100 and the Tag device 200 when the sound signal 1 arrives at the mobile phone 100 based on the sound signal 1 (or further including the sound signal 2, or further including the sound signal 2 and the sound signal 3). Based on the sound wave signal 2, the sound wave signal 3, and the sound wave signal 4, the mobile phone 100 can determine the distance between the mobile phone 100 and the Tag device 200 when the sound wave signal 4 arrives at the mobile phone 100. Similarly, based on the sound wave signal 5 and the sound wave signal 6, the mobile phone 100 can determine the distance between the mobile phone 100 and the Tag device 200 when the sound wave signal 6 arrives at the mobile phone 100. The above are only a few examples, which are not particularly limited in this application.
[0098] It can be understood that the above two types of embodiments are just some examples of the sonic signals received by the mobile phone 100. In this application, the mobile phone 100 can receive the sonic signals transmitted by any group of Tag devices 200 at any time. This falls within the scope of protection of this application and is not particularly limited in this application.
[0099] Step S806: The mobile phone 100 calculates the real-time distance between the mobile phone 100 and the Tag device 200 based on the detected acoustic signal, the information corresponding to the acoustic signal, and the time offset.
[0100] In this application, the information corresponding to the sonic signal includes transmission time information of when the Tag device 200 transmits the sonic signal of the group of transmitting sonic signals. The transmission time information is information that can represent the transmission time point of the sonic signal of the group. For example, the transmission time information may be the transmission time point corresponding to the sonic signal, or the transmission interval corresponding to the sonic signal. This is not particularly limited in this application. The following describes a real-time distance calculation method by using the above two types of transmission time information.
[0101] Based on this, the mobile phone 100 can determine, based on the detected sonic signals, the reception time at which each of the plurality of groups of sonic signals is received, when the sonic signals of that group arrive at the mobile phone 100. Then, based on the transmission time of each group of sonic signals, the reception time of each group of sonic signals, and the sonic speed, the mobile phone 100 calculates the distance between the mobile phone 100 and the Tag device 200 when each group of sonic signals is received.
[0102] In some embodiments of this application, the mobile phone 100 detects (i.e., receives) a first group of sound wave signals at a first time point and detects (i.e., receives) a second group of sound wave signals at a second time point after the first time point.
[0103] Specifically, as shown in FIG. 10(a), after detecting the first group of sound wave signals, the mobile phone 100 determines the reception time t when the first group of sound wave signals are received by the mobile phone 100 based on the first group of sound wave signals. 21 Then, the mobile phone 100 determines the transmission time t 11 and reception time t 21 , the time offset Δ, and the sound wave speed, 21 Calculate the distance d1 between the mobile phone 100 and the Tag device 200 at time t 21 At time t 21 After a short time, display d1.
[0104] In this application, the distance can be calculated based on a distance calculation formula. The principle of calculating the following distances is the same as the principle of calculating the distance d1, and the details will not be described below. For example, the distance calculation formula is d k =(t 2k -t 1k +Δ)v, where d k represents the real-time distance, k represents the number of groups of sonic signals, and t 2k represents the arrival time when the sound wave signal of the kth group arrives at the mobile phone 100, and t 1k represents the transmission time point when the k-th group of acoustic signals starts to be transmitted.
[0105] Similarly, please refer to FIG. 10(a). After detecting the second group of sound wave signals, the mobile phone 100 determines the reception time t 1 at which the second group of sound wave signals are received by the mobile phone 100 based on the second group of sound wave signals. 22 Then, the mobile phone 100 determines the transmission time t 12 and reception time t 22 , the time offset Δ, and the sound wave speed, 22 Calculate the distance d2 between the mobile phone 100 and the Tag device 200 at time t22 At time t 22 After a short time, display d2.
[0106] In some implementations of this application, as shown in FIG. 10(b), the second group of acoustic signals is transmitted from the Tag device 200 at a transmission time t 12 Instead of t 11 +T u1 where T u1 represents the transmission interval between transmitting the second group of sonic signals by the Tag device 200 and transmitting the first sonic signal by the Tag device 200. In this case, d2=(t 22 -(t 11 +T u1 )+Δ)v. By analogy, d3=(t 23 -(t 11 +T u1 +T u2 )+Δ)v.
[0107] That is, d k =(t 2k -(t 11 +T u1 +…+T u(k-1) ) + Δ)v, where d k represents the real-time distance, and t 2k represents the arrival time when the sound wave signal of the kth group arrives at the mobile phone 100, and t 11 represents the transmission time when the first group of sonic signals starts to be transmitted, k represents the number of groups of sonic signals, and T u(k-1) represents the transmission interval between the (k-1)th group acoustic signal and the kth group acoustic signal, v represents the acoustic velocity, and Δ represents the time offset.
[0108] In some implementations of this application, the transmission interval between two adjacent groups of acoustic signals is Tu, as shown in FIG. 10(c). In this case, d k =(t 2k -(t 11 +(k-1)T u ) + Δ)v, where d k represents the real-time distance, and t2k represents the arrival time when the sound wave signal of the kth group arrives at the mobile phone 100, and t 11 represents the transmission time when the first group of sonic signals starts to be transmitted, k represents the number of groups of sonic signals, and T u represents the transmission interval between the acoustic signals of two adjacent groups, v represents the acoustic velocity, and Δ represents the time offset.
[0109] Step S807: The mobile phone 100 displays the real-time distance obtained through calculation in real-time.
[0110] In this application, after receiving the first group of sound signals, the mobile phone 100 calculates a first distance corresponding to the first group of sound signals, and displays the first distance in real time after calculating the first distance. Similarly, after receiving the second group of sound signals, the mobile phone 100 calculates a second distance corresponding to the second group of sound signals, and displays the second distance in real time after calculating the second distance. Note that in this application, the mobile phone 100 processes the received first group of sound signals only after the mobile phone 100 receives the second group of sound signals. Although these two groups of sound signals can have a suitable delay relationship, there is no sequence of transfer steps between these two groups of sound signals.
[0111] Step S808: The mobile phone 100 determines whether the time interval since the last Bluetooth time synchronization is less than the preset time threshold. If the time interval since the last Bluetooth time synchronization is less than the preset time threshold, return to step S806. If the time interval since the last Bluetooth time synchronization is not less than the preset time threshold, return to step S804.
[0112] In this application, each time the preset time threshold Tb is reached, the mobile phone 100 and the Tag device 200 will restart the Bluetooth time synchronization. After the Bluetooth time synchronization is finished, an updated time offset Δ′ is obtained, and the real-time distance calculation formula is dk=(t 2k -t1k +Δ′)v. Based on this, the mobile phone 100 and the Tag device 200 periodically perform Bluetooth time synchronization so that the time drift (i.e., time offset) between the mobile phone 100 and the Tag device 200 can be corrected. This ensures the accuracy of the distance measurement.
[0113] In some embodiments of this application, as shown in Fig. 10(a), the mobile phone 100 performs Bluetooth time synchronization with the Tag device 200 at a third time point to determine a first time offset Δ between the mobile phone 100 and the Tag device 200 corresponding to the third time point t3. The mobile phone 100 determines a first distance after the third time point t3 based on the first time offset Δ, the first group of sonic signals, and the first information. The mobile phone 100 determines a second distance after the third time point t3 based on the first time offset Δ, the second group of sonic signals, and the second information.
[0114] In some other embodiments of this application, please still refer to Fig. 10(a). The mobile phone 100 performs Bluetooth time synchronization with the Tag device 200 at a fourth time point after a preset time from the third time point to determine a second time offset Δ' between the mobile phone 100 and the Tag device 200 corresponding to the fourth time point t4. The mobile phone 100 determines a first distance after the fourth time point t4 based on the second time offset Δ', the first group of sonic signals, and the first information. The mobile phone 100 determines a second distance after the fourth time point t4 based on the second time offset Δ', the second group of sonic signals, and the second information.
[0115] The Tag device 200 also includes a temperature sensor. After each time synchronization, the current temperature information is sent to the mobile phone 100 via Bluetooth. The mobile phone 100 calculates the sound speed: v=331+0.607Temp based on the current temperature information, where Temp is the temperature information fed back by the Tag device 200, and its unit is °C.
[0116] Also, in some embodiments of this application, when mobile phone 100 displays at least two distances and determines a third distance, mobile phone 100 may determine a recommended direction of movement for mobile phone 100 based on those three distances and the coordinates corresponding to those three distances determined by mobile phone 100.
[0117] Figures 11A and 11B are interaction diagrams corresponding to the distance measurement method of Figure 8 according to some embodiments of this application. In the following, the distance measurement solution provided in this application will be described in detail with reference to Figure 8 and Figures 11A and 11B. As shown in Figures 11A and 11B, a mobile phone 100 includes a Bluetooth module 101a, a microphone 102a, a processor 103, and a display module 105. A Tag device 200 includes a Bluetooth module 201a and a speaker 202a. Specifically, the distance measurement method provided in this application includes the following steps:
[0118] Step S1101: The Bluetooth module 101a establishes a Bluetooth connection to the Bluetooth module 201a.
[0119] In this application, the Bluetooth module 101a in the mobile phone 100 establishes a wireless communication connection to the Bluetooth module 201a in the Tag device 200. However, it can be understood that the communication connection method between the mobile phone 100 and the Tag device 200 is not particularly limited in this application. In addition to the Bluetooth pairing connection, the communication connection method in this application may be another communication connection method, which is not particularly limited in this application.
[0120] Step S1102: The Bluetooth module 101a receives the Bluetooth signal transmitted by the Bluetooth module 201a.
[0121] In this application, a Bluetooth signal refers to a broadcast packet transmitted by the Bluetooth module 201a and carrying parameters such as the identification information and signal strength of the Tag device 200. The Bluetooth module 101a in the mobile phone 100 can determine the identification information of the Tag device 200 and the signal strength of the Bluetooth signal based on the received Bluetooth signal.
[0122] In some embodiments of this application, the Bluetooth module 101a receives a periodic Bluetooth signal transmitted by the Bluetooth module 201a. The periodic Bluetooth signal is a Bluetooth signal transmitted by the Bluetooth module 201a based on a predetermined period. In some implementations of this application, the Bluetooth module 101a receives a predetermined number of Bluetooth signals transmitted by the Bluetooth module 201a. This is not particularly limited in this application.
[0123] It should be noted that in this application, the solution for transmitting the periodic Bluetooth signal received by the Bluetooth module 101a in the mobile phone 100 is not particularly limited in this application, and only the Bluetooth signal received by the Bluetooth module 201a in the Tag device 200 needs to be limited in this application. Specifically, in some implementations of this application, the Bluetooth module 201a in the Tag device 200 always transmits a periodic Bluetooth signal to the outside. After the Bluetooth module 101a establishes a communication connection to the Bluetooth module 201a, the Bluetooth module 101a starts to receive the periodic Bluetooth signal transmitted by the Bluetooth module 201a. In some other alternative implementations of this application, after the mobile phone 100 establishes a communication connection to the Tag device 200 by using the Bluetooth module 101a and the Bluetooth module 201a, the Bluetooth module 201a in the Tag device 200 starts to transmit a periodic Bluetooth signal to the outside.
[0124] Step S1103: The Bluetooth module 101a calculates the RSSI according to the received Bluetooth signal, and determines whether the RSSI obtained through the calculation is greater than the preset intensity threshold. If the RSSI obtained through the calculation is greater than the preset intensity threshold, proceed to step S1104. If the RSSI obtained through the calculation is not greater than the preset intensity threshold, return to step S1102. These steps are the same as steps S802 and S803, and the details are not described again here.
[0125] Step S1104: The Bluetooth module 101a performs Bluetooth time synchronization with the Bluetooth module 201a to determine the time offset Δ between the mobile phone 100 and the Tag device 200.
[0126] The time offset Δ between the mobile phone 100 and the Tag device 200 represents the difference between the clock display of the mobile phone 100 and the clock display of the Tag device 200, and is unrelated to the actual time. For example, if the clock of the mobile phone 100 shows 10:01:02 and the clock of the Tag device 200 shows 10:01:03, the time offset Δ between the mobile phone 100 and the Tag device 200 is 0.01 s. In another example, if the clock of the mobile phone 100 shows 10:01:03 and the clock of the Tag device 200 shows 10:01:02, the time offset Δ between the mobile phone 100 and the Tag device 200 is −0.01 s.
[0127] Step S1105a: The Bluetooth module 101a sends a collection command to the microphone 102a.
[0128] The collection command is instruction information generated by the mobile phone 100 when the Bluetooth module 101a determines that the RSSI is greater than a preset intensity threshold to instruct the microphone 102a to start collecting sound wave signals.
[0129] It should be noted that the technical solution of switching from step S1104 to step S1106 is an example of a technical solution in this application. This is not particularly limited in this application. For example, in this application, step S1104 may be executed, followed by step S1107, and then step S1106. In another example, in this application, step S1104 may be executed, followed by steps S1106 and S1107 simultaneously.
[0130] Step S1105b: The Bluetooth module 101a sends a sound emission start command to the Bluetooth module 201a.
[0131] Step S1106: In response to the sound emission start command, the microphone 102a starts to collect sound wave signals.
[0132] Step S1107: The speaker 202a starts transmitting a sound wave signal in response to the sound emission start command.
[0133] In this application, after the mobile phone 100 determines that the mobile phone 100 has established a communication connection to the Tag device 200, the Bluetooth module 101a sends a sound emission start command to the Bluetooth module 201a, and the speaker 202a of the Tag device 200 starts to transmit multiple groups of sound wave signals. The speaker 220 of the Tag device 200 can periodically transmit multiple groups of sound wave signals.
[0134] In some other embodiments of this application, after the mobile phone 100 determines that the mobile phone 100 has established a communication connection to the Tag device 200, the Bluetooth module 101a sends a sound emission start command carrying a preset transmission time to the Bluetooth module 201a, and the speaker 202a of the Tag device 200 starts to transmit multiple groups of sound wave signals based on the preset transmission time. The speaker 220 of the Tag device 200 may periodically transmit multiple groups of sound wave signals. In some implementations of this application, the number of groups of sound wave signals is a predetermined value.
[0135] In some other embodiments of this application, after the mobile phone 100 determines that the mobile phone 100 has established a communication connection to the Tag device 200, the Bluetooth module 101a sends a sound emission start command to the Bluetooth module 201a carrying a preset frequency band of a sound wave signal, and the speaker 202a of the Tag device 200 transmits the sound wave signal in the preset frequency band based on the sound emission start command.
[0136] Step S1108: The microphone 102a collects the sound wave signal transmitted by the speaker 202a.
[0137] In this application, the sonic signal transmitted by the Tag device 200 is a plurality of groups of sonic signals, and the microphone 102a of the mobile phone 100 can receive the plurality of groups of sonic signals transmitted by the speaker 202a of the Tag device 200. The sonic signal may be an ultrasonic signal whose frequency is higher than 20 kHz, or may be a sonic signal in another frequency band. This is not particularly limited in this application. The plurality of groups of sonic signals refers to a plurality of segments of a sonic signal that are respectively transmitted at intervals based on a specific transmission method.
[0138] In some implementations of this application, the frequency range of the sound wave signal is from 20 Hz to 2*10 4 Hz. In some alternative implementations of this application, the frequency range of the sound signal is 2*10 4 Hz to 1*10 12 Hz. In some alternative implementations of this application, the frequency range of the sound wave signal is from 20 Hz to 1*10 12 Hz. For example, the frequency range of a sound wave signal is 1.8*10 4 Hz to 2.2*10 4 Hz.
[0139] Step S1109: The Bluetooth module 101a receives the time information of the sound wave signal from the Bluetooth module 201a.
[0140] In this application, the time information is the transmission time information of the sound signal transmitted by the speaker 201a. The time information may include a transmission time point or a transmission interval. The transmission time point t1 of the sound signal of each group may be directly represented by the transmission start time point of the sound signal of each group, or the transmission time point t1 of the sound signal of the first group and the transmission interval T between the sound signals of two adjacent groups may be directly represented by the transmission start time point of the sound signal of each group, or the transmission time point t1 of the sound signal of the first group and the transmission interval T uThe time difference between the transmission time points of the acoustic signals of two adjacent groups is the transmission interval. This is not particularly limited in this application. In some implementations, the transmission intervals between the acoustic signals of the groups may be fixed or may be variable. For example, the transmission intervals are gradually shortened or the transmission intervals are gradually lengthened.
[0141] In this application, by using the Bluetooth module 101a and the Bluetooth module 201a, the transmission time of the sound wave signal of each group is fed back so that the transmission delay and the bit error rate can be reduced, which improves the accuracy of the distance measurement.
[0142] Then, in some implementations, the Tag device 200 determines the transmission interval between the sonic signals of the two adjacent groups, and transmits the sonic signals based on the determined transmission interval. In addition, the Tag device 200 further transmits the determined transmission interval to the mobile phone 100, so that the mobile phone 100 can calculate the transmission time of each subsequent group of sonic signals based on the transmission time and transmission interval of the sonic signals of the first group. Alternatively, the Tag device 200 calculates the transmission time of each group of sonic signals based on the determined transmission interval and the sonic signals of the first group, and transmits the calculated transmission time of each group of sonic signals to the mobile phone 100. Alternatively, when the transmission interval between the transmission time of the sonic signals of the two adjacent groups changes according to a preset change rule, the Tag device 200 can transmit the change rule to the mobile phone 100, or the Tag device 200 calculates the transmission time of each group of sonic signals according to the change rule, and transmits the transmission time of each group of sonic signals to the mobile phone 100.
[0143] Specifically, in some implementations, the Tag device 200 determines the transmission time of each group's sonic signal, and simultaneously transmits the transmission time of each group's sonic signal to the mobile phone 100. In some other implementations, the mobile phone 100 determines the transmission time of each group's sonic signal, and generates a transmission start command for each group's sonic signal based on the transmission time of each group's sonic signal. After receiving the transmission start command, the Tag device 200 transmits the sonic signal to the outside based on the command.
[0144] In addition, there are various implementations of the mobile phone 100 receiving the multiple groups of sound wave signals transmitted by the Tag device 200. Some implementation solutions are briefly described below. Specifically, in some implementations, the audio module 102 in the mobile phone 100 is always in an enabled state. After the mobile phone 100 establishes a communication connection to the Tag device 200, the audio module 202 in the Tag device 200 transmits multiple groups of sound wave signals to the outside, so that the audio module 102 can receive the multiple groups of sound wave signals transmitted by the audio module 202. In some other implementations, the Tag device 200 always transmits multiple groups of sound wave signals to the outside. After the communication module 101 in the mobile phone 100 establishes a communication connection to the communication module 201 in the Tag device 200, the audio module 102 in the mobile phone 100 is started to receive the multiple groups of sound wave signals transmitted to the outside by the Tag device 200. In some other implementations, after the mobile phone 100 establishes a communication connection to the Tag device 200, the audio module 102 in the mobile phone 100 is started, and the audio module 202 in the Tag device 200 transmits multiple groups of sound wave signals to the outside, so that the audio module 102 can receive the multiple groups of sound wave signals transmitted by the audio module 202.
[0145] Step S1110: In response to the microphone 102a, the processor 103 performs correlation calculation on the sonic signal to obtain the arrival time of the sonic signal, and then calculates the real-time distance between the mobile phone 100 and the Tag device 200 based on the corresponding arrival time, the time information and the sonic speed. The time information can include a transmission time and a transmission interval, and the time information may further include the sonic signal transmission time of each group, and the arrival time is the reception time when the sonic signal is received by the mobile phone 100.
[0146] In some embodiments of this application, the processor 103 in the mobile phone 100 performs correlation calculations on the received sound signals of the groups, and determines the starting positions of the sound signals of the groups based on the correlation between the sound signals of the groups and the template sound signal, and further determines the arrival time t2 of each of the sound signals of the groups. Then, the processor 103 in the mobile phone 100 acquires the transmission time t1 of each group of sound signals acquired by the Bluetooth module 101a via the bus. Then, the processor 103 calculates the real-time distance d between the mobile phone 100 and the Tag device 200 based on the transmission time t1, the arrival time t2, and the sound velocity v based on the formula: k Calculate.
[0147] Step S1111: The display module 105 receives the real-time distance from the processor 103, and then step S1112 is executed.
[0148] Step S1112: The display module 105 displays the real-time distance on the display interface.
[0149] In some embodiments of this application, when the real-time distance is within a preset range, the display module 105 of the mobile phone 100 displays the real-time distance. When the real-time distance is greater than the preset range, the mobile phone 100 is far away from the tag device, and the display module 105 of the mobile phone 100 does not display the distance. If the real-time distance is less than the preset range, a prompt is displayed indicating that the Tag device 200 is nearby. For example, the preset range is 1m to 20m, or the preset range is 1m to 10m.
[0150] Step S1113: The processor 130 judges whether a sound transmission stop command is received, and the sound transmission stop command may be an operation command generated based on a user's touch operation to instruct to stop searching. If a sound transmission stop command is received, proceed to step S1114a and step S1114b. If a sound transmission stop command is not received, return to step S1108.
[0151] Step S1114a: The microphone 102a stops collecting sound wave signals.
[0152] Step S1114b: The Bluetooth module 101a sends a sound emission stop command to the Bluetooth module 201a, and then step S1115 is executed.
[0153] Step S1115: The speaker 202a stops transmitting the sound wave signal in response to the sound stop command being received by the Bluetooth module 201a.
[0154] Step S1116: The Bluetooth module 101a disconnects the Bluetooth connection to the Bluetooth module 201a.
[0155] This application further provides some other embodiments. Figure 12 is a flowchart of a distance measurement method according to some embodiments of this application. The distance measurement method provided in this application will be described below with reference to Figure 12. Specifically, as shown in Figure 12, the distance measurement method provided in this application includes the following steps:
[0156] Step S1201: The mobile phone 100 establishes a Bluetooth connection to the Tag device 200, and the mobile phone 100 receives a distance measurement command. Step S1201 is the same as step S801, and the details are not described again here.
[0157] Step S1202: The mobile phone 100 calculates the RSSI of the Tag device 200. Step S1202 is the same as step S802, and the details are not described again here.
[0158] Step S1203: The mobile phone 100 judges whether the RSSI is greater than the preset intensity threshold. If the RSSI is greater than the preset intensity threshold, proceed to step S1204. If the RSSI is not greater than the preset intensity threshold, return to step S1202. Step S1203 is the same as step S803, and the details are not described again here.
[0159] Step S1204: The mobile phone 100 performs Bluetooth time synchronization with the Tag device 200 to obtain the time offset between the mobile phone 100 and the Tag device 200. Step S1204 is the same as step S804, and the details are not described again here.
[0160] Step S1205: The mobile phone 100 notifies the Tag device 200 to transmit multiple groups of sound wave signals at a specified time point, and receives the multiple groups of sound wave signals transmitted by the Tag device 200.
[0161] Step S1206: The mobile phone 100 calculates the real-time distance between the mobile phone 100 and the Tag device 200 according to the detected sound wave signal, the time information corresponding to the sound wave signal, and the time offset. The time information can be a specified time point. Step S1206 is the same as step S806, and the details are not described again here.
[0162] Step S1207: The mobile phone 100 displays the real-time distance obtained through calculation in real time. Step S1207 is the same as step S807, and the details are not described again here.
[0163] Step S1208: The mobile phone 100 determines whether the time interval since the last Bluetooth time synchronization is less than the preset time threshold. If the time interval since the last Bluetooth time synchronization is less than the preset time threshold, return to step S1206. If the time interval since the last Bluetooth time synchronization is not less than the preset time threshold, return to step S1204. Step S1208 is the same as step S808, and the details are not described again here.
[0164] In the above distance measurement method, the mobile phone 100 does not need to feed back the transmission time information of the sonic signals of each group via Bluetooth, so that the interaction between the mobile phone 100 and the Tag device 200 is reduced and the timeliness and accuracy of the distance measurement method is improved. In addition, the mobile phone 100 can further appropriately adjust the transmission time information corresponding to the sonic signals of the subsequent groups based on the distance between the mobile phone 100 and the Tag device 200 determined by the mobile phone 100.
[0165] In some embodiments of this application, when the value of the first distance determined by the mobile phone 100 is small, it indicates that the mobile phone 100 is close to the Tag device 200 and the user is about to find the Tag device 200. In this case, in order to improve the display accuracy of the distance between the mobile phone 100 and the Tag device 200, the transmission time interval between the first group of sound wave signals and the second group of sound wave signals may be shortened, in other words, the difference between the first time and the second time may be made smaller, so that the mobile phone 100 can also accurately capture the distance difference between the mobile phone 100 and the Tag device 200 when the mobile phone 100 moves a little.
[0166] In some other embodiments of this application, when the value of the first distance determined by the mobile phone 100 is small, it indicates that the mobile phone 100 is close to the Tag device 200 and the user is about to find the Tag device 200. In this case, the relative moving speed between the mobile phone 100 and the Tag device 200 may be slowed down to improve the display accuracy of the distance between the mobile phone 100 and the Tag device 200, so that when the mobile phone 100 moves a little, the mobile phone 100 can also accurately capture the distance difference between the mobile phone 100 and the Tag device 200.
[0167] Also, in some embodiments of this application, in the distance measuring method, first information corresponding to the first group of acoustic signals is determined by the mobile phone 100, and second information corresponding to the second group of acoustic signals is determined by the Tag device 200. The mobile phone 100 transmits the first information to the Tag device 200, and the Tag device 200 transmits the second information to the mobile phone 100. Alternatively, the second information is determined by the mobile phone 100, and the first information is determined by the Tag device 200. The mobile phone 100 transmits the second information to the Tag device 200, and the Tag device 200 transmits the first information to the mobile phone 100.
[0168] In one possible implementation, in the distance measurement method, the first information and the second information are determined by a third electronic device, and the mobile phone 100 and the Tag device 200 acquire the first information and the second information.
[0169] It can be understood that any combination of the above implementations falls within the scope of protection of this application, which is not specifically limited in this application.
[0170] Figures 13A and 13B are interaction diagrams corresponding to the distance measurement method in Figure 12 according to some embodiments of this application. Hereinafter, the distance measurement method provided in this application will be described in detail with reference to Figures 13A and 13B. Specifically, as shown in Figures 13A and 13B, the distance measurement method provided in this application includes the following steps:
[0171] Steps S1301 to S1305a, S1306, and S1308 are the same as steps S1101 to S1105a, S1106, and S1108, and the details will not be described again here.
[0172] Step S1305b: A sound transmission start command carrying a preset transmission time.
[0173] Step S1308: The microphone 102a collects the sound wave signal transmitted by the speaker 202a at the preset transmission time point.
[0174] Steps S1310 to S1316 are essentially the same as steps S1110 to S1116, and the details will not be described again here.
[0175] In conclusion, step S1305b is different from step S1105b. In addition, the step of the Bluetooth module 101a receiving the transmission time of each group of sound wave signals from the Bluetooth module 201a is deleted. This can reduce the interaction between the mobile phone 100 and the Tag device 200, improve the calculation efficiency, and avoid erroneous transmission, so that the accuracy of the real-time distance is improved.
[0176] This application further provides some other embodiments. Figure 14 is a flowchart of a distance measurement method according to some embodiments of this application. The distance measurement method provided in this application will be described below with reference to Figure 14. Specifically, as shown in Figure 14, the distance measurement method provided in this application includes the following steps:
[0177] Step S1401: The mobile phone 100 establishes a Bluetooth connection to the Tag device 200, and the mobile phone 100 receives a distance measurement command. Step S1401 is the same as step S801, and the details are not described again here.
[0178] Step S1402: The mobile phone 100 calculates the RSSI of the Tag device 200. Step S1402 is the same as step S802, and the details are not described again here.
[0179] Step S1403: The mobile phone 100 judges whether the RSSI is greater than the preset intensity threshold. If the RSSI is greater than the preset intensity threshold, proceed to step S1404. If the RSSI is not greater than the preset intensity threshold, return to step S1402. Step S1403 is the same as step S803, and the details are not described again here.
[0180] Step S1404: The mobile phone 100 performs Bluetooth time synchronization with the Tag device 200. Step S1404 is the same as step S804, and the details are not described again here.
[0181] Step S1405: After the mobile phone 100 notifies the Tag device 200 to send multiple groups of sound signals and receives the acknowledgement text information, the mobile phone 100 receives the multiple groups of sound signals sent by the Tag device 200 and the transmission time points of each group of sound signals sent via Bluetooth.
[0182] After the Bluetooth time synchronization is completed, the mobile phone 100 needs to notify the Tag device 200 to send a sound signal each time. After receiving the notification, the Tag device 200 sends acknowledgement (ACK) text information to the mobile phone 100 through Bluetooth, and then sends a sound signal to notify the mobile phone 100 through Bluetooth of the time when the Tag device 200 sends the sound signal.
[0183] Step S1406: The mobile phone 100 calculates the real-time distance between the mobile phone 100 and the Tag device 200 based on the received acoustic signal. The mobile phone 100 determines the real-time distance between the mobile phone 100 and the Tag device 200 based on the received acoustic signal, the time information, and the acoustic speed. Step S1406 is basically the same as step S806, and the details are not described again here.
[0184] Step S1407: The mobile phone 100 displays the real-time distance obtained through calculation in real time. Step S1407 is the same as step S807, and the details are not described again here.
[0185] Step S1408: The mobile phone 100 judges whether the time interval from the last Bluetooth time synchronization is less than the preset time threshold. If the time interval from the last Bluetooth time synchronization is less than the preset time threshold, return to step S1406. If the time interval from the last Bluetooth time synchronization is not less than the preset time threshold, return to step S1404. Step S1408 is the same as step S808, and the details are not described again here.
[0186] In the above distance measurement method, after Bluetooth time synchronization, the mobile phone 100 directly informs the Tag device 200 of the start time when the mobile phone 100 starts to transmit the ultrasonic signal. Thus, the Tag device 200 does not need to feed back the transmission time of the Tag device 200 via Bluetooth. This reduces the interaction between the mobile phone 100 and the Tag device 200.
[0187] Figures 15A and 15B are interaction diagrams corresponding to the distance measurement method of Figure 14 according to some embodiments of this application. The distance measurement method provided in this application will be described below with reference to Figures 15A and 15B. As shown in Figures 15A and 15B, the distance measurement method in this application includes the following steps:
[0188] Steps S1501 to S1506 are the same as steps S1101 to S1106, and the details will not be described again here.
[0189] Step S1507: The Bluetooth module 201a sends an ACK to the Bluetooth module 101a.
[0190] Steps S1508 to S1517 are essentially the same as steps S1107 to S1116, and the details will not be described again here.
[0191] In conclusion, step S1507 is added in this embodiment of this application. Thus, after performing time synchronization once, the mobile phone 100 periodically triggers the Tag device 200 to send multiple groups of sound wave signals for the mobile phone 100 to perform distance measurement. The mobile phone 100 can calculate and display the distance to the Tag device 200 in real time. This realizes the proper control of the measurement system.
[0192] Also, in some embodiments of this application, Bluetooth interaction information (such as time synchronization information, transmission time information, and temperature information) between the mobile phone 100 and the Tag device 200 is stored in a log. The sound wave signal is stored in the microphone recording module.
[0193] FIG. 16 is a diagram of a hardware configuration of a mobile phone 100 according to an embodiment of the present application.
[0194] As shown in FIG. 16, using a mobile phone 100 as an example, the mobile phone 100 may include a processor 110 (i.e., the above-mentioned processor 103), an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160 (i.e., the communication module 101), an audio module 170 (i.e., the above-mentioned audio module 102), a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194 (i.e., the above-mentioned display module 105), a subscriber identity module (SIM) card interface 195, an EDL mode protection circuit, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, an optical proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
[0195] Processor 110 may include one or more processing units. For example, processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a neural-network processing unit (NPU), and / or the like. Different processing units may be separate components or may be integrated into one or more processors.
[0196] A memory may further be disposed in the processor 110 and configured to store instructions and data. In some embodiments, the memory in the processor 110 is a cache. The memory may store instructions or data that are recently or periodically used by the processor 110. When the processor 110 needs to use those instructions or data again, the processor 110 can directly call those instructions or data from the memory. This avoids repeated access, reduces the latency of the processor 110, and improves system efficiency. In some embodiments, the processor 110 may implement the distance measurement method provided in the embodiment of this application by calling and executing the instructions of the distance measurement method provided in the embodiment of this application stored in the memory. In some other embodiments, the memory in the processor 110 may further be configured to store the above-mentioned first image file, instructions corresponding to the pre-set signature method, and the device identifier of the mobile phone 100, etc.
[0197] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, a universal serial bus (USB) interface, and / or the like. In some other embodiments, after the mobile phone 100 enters the EDL mode, a host device may establish a communication connection to the mobile phone 100 via the USB interface to access data in the mobile phone 100.
[0198] The charging management module 140 is configured to receive a charging input from a charger. The charging management module 140 provides power to the mobile phone 100 by using a power management module 141 while charging the battery 142.
[0199] The power management module 141 is configured to connect to the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, etc.
[0200] The wireless communication function of the mobile phone 100 may be implemented through an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a modem processor, a baseband processor, and the like.
[0201] Antenna 1 and antenna 2 are configured to transmit and receive electromagnetic wave signals.
[0202] The mobile communication module 150 may provide wireless communication solutions for application to the mobile phone 100, including 2G / 3G / 4G / 5G, etc. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like. The mobile communication module 150 may receive electromagnetic waves via the antenna 1, perform processing, such as filtering or amplifying, on the received electromagnetic waves, and send the electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 may further amplify signals modulated by the modem processor and convert the signals to electromagnetic waves for emission via the antenna 1. In some embodiments, at least some of the functional modules in the mobile communication module 150 may be disposed within the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 and at least some of the modules of the processor 110 may be disposed within the same component.
[0203] The wireless communication module 160 may provide wireless communication solutions for the mobile phone 100, including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR), etc.). The wireless communication module 160 may be one or more components integrating at least one communication processor module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may further receive signals to be transmitted from the processor 110, perform frequency modulation and amplification on the signals, and convert the signals into electromagnetic waves for emission via the antenna 2.
[0204] The mobile phone 100 implements display functions by using a GPU, a display 194, an application processor, and the like. The GPU is a microprocessor for image processing and is connected to the display 194 and the application processor. The GPU is configured to perform mathematical and geometric calculations and render images. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0205] The display 194 is configured to display images, videos, and the like. The display 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini-LED, a micro-LED, a micro-OLED, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the mobile phone 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0206] The camera 193 is configured to capture still or video images. An optical image of an object is generated through a lens and projected onto a photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) photoelectric transistor. The photosensitive element converts the optical signal into an electrical signal and sends the electrical signal to an ISP that converts the electrical signal into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into an image signal in a standard format, such as RGB or YUV. In some embodiments, the mobile phone 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0207] The external memory interface 120 can be used to connect to an external storage card, such as a microSD card, to expand the storage capabilities of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, files such as music and videos are stored on the external storage card.
[0208] The internal memory 121 may be configured to store computer executable program code. The executable program code includes instructions. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, applications required by at least one function (e.g., application functions corresponding to functions related to Synergy services 12), and the like. The data storage area may store data created in the course of using the mobile phone 100, for example, used to store files in a file format obtained after the migrated data is packaged. The internal memory 121 may also include a high-speed random access memory, and may further include a non-volatile memory, for example, at least one magnetic disk storage component, a flash storage component, or a universal flash storage (UFS). The processor 110 executes various functional applications of the mobile phone 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory located within the processor 110.
[0209] The mobile phone 100 may implement audio functions, such as music playback and recording, by using an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, and an application processor.
[0210] Audio module 170 is configured to convert digital audio information to analog audio signals for output, and to convert analog audio input to digital audio signals. Audio module 170 may also be configured to encode and decode audio signals.
[0211] Speaker 170A, also referred to as a "loudspeaker," is configured to convert audio electrical signals into sound signals.
[0212] Receiver 170B, also referred to as an "earphone," is configured to convert an audio electrical signal into a sound signal.
[0213] Microphone 170C, also referred to as a "mike" or "mic," is configured to convert a sound signal into an electrical signal.
[0214] Headset jack 170D is configured to connect to a wired headset.
[0215] For example, the mobile phone 100 may further include one or more of a button 190, a motor 191, an indicator 192, a SIM card interface 195 (or an eSIM card), and the like.
[0216] The EDL short circuit protection circuit is coupled to at least one pin of the processor 110, and the EDL short circuit protection circuit includes at least one connection terminal. When the EDL mode protection circuit is enabled, for example, when the circuit enables the at least one pin of the processor, the mobile phone 100 can enter the EDL mode.
[0217] In some embodiments, the mobile phone 100 may further include buttons (not shown), such as a volume up button, a volume down button, or a power button. A user may enable the mobile phone 100 to enter the EDL mode by performing a combination operation on the buttons of the mobile phone 100. For example, when the mobile phone 100 is in an off state, if it is detected that multiple buttons among the volume up button, the volume down button, and the power button are pressed simultaneously, the mobile phone 100 enters the EDL mode. In another example, when the mobile phone 100 is in an off state, if multiple buttons among the volume up button, the volume down button, and the power button are pressed simultaneously and a protection circuit for the EDL mode in the mobile phone 100 is in an enabled state, the mobile phone 100 enters the EDL mode.
[0218] It can be understood that the configuration of the mobile phone 100 shown in this embodiment of the application does not constitute a specific limitation on the mobile phone 100. In some other embodiments of the application, the mobile phone 100 can include more or fewer components than those shown in the figures, or some components can be combined, some components can be divided, or the components can be arranged differently. The components shown in the figures can be implemented by hardware, software, or a combination of software and hardware.
[0219] 17 is a diagram of another electronic device configuration according to some embodiments of this application. In some embodiments of this application, the electronic device may be a notebook computer 400. As shown in FIG. 17, the notebook computer 400 includes one or more processors 401, a system memory 402, a non-volatile memory (NVM) 403, a communication interface 404, an input / output (I / O) device 405, and a system control logic 406 configured to couple the processor 401, the system memory 402, the non-volatile memory 403, the communication interface 404, and the input / output (I / O) device 405.
[0220] The processor 401 may include one or more processing units, such as a central processing unit CPU (Central Processing Unit), a graphics processing unit GPU (Graphics Processing Unit), a digital signal processor DSP (Digital Signal Processor), a microprocessor MCU (Micro-programmed Control Unit), an AI (Artificial Intelligence) processor, or a programmable logic device FPGA (Field Programmable Gate Array) processing module or processing circuit, or may include one or more single-core or multi-core processors. The processor 401 may be configured to execute instructions for implementing the access control method provided in the embodiments of this application.
[0221] The system memory 402 is a volatile memory, such as a Random Access Memory (RAM) or a Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM). The system memory is configured to temporarily store data and / or instructions. For example, in some embodiments, the system memory 402 can be configured to store key identifiers, signature information, a device identifier for the mobile phone 100, and the like, or can be configured to store instructions for a pre-configured signature method that corresponds to a key identifier.
[0222] The non-volatile memory 403 may include one or more tangible, non-transitory computer-readable media configured to store data and / or instructions. In some embodiments, the non-volatile memory 403 may include any suitable non-volatile memory, such as, for example, a flash memory, and / or any suitable non-volatile storage device, such as, for example, a hard disk drive (HDD), a compact disc (CD), a digital versatile disc (DVD), or a solid-state drive (SSD). In some embodiments, the non-volatile memory 403 may instead be a removable storage medium, such as, for example, a secure digital (SD) storage card. In some other embodiments, the non-volatile memory 403 may be configured to store key identifiers, signature information, a device identifier of the mobile phone 100, and the like, or may be configured to store instructions of a pre-configured signature method corresponding to a key identifier.
[0223] In particular, the system memory 402 and the non-volatile memory 403 may respectively include a temporary copy and a permanent copy of instructions 407. The instructions 407 may include instructions that, when executed by the processor 401, enable the notebook computer 400 to implement an access control method provided in an embodiment of this application.
[0224] The communication interface 404 may include a transceiver configured to provide a wired or wireless communication interface for the notebook computer 400 to communicate with any other suitable device by using one or more networks. In some embodiments, the communication interface 404 may be integrated with another component of the notebook computer 400. For example, the communication interface 404 may be integrated with the processor 401. In some embodiments, the notebook computer 400 may communicate with another device via the communication interface 404. For example, the notebook computer 400 may obtain a device identifier and a key identifier of the mobile phone 100 from the mobile phone 100, or send signature information and instructions to the mobile phone 100 via the communication interface 404.
[0225] The input / output (I / O) device 405 may include input devices, such as a keyboard or a mouse, and output devices, such as a monitor. A user can use the input / output (I / O) device 405 to interact with the notebook computer 400, for example, to input instructions to a first application running on the notebook computer 400, to obtain the fuse bit file, device identifier file, and the like, of the mobile phone 100.
[0226] The system control logic 206 may include any suitable interface controllers for providing any suitable interface with other modules of the notebook computer 400. For example, in some embodiments, the system control logic 406 may include one or more memory controllers for providing interfaces coupled to the system memory 402 and the non-volatile memory 403.
[0227] In some embodiments, at least one of the processors 401 may be packaged with one or more controller logic used for the system control logic 406 to form a System-in-Package (SiP). In some other embodiments, at least one of the processors 401 may also be integrated on the same chip with one or more controller logic used for the system control logic 406 to form a System-on-a-Chip (SoC).
[0228] It can be understood that the configuration of the notebook computer 400 shown in this embodiment of the application does not constitute a specific limitation to the electronic device. In some other embodiments of the application, the notebook computer 400 can include more or fewer components than those shown in the figure, or some components can be combined, some components can be divided, or the components can be arranged differently. The components shown in the figure can be implemented by hardware, software, or a combination of software and hardware.
[0229] The embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of this application may be implemented as a computer program or program code executed on a programmable system. The programmable system includes at least one processor, a storage system (including volatile memory, non-volatile memory, and / or storage elements), at least one input device, and at least one output device.
[0230] Program code may be used to input instructions for performing the functions described herein and for generating output information. The output information may be made available to one or more output devices, in known fashion. For purposes of this application, a processing system includes any system having a processor, such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0231] The program code may be implemented in a high level or object oriented programming language to communicate with a processing system. The program code may also be implemented in assembly or machine language, if desired. The mechanisms described in this application are not limited in scope to any particular programming language. In any case, the language may be a compiled or interpreted language.
[0232] 18 is an architecture diagram of a mobile phone 100 according to some embodiments of the present application. As shown in FIG. 18, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, and the like.
[0233] A window manager is configured to manage window programs. A window manager may get the size of the display, determine if there is a status bar, lock the screen, take screenshots, etc.
[0234] Content providers are configured to store and retrieve data and enable the data to be accessed by applications. Data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, and the like.
[0235] The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can include one or more views. For example, a display interface that includes an SMS message notification icon can include a text display view and an image display view.
[0236] The telephone manager is configured to provide communication functions for the mobile phone 100, such as managing the state of a call (including answering, rejecting, or the like).
[0237] The resource manager provides various resources to the application, such as localized strings, icons, images, layout files, and video files.
[0238] The notification manager allows applications to display notification information in the status bar and may be configured to communicate notification messages. The notification manager may automatically disappear after a short silence without user interaction. For example, the notification manager may be configured to notify of download completion, provide message notifications, etc. The notification manager may instead be a notification that appears in the system's top status bar in the form of a graph or scrollbar text, e.g., a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text information may be displayed in the status bar, an alert sound may be played, the electronic device may vibrate, an indicator light may flash, etc.
[0239] Android includes a kernel library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0240] The kernel library includes two parts: the functions that need to be called in the Java language and the Android kernel library.
[0241] The application layer and the application framework layer run on a virtual machine. The virtual machine executes the java files in the application layer and the application framework layer as binary files. The virtual machine is configured to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0242] The kernel layer is a layer between the hardware and the software, and includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
[0243] The system library may include multiple functional modules, such as a surface manager (SM), a media library (ML), a 3D graphics processing library (eg, OpenGL ES), and a 2D graphics engine (eg, SGL).
[0244] The media library supports playback and recording of multiple commonly used audio and video formats, still image files, and the like. The media library may support multiple audio and video encoding formats, such as MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0245] The embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of this application may be implemented as a computer program or program code executed on a programmable system. The programmable system includes at least one processor, a storage system (including volatile memory, non-volatile memory, and / or storage elements), at least one input device, and at least one output device.
[0246] Program code may be used to input instructions for performing the functions described herein and / or generating output information. The output information may be made available to one or more output devices, in known fashion. For purposes of this application, a processing system includes any system having a processor, such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application-Specific Integrated Circuit (ASIC), or a microprocessor.
[0247] The program code may be implemented in a high level or object oriented programming language to communicate with a processing system. The program code may also be implemented in assembly or machine language, if desired. The mechanisms described in this application are not limited in scope to any particular programming language. In any case, the language may be a compiled or interpreted language.
[0248] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may alternatively be implemented as instructions that may be carried or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media and read and executed by one or more processors. For example, the instructions may be distributed using a network or other computer-readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer). Machine-readable media include, but are not limited to, floppy disks, compact disks, optical disks, compact disk read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or tangible machine-readable memories configured to transmit information (e.g., carrier waves, infrared signals, or digital signals) by using electrical, optical, acoustic, or other forms of propagated signals over the Internet. Thus, machine-readable media includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine- (e.g., computer) readable form.
[0249] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. In some embodiments, the features may be arranged in a different manner and / or order than as shown in the accompanying illustrative drawings. Additionally, the inclusion of structural or method features in a particular figure does not imply that such features are required in all embodiments. In some embodiments, the features may not be included or may be combined with other distinct features.
[0250] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, one logical unit / module may be one physical unit / module, may be a part of one physical unit / module, or may be implemented by using a combination of multiple physical units / modules. The physical implementation of those logical units / modules is not very important, and the combination of functions implemented by those logical units / modules is the key to solving the technical problem provided in this application. Also, in order to highlight the innovative part of this application, units / modules that are not closely related to solving the technical problem provided in this application are not introduced into the above-mentioned device embodiments of this application. This does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0251] It should be noted that in the examples and specification of this patent, relational terms such as first and second are used only to distinguish one entity or operation from another and do not necessarily require or imply any such actual relationship or order between those entities or operations. Also, the terms "comprise", "have", or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or device that includes a list of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or device. An element preceded by "comprise" or "contain" does not, without further constraints, preclude the presence of additional identical elements within the process, method, article, or device that includes that element.
[0252] Although this application has been illustrated and described with reference to certain example embodiments thereof, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the scope of this application.
Claims
1. Detecting a distance measurement command by the first electronic device; Detecting a first group of sonic signals transmitted by a second electronic device at a first time point by the first electronic device, and determining a first distance between the first electronic device and the second electronic device corresponding to the first time point based on the first group of sonic signals and first information corresponding to the first group of sonic signals, the first information including first transmission time information of transmitting the first group of sonic signals by the second electronic device; The first electronic device displays the first distance; Detecting, by the first electronic device, a second group of sonic signals transmitted by the second electronic device at a second time point after the first time point, and determining a second distance between the first electronic device and the second electronic device corresponding to the second time point based on the second group of sonic signals and second information corresponding to the second group of sonic signals, the second information having second transmission time information of the transmission of the second group of sonic signals by the second electronic device; The second distance is displayed by the first electronic device. A distance measuring method comprising:
2. The distance measuring method according to claim 1 , wherein the first electronic device receives the first information and the second information from the second electronic device.
3. 2. The distance measuring method of claim 1, wherein the first electronic device transmits the first transmission time information and the second transmission time information to the second electronic device, such that the second electronic device transmits the first group of sonic signals based on the first transmission time information, and the second electronic device transmits the second group of sonic signals based on the second transmission time information.
4. detecting, by the first electronic device, a third group of sound wave signals transmitted by the second electronic device at a fifth time point, the fifth time point being between the first time point and the second time point; determining, by the first electronic device, the first distance corresponding to the first time point between the first electronic device and the second electronic device based on the first group of sonic signals, the third group of sonic signals, the first information, and third information corresponding to the third group of sonic signals; determining, by the first electronic device, the second distance between the first electronic device and the second electronic device corresponding to the second time point based on the second group of sonic signals, the third group of sonic signals, the second information, and the third information; The distance measuring method according to any one of claims 1 to 3, further comprising:
5. sending a sound emission command to the second electronic device by the first electronic device, the sound emission command instructing the second electronic device to transmit a sound wave signal, the sound wave signal including the first group of sound wave signals and the second group of sound wave signals; The distance measuring method according to claim 1 , further comprising:
6. The distance measuring method according to claim 5 , wherein the frequency range of the sound wave signal is a preset frequency range.
7. establishing, by the first electronic device, a Bluetooth connection to the second electronic device, and initiating, by the first electronic device, detection of the acoustic signal transmitted by the second electronic device when a received signal strength of a Bluetooth signal transmitted by the second electronic device and received by the first electronic device is greater than a pre-set strength threshold; The distance measuring method according to claim 1 , further comprising:
8. performing, by the first electronic device, a Bluetooth time synchronization with the second electronic device at a third time point to determine a first time offset between the first electronic device and the second electronic device corresponding to the third time point; determining, by the first electronic device, a first distance after the third time point based on the first time offset, the first group of sonic signals, and the first information; and determining, by the first electronic device, a second distance after the third time point based on the first time offset, the second group of sonic signals, and the second information. The distance measuring method according to claim 7, further comprising:
9. performing a Bluetooth time synchronization with the second electronic device by the first electronic device at a fourth time point after a preset time from the third time point to determine a second time offset between the first electronic device and the second electronic device corresponding to the fourth time point; determining, by the first electronics, a first distance after the fourth time point based on the second time offset, the first group of sonic signals, and the first information; and determining, by the first electronics, a second distance after the fourth time point based on the second time offset, the second group of sonic signals, and the second information. The distance measuring method according to claim 8, further comprising:
10. detecting, by the first electronic device, the distance measurement command when detecting a distance measurement operation performed by a user on the first electronic device and the second electronic device, and / or a search operation performed by the user on the second electronic device; The distance measuring method according to any one of claims 1 to 9, further comprising:
11. The frequency range of the sound wave signal is from 20 Hz to 2*10 4 Hz, or The frequency range of the sound wave signal is 2*10 4 Hz to 1*10 12 Hz, or The frequency range of the sound wave signal is from 20 Hz to 1*10 12 Hz, The distance measuring method according to claim 1 .
12. A memory configured to store instructions; one or more processors, the instructions being arranged, when executed by the one or more processors, to cause the processors to carry out the distance measurement method according to any one of claims 1 to 11; An electronic device having the
13. A computer readable storage medium having stored thereon instructions which, when executed on an electronic device, enable the electronic device to carry out the distance measurement method according to any one of claims 1 to 11.
14. A computer program product comprising instructions, which when executed by one or more processors are used to implement a distance measurement method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Portable terminal device, response communications device, and display system and method of retrieved object
JP2006308493A
Diver-use information transmission device, and distance calculating method and distance monitoring method in diver-use information transmission device
JP2010014570A
Radio communication method and system, and radio communication device of the same
JP2011199381A
Opposing direction estimation method, searching-side terminal and searched-side terminal
JP2012042244A
Apparatus and methods for determining range and bearing using time-stamped messaging
US20050219950A1
Cited By
Distance measurement method, readable medium, and electronic device
US20240411003A1