CN116819434A - Distance measurement method and electronic equipment - Google Patents

Distance measurement method and electronic equipment Download PDF

Info

Publication number
CN116819434A
CN116819434A CN202210283225.7A CN202210283225A CN116819434A CN 116819434 A CN116819434 A CN 116819434A CN 202210283225 A CN202210283225 A CN 202210283225A CN 116819434 A CN116819434 A CN 116819434A
Authority
CN
China
Prior art keywords
distance
electronic device
ranging
mode
error
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210283225.7A
Other languages
Chinese (zh)
Inventor
汪杰
张英雄
郭翱
黄超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210283225.7A priority Critical patent/CN116819434A/en
Publication of CN116819434A publication Critical patent/CN116819434A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The application provides a ranging method and electronic equipment, and relates to the field of terminals. The ranging method provided by the application comprises the following steps: firstly, in the first ranging process after connection establishment, a ranging mode with low power consumption or short time consumption is selected; and then, based on the result of the first ranging, determining the ranging mode selected by the second ranging, thereby considering the precision and the power consumption. Furthermore, the ranging method provided by the application combines the service requirement, selects a proper ranging mode, and reduces the power consumption on the premise of meeting the service requirement.

Description

Distance measurement method and electronic equipment
Technical Field
The present application relates to the field of terminals, and in particular, to a ranging method and an electronic device.
Background
With the development of communication technology and the popularization of intelligent devices, the era of artificial intelligence internet of things (artificial intelligence & internet of things, AIoT) of everything interconnection is coming. The distributed interconnection capability of the operating system is benefited, and interconnection and intercommunication of electronic devices such as intelligent wearable devices, intelligent household devices and mobile terminals are preliminarily realized.
After the connection is established between the plurality of electronic devices, the distance between the electronic devices needs to be determined, so that better user experience is provided for the user. For example, when the mobile phone is paired with a plurality of bluetooth headsets, after the bluetooth function of the mobile phone is turned on, it is found that at least two bluetooth headsets can be paired, and the mobile phone can be preferentially paired with headsets that are closer to each other.
The electronic device may measure the distance to other electronic devices by various methods, such as Ultra-Wideband (UWB) ranging, bluetooth ranging, laser ranging, etc. However, the ranging system represented by bluetooth ranging has low accuracy and large error, while the ranging system represented by UWB ranging has high power consumption, and requires an extra ultra wideband signal generating device, which is costly.
However, many electronic devices, such as bluetooth headset, bluetooth mouse, VR glasses, smart home devices, etc., are often powered by a built-in battery, and when the power consumption of the electronic device for performing ranging once is high, the endurance of the electronic device may be rapidly reduced. In contrast, when the electronic devices determine the distance between the electronic devices by using a low-power-consumption distance measurement method such as bluetooth distance measurement, the distance between the electronic devices cannot be accurately calculated by the electronic devices due to the accuracy of bluetooth distance measurement.
Disclosure of Invention
The application provides a ranging method and electronic equipment, and relates to the field of terminals. The ranging method provided by the application comprises the following steps: firstly, in the first ranging process after connection establishment, a ranging mode with low power consumption or short time consumption is selected; and then, based on the result of the first ranging, determining the ranging mode selected by the second ranging, thereby considering the precision and the power consumption. Furthermore, the ranging method provided by the application combines the service requirement, selects a proper ranging mode, and reduces the power consumption on the premise of meeting the service requirement.
In a first aspect, the present application provides a ranging method, applied to a first electronic device, the method comprising: determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment; determining the distance measurement mode with the smallest error on the first distance as a second distance measurement mode; and determining a second distance through the second distance measuring mode, and determining the second distance as the distance between the first electronic equipment and the second electronic equipment, wherein the first distance measuring mode is different from the second distance measuring mode.
In the above embodiment, the first electronic device first determines a distance by using the ranging mode with the shortest time consumption or the lowest power consumption, and selects the ranging mode with the smallest error based on the distance, so as to determine the distance between the two electronic devices. According to the distance measuring method provided by the embodiment of the application, under the condition that the electronic equipment has two or more distance measuring modes, the precision and the power consumption can be effectively considered.
With reference to some embodiments of the first aspect, in some embodiments, the method further includes: after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection; the connection is established based on one or more of WiFi, bluetooth, NFC and ZigBee.
In the above embodiment, before the ranging mode is performed, the first electronic device may also establish a connection with the second electronic device, where the connection may be established in a plurality of modes, so that the first electronic device may designate the second electronic device with a determined distance, and the distance between the first electronic device and the second electronic device may be synchronized.
With reference to some embodiments of the first aspect, in some embodiments, after the first electronic device and the second electronic device establish a connection, before the determining the first distance by the first ranging method, the method further includes: and determining that the first and second electronic devices both support the first and second ranging modes based on the connection.
In the above embodiment, the first electronic device and/or the second electronic device may further confirm a ranging manner supported by the opposite terminal.
With reference to some embodiments of the first aspect, in some embodiments, a ranging manner supported by the first electronic device includes bluetooth ranging, ultrasonic ranging; the first ranging mode is the Bluetooth ranging mode; the determining that the ranging mode with the smallest error on the first distance is the second ranging mode specifically includes: and after judging that the first distance is larger than a first distance threshold, determining the second distance measuring mode as the ultrasonic distance measuring mode.
In the above embodiment, when the ranging modes supported by the first electronic device include bluetooth ranging and ultrasonic ranging, and the first ranging mode is bluetooth ranging, it may be determined that the second ranging mode is ultrasonic ranging by determining a magnitude relation between the first distance and the first distance threshold. The accuracy relation between Bluetooth ranging and ultrasonic ranging can be rapidly compared by judging the magnitude relation between the first distance and the first distance threshold.
With reference to some embodiments of the first aspect, in some embodiments, the first distance threshold is 35 centimeters.
In the above embodiment, when the distance determined by the first electronic device through bluetooth ranging is less than 35 cm, the distance between the two electronic devices is determined to be the result of bluetooth ranging; when the distance determined by the first electronic device is greater than 35 cm, the distance measurement is performed by ultrasonic distance measurement, and the result of the ultrasonic distance measurement is taken as the distance between the two electronic devices.
With reference to some embodiments of the first aspect, in some embodiments, the method further includes: in response to determining that the first electronic device and the second electronic device are both in a non-stationary state, periodically determining a third distance through a third ranging mode, wherein the third ranging mode is a ranging mode with lowest power consumption among ranging modes supported by the first electronic device; judging whether the error of the third ranging mode on the third distance is smaller than an error threshold value; if the error of the third ranging mode on the third distance is smaller than the error threshold, determining the third distance as the distance between the first electronic device and the second electronic device; and if the error of the third ranging mode on the third distance is greater than or equal to the error threshold, periodically determining a fourth distance as the distance between the first electronic device and the second electronic device through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, and the error of the fourth ranging mode on the fourth distance is smaller than the error threshold.
In the above embodiment, when the first electronic device and/or the second electronic device move, the distance between the two electronic devices is first determined by the ranging mode with the lowest power consumption, and when the error of the ranging mode with the lowest power consumption is lower than the error threshold, the distance between the two electronic devices is continuously determined by the ranging mode with the lowest power consumption; and when the error of the ranging mode with the lowest power consumption is larger than or equal to the error threshold value, determining the distance between the two electronic devices through the ranging mode smaller than the error threshold value.
With reference to some embodiments of the first aspect, in some embodiments, the third ranging mode is the bluetooth ranging, and the fourth ranging mode is the ultrasonic ranging; the determining whether the error of the third ranging mode at the third distance is smaller than the error threshold specifically includes: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the error threshold; if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the third distance is greater than or equal to the error threshold.
In the above embodiment, when the ranging mode with the lowest power consumption is bluetooth ranging, whether the ranging mode used next time is bluetooth ranging or ultrasonic ranging may be determined by determining whether the distance of bluetooth ranging is smaller than the second distance threshold. When the distance of the Bluetooth distance measurement is smaller than the second distance threshold, the distance measurement mode used next time is Bluetooth distance measurement; when the distance of the Bluetooth distance measurement is greater than or equal to the second distance threshold, the distance measurement mode used next time is ultrasonic distance measurement.
With reference to some embodiments of the first aspect, in some embodiments, the second distance threshold is 35 centimeters.
In the above embodiment, when the distance determined by the first electronic device through bluetooth ranging is less than 35 cm, the distance between the two electronic devices is determined to be the result of bluetooth ranging, and bluetooth ranging is selected next time; and when the distance determined by the first electronic device is greater than 35 cm, performing distance measurement through ultrasonic distance measurement.
In a second aspect, the present application provides a ranging method applied to a first electronic device, the method comprising: determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment; determining one or more first services based on the first distance, wherein the first distance is less than or equal to a first upper distance limit, which is the minimum value of the upper distance limits of the one or more first services; judging whether the error of the first ranging mode on the first distance is smaller than a first error threshold, wherein the first error threshold is the minimum value of error thresholds of one or more services; if the error of the first ranging mode on the first distance is smaller than the first error threshold, determining the first distance as the distance between the first electronic device and the second electronic device.
In the above embodiment, the first electronic device determines a distance by using a ranging mode with the shortest time consumption or the lowest power consumption, determines one or more services by using the distance, and further determines whether an error of the distance meets a service requirement. And if the error of the distance meets the service requirement, the first distance is considered to be the distance between the first electronic equipment and the second electronic equipment.
With reference to some embodiments of the second aspect, in some embodiments, after the first electronic device and the second electronic device establish a connection, determining, based on the connection, that the electronic device being range-measured is the second electronic device; the connection is established based on one or more of WiFi, bluetooth, NFC and ZigBee.
In the above embodiment, before the ranging mode is performed, the first electronic device may also establish a connection with the second electronic device, where the connection may be established in a plurality of modes, so that the first electronic device may designate the second electronic device with a determined distance, and the distance between the first electronic device and the second electronic device may be synchronized.
With reference to some embodiments of the second aspect, in some embodiments, after the first electronic device and the second electronic device establish a connection, before the determining the first distance by the first ranging method, the method further includes: and determining that the first and second electronic devices both support the first and second ranging modes based on the connection.
In the above embodiment, the first electronic device and/or the second electronic device may further confirm a ranging manner supported by the opposite terminal.
With reference to some embodiments of the second aspect, in some embodiments, the method further includes: if the error of the first ranging mode on the first distance is greater than or equal to the first error threshold, determining a second ranging mode based on the first distance and the first error threshold, wherein the error of the second ranging mode on the first distance is smaller than the first error threshold; and determining a second distance in the second distance measuring mode, and determining the second distance as the distance between the first electronic equipment and the second electronic equipment.
In the above embodiment, when the error of the first ranging mode is greater than the first error threshold, it is indicated that the error measured by the first ranging mode is greater than the error threshold of the service requirement, so that the second ranging mode is selected to perform ranging, further the second distance is determined, and the accuracy of the service requirement is met.
With reference to some embodiments of the second aspect, in some embodiments, the ranging mode supported by the first electronic device includes bluetooth ranging, ultrasonic ranging; the first ranging mode is the Bluetooth ranging mode, and the second ranging mode is the ultrasonic ranging mode; the determining whether the error of the first ranging mode is smaller than a first error threshold value on the first distance specifically includes: judging whether the first distance is smaller than the first distance threshold value; if the first distance is smaller than the first distance threshold, determining that the error of the first ranging mode on the first distance is smaller than the first error threshold; if the first distance is greater than or equal to the first distance threshold, determining that the error of the first ranging mode on the first distance is greater than or equal to the first error threshold; the first distance threshold is related to the first error threshold.
In the above embodiment, when the ranging modes supported by the first electronic device include bluetooth ranging and ultrasonic ranging, and the first ranging mode is bluetooth ranging, whether the accuracy of bluetooth ranging meets the service requirement may be determined by determining the magnitude relation between the first distance and the first distance threshold, and the second ranging mode is ultrasonic ranging under the condition that the service requirement is not met. The relationship among the error of Bluetooth ranging, the error of ultrasonic ranging and the error threshold of service can be rapidly compared by judging the magnitude relationship between the first distance and the first distance threshold.
With reference to some embodiments of the second aspect, in some embodiments, the method further includes: in response to determining that the first electronic device and/or the second electronic device are in a non-stationary state, determining a third ranging mode based on the last determined distance between the first electronic device and the second electronic device; and periodically determining a third distance through the third distance measurement mode.
In the above embodiment, after the first electronic device and/or the second electronic device move, the distance between the two electronic devices is first determined by the third ranging method based on the last determination of the appropriate ranging method.
With reference to some embodiments of the second aspect, in some embodiments, the determining a third ranging method based on the last determined distance specifically includes: if the distance between the first electronic device and the second electronic device determined last time is greater than the maximum value of the upper limits of the distances of all the services, the third distance measurement mode is the distance measurement mode with the lowest power consumption; if the last determined distance is not greater than the maximum value of the distance upper limit of the business, determining one or more second businesses; and determining the third ranging mode based on a second error threshold, wherein the second error threshold is the minimum value of the error thresholds of the one or more second services, and the last determined distance between the first electronic device and the second electronic device is smaller than a second distance upper limit, and the second distance is the minimum value of the distance upper limits of the one or more second services.
In the above embodiment, if the last determined distance is greater than the upper limit of the distance of all the services, determining the distance between two electronic devices in a ranging mode with the lowest power consumption; if the last determined distance is not greater than the distance of all the services, one or more services are determined, and then an appropriate ranging mode is determined based on the error threshold value of the one or more services, so that both accuracy and power consumption can be achieved.
With reference to some embodiments of the second aspect, in some embodiments, after the periodically determining the third distance by the third ranging method, the method further includes: determining one or more third services based on the third distance; judging whether the error of the third ranging mode on the third distance is smaller than a third error threshold, wherein the third error threshold is the minimum value of the error thresholds of the one or more third services; if the error of the third ranging mode on the third distance is smaller than the third error threshold, determining the third distance as the distance between the first electronic device and the second electronic device; and if the error of the third ranging mode on the third distance is greater than or equal to the third error threshold, determining a fourth distance periodically through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, the error of the fourth ranging mode on the third distance is less than the error threshold, and the fourth distance is the distance between the first electronic equipment and the second electronic equipment.
In the above embodiment, under the condition that the first electronic device and/or the second electronic device move, after the ranging is performed by the ranging method, it is determined whether the error of the ranging method is smaller than the error threshold of the current service, so as to determine the next ranging method, and therefore, the power consumption of the electronic device can be reduced under the condition that the accuracy of the service requirement is met.
With reference to some embodiments of the second aspect, in some embodiments, the third ranging mode is the bluetooth ranging and the fourth ranging mode is the ultrasonic ranging; the determining whether the error of the third ranging mode at the third distance is smaller than a third error threshold specifically includes: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the second error threshold; if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the first distance is greater than or equal to the second error threshold; the second distance threshold is related to the third error threshold.
In the above embodiment, it may be determined whether the error of bluetooth ranging is smaller than the error threshold of the service by determining the magnitude relation between the bluetooth ranging result and the second distance threshold, thereby determining the ranging mode used next time. The method can not only rapidly switch the ranging mode, but also can give consideration to the precision and the power consumption.
With reference to some embodiments of the second aspect, in some embodiments, the one or more first services include one or more of a pairing task, a network surfing capability sharing service, a call sharing service, and a sms sharing service; the one or more second services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services; the method further comprises the steps of: and in the case that the one or more first services include a network surfing capability sharing service, after determining that the distance between the first electronic device and the second electronic device is smaller than the upper distance limit of the network surfing capability sharing service, the first electronic device and the second electronic device share the network surfing capability, and the network surfing capability is derived from the first electronic device or the second electronic device.
In the above embodiment, after the distance between the two electronic devices is smaller than the upper limit of the distance of the service, the operation corresponding to the service may be performed.
With reference to some embodiments of the second aspect, in some embodiments, the one or more first services include one or more of a pairing task, a network surfing capability sharing service, a call sharing service, and a sms sharing service; the method further comprises the steps of: and under the condition that the one or more first services comprise a call sharing service and a short message sharing service, after determining that the distance between the first electronic device and the second electronic device is smaller than the upper distance limit of the call sharing service and the short message sharing service, displaying a first control and a second control by the first electronic device, wherein the first control corresponds to the call function of the second electronic device, and the second control corresponds to the short message function of the second electronic device.
In the above embodiment, after the distance between the two electronic devices is smaller than the upper limit of the distance of the service, the operation corresponding to the service may be performed.
In a third aspect, the present application provides a ranging method applied to a system including a first electronic device and a second electronic device, the method comprising: after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection; the first electronic device determines a first distance based on a first ranging mode, and the second electronic device determines a second distance based on the first ranging mode; the first electronic device and the second electronic device exchanging the first distance and the second distance; the first electronic device and the second electronic device determine a third distance that is a smaller value of the first distance and the second distance as a distance between the first electronic device and the second electronic device.
In the above-described embodiment, after the first electronic device and the second electronic device determine the distances, respectively, the value at which the distance is smallest is always selected as the distance between the two electronic devices. Firstly, by doing so, the service can be started or corresponding operation can be executed as much as possible; secondly, this may be done so that the measured distance is as close as possible to the real distance between the two electronic devices.
With reference to some embodiments of the third aspect, in some embodiments, the first ranging mode is bluetooth ranging, ultrasonic ranging, or ultra wideband signal ranging; the connection is established based on one or more of WiFi, bluetooth, near field communication, zigbee, hiLink, apple wireless direct connection.
In the above-described embodiment, the ranging method may be any ranging method, and the connection may be established in various ways.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors and memory; the memory is coupled to the one or more processors, the memory for storing computer program code, the computer program code comprising computer instructions that the one or more processors call to cause the electronic device to perform: after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection; determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment; determining the distance measurement mode with the smallest error on the first distance as a second distance measurement mode; and determining a second distance through the second distance measuring mode, and determining the second distance as the distance between the first electronic equipment and the second electronic equipment, wherein the first distance measuring mode is different from the second distance measuring mode.
In the above embodiment, the first electronic device first determines a distance by using the ranging mode with the shortest time consumption or the lowest power consumption, and selects the ranging mode with the smallest error based on the distance, so as to determine the distance between the two electronic devices. According to the distance measuring method provided by the embodiment of the application, under the condition that the electronic equipment has two or more distance measuring modes, the accuracy and the error can be effectively considered.
With reference to some embodiments of the fourth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection; the connection is established based on one or more of WiFi, bluetooth, NFC and ZigBee.
With reference to some embodiments of the fourth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: and determining that the first and second electronic devices both support the first and second ranging modes based on the connection.
With reference to some embodiments of the fourth aspect, in some embodiments, a ranging mode supported by the first electronic device includes bluetooth ranging, ultrasonic ranging; the first ranging mode is the Bluetooth ranging mode; the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: and after judging that the first distance is larger than a first distance threshold, determining the second distance measuring mode as the ultrasonic distance measuring mode.
With reference to some embodiments of the fourth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: in response to determining that the first electronic device and the second electronic device are both in a non-stationary state, periodically determining a third distance through a third ranging mode, wherein the third ranging mode is a ranging mode with lowest power consumption among ranging modes supported by the first electronic device; judging whether the error of the third ranging mode on the third distance is smaller than an error threshold value; if the error of the third ranging mode on the third distance is smaller than the error threshold, determining the third distance as the distance between the first electronic device and the second electronic device; and if the error of the third ranging mode on the third distance is greater than or equal to the error threshold, periodically determining a fourth distance as the distance between the first electronic device and the second electronic device through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, and the error of the fourth ranging mode on the fourth distance is smaller than the error threshold.
With reference to some embodiments of the fourth aspect, in some embodiments, the third ranging mode is the bluetooth ranging and the fourth ranging mode is the ultrasonic ranging; the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the error threshold; if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the third distance is greater than or equal to the error threshold.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: one or more processors and memory; the memory is coupled to the one or more processors, the memory for storing computer program code, the computer program code comprising computer instructions that the one or more processors call to cause the electronic device to perform: determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment; determining one or more first services based on the first distance, wherein the first distance is less than or equal to a first upper distance limit, which is the minimum value of the upper distance limits of the one or more first services; judging whether the error of the first ranging mode on the first distance is smaller than a first error threshold, wherein the first error threshold is the minimum value of error thresholds of one or more services; if the error of the first ranging mode on the first distance is smaller than the first error threshold, determining the first distance as the distance between the first electronic device and the second electronic device.
In the above embodiment, the first electronic device determines a distance by using a ranging mode with the shortest time consumption or the lowest power consumption, determines one or more services by using the distance, and further determines whether an error of the distance meets a service requirement. And if the error of the distance meets the service requirement, the first distance is considered to be the distance between the first electronic equipment and the second electronic equipment.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection; the connection is established based on one or more of WiFi, bluetooth, NFC and ZigBee.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: if the error of the first ranging mode on the first distance is greater than or equal to the first error threshold, determining a second ranging mode based on the first distance and the first error threshold, wherein the error of the second ranging mode on the first distance is smaller than the first error threshold; and determining a second distance in the second distance measuring mode, and determining the second distance as the distance between the first electronic equipment and the second electronic equipment.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: judging whether the first distance is smaller than the first distance threshold value; if the first distance is smaller than the first distance threshold, determining that the error of the first ranging mode on the first distance is smaller than the first error threshold; if the first distance is greater than or equal to the first distance threshold, determining that the error of the first ranging mode on the first distance is greater than or equal to the first error threshold; the first distance threshold is related to the first error threshold.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: in response to determining that the first electronic device and/or the second electronic device are in a non-stationary state, determining a third ranging mode based on the last determined distance between the first electronic device and the second electronic device; and periodically determining a third distance through the third distance measurement mode.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: if the distance between the first electronic device and the second electronic device determined last time is greater than the maximum value of the upper limits of the distances of all the services, the third distance measurement mode is the distance measurement mode with the lowest power consumption; if the last determined distance is not greater than the maximum value of the distance upper limit of the business, determining one or more second businesses; and determining the third ranging mode based on a second error threshold, wherein the second error threshold is the minimum value of the error thresholds of the one or more second services, and the last determined distance between the first electronic device and the second electronic device is smaller than a second distance upper limit, and the second distance is the minimum value of the distance upper limits of the one or more second services.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: determining one or more third services based on the third distance; judging whether the error of the third ranging mode on the third distance is smaller than a third error threshold, wherein the third error threshold is the minimum value of the error thresholds of the one or more third services; if the error of the third ranging mode on the third distance is smaller than the third error threshold, determining the third distance as the distance between the first electronic device and the second electronic device; and if the error of the third ranging mode on the third distance is greater than or equal to the third error threshold, determining a fourth distance periodically through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, the error of the fourth ranging mode on the third distance is less than the error threshold, and the fourth distance is the distance between the first electronic equipment and the second electronic equipment.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the second error threshold; if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the first distance is greater than or equal to the second error threshold; the second distance threshold is related to the third error threshold.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: the one or more first services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services; the one or more second services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services; and in the case that the one or more first services include a network surfing capability sharing service, after determining that the distance between the first electronic device and the second electronic device is smaller than the upper distance limit of the network surfing capability sharing service, the first electronic device and the second electronic device share the network surfing capability, and the network surfing capability is derived from the first electronic device or the second electronic device.
With reference to some embodiments of the fifth aspect, in some embodiments, the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: the one or more first services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services; and under the condition that the one or more first services comprise a call sharing service and a short message sharing service, after determining that the distance between the first electronic device and the second electronic device is smaller than the upper distance limit of the call sharing service and the short message sharing service, displaying a first control and a second control by the first electronic device, wherein the first control corresponds to the call function of the second electronic device, and the second control corresponds to the short message function of the second electronic device.
In a sixth aspect, embodiments of the present application provide a chip system for application to an electronic device, the chip system comprising one or more processors configured to invoke computer instructions to cause the electronic device to perform a method as described in the first aspect and any possible implementation of the first aspect, or a method as described in the second aspect and any possible implementation of the second aspect.
In a seventh aspect, an application embodiment provides a computer program product comprising instructions which, when run on an electronic device, cause the electronic device to perform a method as described in any one of the possible implementations of the first aspect and the first aspect, or a method as described in any one of the possible implementations of the second aspect and the second aspect.
In an eighth aspect, an embodiment of the application provides a computer readable storage medium, including instructions that, when executed on an electronic device, cause the electronic device to perform a method as described in any one of the possible implementations of the first aspect and the first aspect, or a method as described in any one of the possible implementations of the second aspect and the second aspect.
It will be appreciated that the electronic device provided in the fourth aspect, the electronic device provided in the fifth aspect, the chip system provided in the sixth aspect, the computer program product provided in the seventh aspect and the computer storage medium provided in the eighth aspect are all configured to perform the method provided by the embodiment of the present application. Therefore, the advantages achieved by the method can be referred to as the advantages of the corresponding method, and will not be described herein.
Drawings
Fig. 1A, fig. 1B, and fig. 1C are schematic diagrams illustrating an exemplary ranging scenario according to an embodiment of the present application.
Fig. 2 is another exemplary schematic diagram of a ranging scenario provided by an embodiment of the present application.
Fig. 3 is another exemplary schematic diagram of a ranging scenario provided by an embodiment of the present application.
Fig. 4 is another exemplary schematic diagram of a ranging scenario provided by an embodiment of the present application.
Fig. 5 is an exemplary schematic diagram of a method flow of a ranging method according to an embodiment of the present application.
Fig. 6A and fig. 6B are schematic diagrams illustrating bluetooth ranging according to an embodiment of the present application.
Fig. 6C is an exemplary diagram of a relationship between received signal strength indication and distance according to an embodiment of the present application.
Fig. 7 is an exemplary schematic diagram of ultrasonic ranging according to an embodiment of the present application.
Fig. 8A and fig. 8B are schematic diagrams of an electronic device according to an embodiment of the present application for performing a ranging method according to an embodiment of the present application.
Fig. 9 is an exemplary schematic diagram of an electronic device performing a ranging method according to an embodiment of the present application when two electronic devices provided in the embodiment of the present application are not both stationary.
Fig. 10A is another exemplary schematic diagram of a method flow of a ranging method according to an embodiment of the present application.
Fig. 10B is an exemplary schematic diagram of a method for determining a third ranging mode based on a distance determined by a previous ranging according to an embodiment of the present application.
Fig. 11A is an exemplary schematic diagram of an electronic device performing a ranging method in a network access capability sharing scenario according to an embodiment of the present application.
Fig. 11B is an exemplary schematic diagram of an electronic device performing a ranging method according to an embodiment of the present application.
Fig. 12 is an exemplary schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present application.
Fig. 13A is an exemplary schematic diagram of a software architecture of an electronic device according to an embodiment of the present application.
Fig. 13B is another exemplary schematic diagram of a software architecture of an electronic device according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this disclosure refers to and encompasses any or all possible combinations of one or more of the listed items.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The term "User Interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, which enables conversion between an internal form of information and a form acceptable to the user. A commonly used presentation form of the user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It may be a visual interface element of text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc., displayed in a display of the electronic device.
First, a use scenario of the ranging method provided by the embodiment of the present application is described.
With the development of communication technology and the popularization of intelligent devices, a plurality of electronic devices can be interconnected and intercommunicated. When a user performs some cross-device operation on a certain electronic device, the user is required to designate the operated device. In this case, when the number of other devices connected to the device is large, the user needs to search the list for the device to be operated, and the user experience is poor.
For example, a mobile phone is paired with a plurality of bluetooth headsets, and when the user turns on the mobile phone, the user is required to manually select the bluetooth headset to be paired.
Further, for some cross-device operations, limited by the specificity of the service, the distance between devices needs to be smaller than a certain threshold to enable the service to run normally. The service specificity can include two aspects, on one hand, the service has certain privacy, the distance between two devices is required to be smaller than a threshold value, and the risk of privacy and identity disclosure caused by misoperation is reduced; on the other hand, the communication capacity/communication protocol which comprises the service dependence is greatly influenced by the distance, and when the distance between two electronic devices is far, the quality of the communication which is the service dependence cannot be ensured, so that bad experience to a user is avoided.
For example, for a service with shared internet access capability, in order to ensure a data transmission rate and a delay of the service, signals in a higher frequency band (such as a WIFI 5G frequency band) are often selected to perform data transmission. However, attenuation of a transmission signal through a channel of a high-frequency band is greater along with attenuation of a distance, and in this case, it is required that a distance between electronic devices is smaller than a certain upper distance limit, so that services represented by a network access capability sharing service can be ensured to stably run, and user experience is ensured.
The following describes a scenario of a ranging method according to an embodiment of the present application in an exemplary manner, with reference to fig. 1A, 1B, 1C, and 2.
Fig. 1A, fig. 1B, and fig. 1C are schematic diagrams illustrating an exemplary ranging scenario according to an embodiment of the present application.
In a home or office, after the electronic device establishes a connection with a plurality of other electronic devices, the devices can be operated simultaneously by a multi-screen collaboration mode, a screen throwing mode and the like. As shown in fig. 1A, there are connections between the electronic apparatus 3 and other plural electronic apparatuses. Wherein the plurality of electronic devices includes an electronic device 1 and an electronic device 2.
When the number of other electronic devices connected with the electronic device is large, a user is required to manually search for the device requiring multi-screen collaboration and screen projection. For example, if the user wants to display the interface of the electronic device 2 on the electronic device 3 through the multi-screen collaboration function, the user needs to find the electronic device 2 in the device list in the electronic device 3, as shown in fig. 1B.
As shown in fig. 1B, the electronic device 3 can display only a limited number of connected devices on one page of the device list, limited by the screen size of the electronic device 3. And because the user does not know which page of the device list the electronic device 2 is on, the user needs to turn pages to find the control 101 corresponding to the electronic device 2, and then clicks the control 101 to start multi-screen collaboration.
In the content shown in fig. 1B, the control 101 corresponding to the electronic device 2 is on the second page of the device list.
Obviously, the operation is very tedious, and the user experience is poor. In order to simplify the operation of the user and improve the experience of the user, the electronic equipment 2 and/or the electronic equipment 3 can determine the distance between the electronic equipment through the distance measuring method provided by the embodiment of the application, and correspondingly adjust the positions of the controls corresponding to the electronic equipment according to the distance between the electronic equipment, thereby simplifying the operation of the user and improving the experience of the user.
After the electronic device 3 executes the ranging method provided by the embodiment of the present application, the electronic device 3 may determine that the electronic device 2 is closest to the electronic device 3, and then the electronic device 1 is next closest. Therefore, the controls corresponding to the electronic device 2 and the electronic device 1 can be placed on the first page of the device list, so that the user can conveniently select the controls.
As shown in fig. 1C, the control 101 corresponding to the electronic device 2 is on the first page of the device list. Similarly, the control corresponding to the electronic device 1 is also on the first page of the device list.
Fig. 2 is another exemplary schematic diagram of a ranging scenario provided by an embodiment of the present application.
As shown in fig. 2, the electronic device 1 was paired with the bluetooth headset 1 and the bluetooth headset 2. When the electronic device starts the Bluetooth function, the Bluetooth headset 1 with the closer distance is preferentially selected to initiate the connection request, and the Bluetooth headset 2 with the farther distance is not preferentially selected to initiate the connection request, so that the Bluetooth headset 1 and the electronic device 1 are preferentially paired.
Similarly, when more than two Bluetooth headsets are in a standby state or a starting state, the electronic device can be preferentially matched with the Bluetooth headsets with a relatively close distance, and further the user experience is improved by reducing the user operation.
Further, for some special services, such as internet access capability sharing service, short message sharing service, call sharing service, etc., it is necessary to ensure that the distance between multiple electronic devices is smaller than a certain upper distance limit. For the special services above, the privacy and security of the user are considered, and the communication capability/communication protocol depending on the service is considered to be greatly affected by the distance, and because the functions of flow, short message content, call recording, dialing and the like often relate to the personal and property safety of the user, the electronic equipment needs to ensure that the distance between a plurality of electronic equipment is smaller than a certain distance upper limit in the process of running the special services.
For example, a connection is established between the mobile phone and a tablet that is not connected to the network, the mobile phone is connected to the network through a data traffic service authorized by the SIM card, and the tablet is not connected to the network. In the case where the distance between the handset and the tablet is less than a certain threshold, a prompt may be displayed on the tablet or the handset for asking the user if to share the data traffic of the handset to the tablet so that the tablet is connected to the network through the data traffic of the handset.
For example, a connection is established between the tablet personal computer and the mobile phone without the SIM card, and under the condition that the distance between the mobile phone and the tablet personal computer is smaller than a certain threshold value, the mobile phone or the tablet personal computer can create a call sharing service and a short message sharing service, so that a user can directly use the tablet personal computer to dial a call and send and receive a short message, the operation of the user is convenient, and the experience of the user is improved.
The following describes a scenario of a ranging method according to an embodiment of the present application in an exemplary manner, with reference to fig. 3 and 4.
Fig. 3 is another exemplary schematic diagram of a ranging scenario provided by an embodiment of the present application.
After the handset and the tablet without networking establish a connection, the handset or tablet may determine the distance R of the peer device, as shown in fig. 3. The mobile phone or the tablet can determine whether to create the internet surfing capability sharing service according to the change of the distance between the opposite terminal devices.
For example, in the case where the distance R is greater than the distance upper limit, it is determined that the internet surfing capability sharing service is not created because the distance between the mobile phone and the tablet is long; in the case where the distance R is less than the upper distance limit, it is determined to create the internet surfing capability sharing service due to the closer distance between the handset and the tablet, or the user is queried through the notification 301 in fig. 3 whether to create the internet surfing capability sharing service.
The notification 301 may include the word "current network unavailable, sharable cell phone network online.
It should be noted that, in the case that the distance R is greater than the upper distance limit, the internet surfing capability sharing service may also exist, but the related operation is not executed; in the case that the distance R is smaller than the upper distance limit, the mobile phone and/or the tablet may perform related operations of the internet sharing service.
Fig. 4 is another exemplary schematic diagram of a ranging scenario provided by an embodiment of the present application.
After the handset and the tablet without the SIM card are connected, the handset or tablet may determine the distance R of the opposite device, as shown in fig. 4. The mobile phone or the tablet can determine whether to create a call sharing service and a short message sharing service and whether to execute operations corresponding to the call sharing service and the short message sharing service according to the change of the distance between the opposite terminal devices.
For example, in the case that the distance R is greater than the upper limit of the distance, since the distance between the mobile phone and the tablet is far, it is determined that the call sharing service and the short message sharing service are not created; and under the condition that the distance R is smaller than the upper limit of the distance, establishing call sharing service and short message sharing service due to the fact that the distance between the mobile phone and the tablet is relatively short.
Similar to fig. 3, in the case where the distance R is greater than the distance upper limit, a call sharing service, a short message sharing service may also exist, except that the related operation is not performed; and under the condition that the distance R is smaller than the upper limit of the distance, the mobile phone and/or the tablet can execute related operations of the call sharing service and the short message sharing service.
Before the call sharing service and the short message sharing service are created, the interface displayed on the tablet comprises a control 401, a control 402, a control 403 and a control 404. Where control 401 corresponds to a music application, control 402 corresponds to a control of a clock application, control 403 corresponds to a control of a theme application, and control 404 corresponds to more options.
After the call sharing service and the short message sharing service are created, the interface displayed on the tablet comprises a control 405, a control 406, a control 401 and a control 404. Where control 405 corresponds to a conversation application and control 406 corresponds to an information application.
The user can click on the control 405, start a call application program, and perform operations such as making a call; similarly, the user may click on the control 406 to start the short message application program, perform operations such as sending a short message, and the like.
In connection with what is set forth above, it is apparent that in many different scenarios, the implementation of many functions, services on an electronic device depends on the outcome of the electronic device performing ranging.
One possible ranging method may be: meanwhile, the distance measurement is carried out through a Bluetooth distance measurement method and an ultra-wideband distance measurement method, and the distance measurement results of the two methods are subjected to weighted average, so that a distance is obtained.
However, this ranging method has two non-negligible drawbacks.
First, this coupled ranging approach does not reduce the range error.
Let the error of bluetooth ranging be p bluetooth (r),p bluetooth (r) increases with increasing distance r; the error of UWB ranging is p UWB ,P UWB The correlation with the distance r is low.
If the Bluetooth ranging method and the ultra-wideband ranging method are coupled, the following formula (1) is adopted:
r=r bluetooth *k bluetooth +r UWB *k UWB #(1)
wherein r is the result measured by the ranging method, r bluetooth Distance, k, measured for bluetooth ranging bluetooth Weights for bluetooth ranging; r is (r) UWB Distance, k, measured for UWB ranging UWB Weights for UWB ranging.
It is evident that in case the error of bluetooth ranging is higher than the error of UWB ranging, r UWB Closer to the real distance between two electronic devices, the result r of Bluetooth ranging after being processed as shown in formula (1) bluetooth R can be contaminated such that r is further from the true distance between the devices. In case the error of the bluetooth ranging is higher than the error of the UWB ranging, the result r of the bluetooth ranging bluetooth R can be contaminated such that r is further from the true distance between the devices.
For example, the distance between two electronic devices is 1.5m, the result r of UWB ranging UWB 1.6m, and the bluetooth ranging result is 1.7m. At k bluetooth =k UWB In the case of=0.5, the result r=1.65m calculated according to the formula (1). It is evident that the UWB ranging result is closer to two electronic devicesTrue distance between the devices.
Secondly, this coupled ranging approach can dramatically increase the power consumption of the electronic device.
Obviously, the coupled ranging mode requires the electronic device to perform bluetooth ranging and UWB ranging simultaneously, which can dramatically increase the power consumption of the electronic device to perform one ranging.
Besides, UWB ranging requires a corresponding dedicated ultrasonic signal generating device on the electronic device, which is costly.
In connection with the above description, it will be appreciated that, first, the ranging method of coupling UWB ranging and bluetooth ranging cannot be balanced in terms of power consumption and accuracy. Secondly, the UWB ranging and Bluetooth ranging coupling ranging method does not consider the service requirement, and increases the power consumption of the electronic equipment. For example, in the case where the error of bluetooth ranging is greater than that of UWB ranging, the bluetooth ranging result may also satisfy the requirement of distance insensitive service, in which case, the electronic device increases power consumption by using UWB ranging, and the increase of ranging accuracy does not bring corresponding benefit to service.
Secondly, the distance measuring method and the electronic device provided by the embodiment of the application are introduced.
Since in many scenarios the function, service implementation of an electronic device requires accurate ranging results, the scenarios shown in fig. 1A, 1B, 1C, 2, 3, 4 above; further, since the electronic device may be a device with limited battery capacity such as a bluetooth headset, a smart watch, and a smart bracelet, it is necessary to reduce power consumption of the electronic device for performing ranging.
In view of the foregoing, the embodiment of the application provides a ranging method and electronic equipment. The distance measuring method provided by the embodiment of the application can reduce the power consumption of the electronic equipment for executing the distance measurement under the condition of ensuring the distance measurement precision.
The ranging method provided by the embodiment of the application comprises the following steps: and under the condition that the electronic equipment carries out distance measurement on other equipment for the first time, selecting a distance measurement mode with the shortest time consumption or the lowest power consumption to carry out distance measurement. In the case that the electronic device does not measure the distance for the first time to other devices, the distance is determined according to the last measurement, and an appropriate distance measurement mode is selected to perform distance measurement based on the distance.
It can be appreciated that in the case where the electronic device measures the distance for the first time to other devices, the electronic device may select the distance measurement mode with the shortest time consumption, because the distance measurement result may affect whether some services are created, the display sequence of the controls on the interface, and so on, and the distance measurement needs to be completed as soon as possible. Or, the distance measurement result may also affect the selection of the subsequent distance measurement mode, so the electronic device may select the distance measurement mode with the smallest error.
The ranging method provided by the embodiment of the application further comprises the following steps: under the condition that the distance between the opposite terminal equipment is required to be continuously determined, when two electronic equipment are stationary, only one ranging is executed; in the case where either one of the two electronic devices moves, ranging is periodically performed.
It will be appreciated that in the case where at least one of the two electronic devices is moving, the distance between the two electronic devices may vary, requiring the electronic devices to periodically perform ranging.
The ranging method provided by the embodiment of the application further comprises the following steps: when the electronic device performs ranging once to obtain a plurality of distances, a distance with the smallest distance may be preferentially selected as a result of the ranging.
It will be appreciated that ranging methods including bluetooth ranging, UWB ranging, ultrasonic ranging do not follow a random or normal distribution with true distance as a mean, due to errors, noise effects. Instead, the distance measured by the ranging method is always greater than the true distance.
The ranging method provided by the embodiment of the application further comprises the following steps: after two or more electronic devices including electronic device 1 and electronic device 2 have established a connection, when electronic device 1 measures the distance between electronic device 1 and electronic device 2, electronic device 2 may be triggered to measure the distance between electronic device 2 and electronic device 1, and electronic device 1 and electronic device 2 may select the smaller of the two ranging results.
The ranging method provided by the embodiment of the present application is exemplarily described below with reference to the content shown in fig. 5.
Fig. 5 is an exemplary schematic diagram of a method flow of a ranging method according to an embodiment of the present application.
As shown in fig. 5, the ranging method provided by the embodiment of the application includes steps S501 to S511. Step S501 includes a triggering opportunity of the ranging method; step S502, step S503, step S504, and step S505 are specific steps of the ranging method in the case where the first electronic device and the second electronic device are both in a stationary state; step S506, step S507, step S508, step S509, step S510, and step S511 are specific steps of the ranging method in the case where the first electronic device and the second electronic device are not both in the stationary state.
These steps are described separately below.
S501: after the first electronic equipment and the second electronic equipment are connected, a first distance measurement mode is selected to perform distance measurement, and the first distance is determined.
The first electronic device establishes a connection with the second electronic device. The connection may be established by WIFI, bluetooth, near Field Communication (NFC), zigBee, apple wireless direct connection (Apple Wireless Direct Link, AWDL), hiLink, and the like, which are not limited herein.
After the first electronic device establishes a connection with the second electronic device, the first electronic device may transmit first data through the connection, the first data including a device ID for ranging. The device ID may be used to verify whether the electronic device that receives the ranging signal sent by the first electronic device is the electronic device that is being measured, i.e. the second electronic device may determine, according to the device ID, that it is the distance measured by the first electronic device. Wherein the ranging signal may be transmitted by the first electronic device in the form of a broadcast rather than in the form of a point-to-point communication.
The device ID may be preset inside the first electronic device and the second electronic device, or may be determined by negotiation after the first electronic device and the second electronic device establish connection.
Optionally, in some embodiments of the present application, after the first electronic device establishes a connection with the second electronic device, the first electronic device or the second electronic device determines that the first condition is met, and selects the first ranging mode to perform ranging. Wherein the first condition may be different from scene to scene. Alternatively, in some embodiments of the present application, in the scenarios shown in fig. 1A, fig. 2, fig. 3, and fig. 4, the first condition may be null, that is, after the electronic device and the second electronic device establish a connection, the ranging may be performed in the first ranging mode. Alternatively, in some embodiments of the present application, in the scenario illustrated in fig. 3, the first condition may be that one of the electronic device and the second electronic device is not networked; alternatively, in the scenario illustrated in fig. 4, the first condition may be that one of the electronic device and the second electronic device has no call capability. Then, the electronic device and/or the second electronic device select a first ranging mode to perform ranging, and the ranging result is the first distance.
Alternatively, in some embodiments of the present application, the ranging method may be selected randomly as the first ranging method.
Alternatively, in some embodiments of the present application, the least time-consuming ranging mode may be selected. It can be understood that the ranging mode with the shortest time consumption is selected, so that the first distance can be quickly obtained, and then the distances of a plurality of opposite terminal devices can be quickly determined, or whether to create services such as internet surfing capability sharing service, short message sharing service, call sharing service and the like can be quickly determined.
Alternatively, in some embodiments of the present application, the ranging mode with the lowest power consumption may be selected. It can be appreciated that selecting the ranging mode with the lowest power consumption can reduce the power consumption of the electronic device. And considering that the ranging mode with the lowest power consumption is often not the ranging mode with the smallest error, in the subsequent step, the ranging may be performed by selecting an appropriate ranging mode based on the first distance. Optionally, in some embodiments of the present application, the electronic device may store a ranging mode table locally or at the cloud, where the ranging mode table includes parameters such as error, power consumption, and time consumption of each ranging mode, as shown in table 1 below.
Table 1 is an exemplary schematic illustration of a ranging mode table provided in an embodiment of the present application.
Error of Power consumption Time consuming
Bluetooth ranging p bluetooth (r) pw bluetooth T bluetooth
Ultrasonic ranging p ultrasonic (r) pw ultrasonic T ultrasonic
UWB ranging p UWB (r) pw UWB T UWB
As shown in table 1 above, the error of bluetooth ranging is p bluetooth (r) Power consumption of Bluetooth ranging is pw bluetooth Time consuming for bluetooth ranging is T bluetooth The method comprises the steps of carrying out a first treatment on the surface of the The error of ultrasonic ranging is P ultrasonic (r) ultrasonic rangingIs pw ultrasonic Time consuming of ultrasonic ranging is T ultrasonic The method comprises the steps of carrying out a first treatment on the surface of the The error of UWB ranging is p UWB (r), UWB ranging power consumption of pw UWB Time consuming UWB ranging T UWB . Where r is the true distance between the object being measured and the electronic device. The error of ultrasonic ranging and the error of UWB ranging can be irrelevant to r.
It should be noted that, because the electronic device may not be able to obtain the real distance between the second electronic device and the first electronic device, the distance determined by the ranging manner may be directly used as the real distance, so as to determine the error of the first distance measured by different ranging manners. For convenience of explanation, hereinafter, an error of a distance determined by an electronic device performing any one ranging method is referred to as an error of the ranging method.
It should be noted that the errors of different ranging methods are also related to other parameters, and table 1 is merely an exemplary illustration of distances.
Therefore, the electronic device may determine the ranging mode with the shortest time consumption or the ranging mode with the lowest power consumption through table 1.
It should be noted that table 1 is only an exemplary schematic table of a ranging mode table, and the ranging mode table may further include more or fewer items, for example, may further include errors, power consumption and time consumption of ranging modes under different hardware modules. For example, the Bluetooth chip 1 takes a seconds, and the Bluetooth chip 2 takes b seconds. It will be appreciated that the same ranging mode for different hardware modules may also vary in time consumption, error, power consumption.
Optionally, in some embodiments of the present application, the distance measurement mode that can be performed by the electronic device is often fixed, and the hardware module on the electronic device is also fixed. A developer can configure different configuration files on different types of electronic devices, and the configuration files are marked with a ranging mode with the lowest power consumption and a ranging mode with the shortest time consumption. The electronic device can directly determine the ranging mode with the lowest power consumption or directly determine the ranging mode with the shortest time consumption by reading the configuration file.
S502: and judging whether the first electronic device and the second electronic device are both static.
The first electronic device determines whether both the first electronic device and the second electronic device are stationary. If the first electronic device and the second electronic device are both stationary, step S503 is executed; if the first electronic device and the second electronic device are not both stationary, step S506 is performed.
The first electronic device may send a message to the second electronic device over the connection, the message including whether the first electronic device itself is stationary or mobile. Similarly, the second electronic device may send the message to the electronic device over the connection. Further, the electronic device may know whether the first electronic device itself and the second electronic device are both stationary.
Wherein the first electronic device may determine whether itself is stationary based on the acceleration sensor, and similarly the second electronic device may determine whether itself is stationary based on the acceleration sensor.
S503: and judging whether the first ranging mode is the ranging mode with the minimum ranging error on the first distance.
The first electronic device and/or the second electronic device determines whether the first ranging mode is a ranging mode with the smallest ranging error on the first distance, and if the first ranging mode is a ranging mode with the smallest ranging error on the first distance, step S504 is executed; if the first ranging mode is not the ranging mode with the minimum ranging error on the first distance, step S505 is executed.
In step S501, the electronic device may select the first ranging mode in a plurality of manners.
S504: the result of determining the ranging is a first distance.
The first electronic device and/or the second electronic device determines a first distance as a result of the first distance measurement mode distance measurement, wherein the first electronic device and/or the second electronic device uses the first distance as a distance between the electronic device and the second electronic device.
Optionally, the electronic device may further send a message to the second electronic device through the connection, where the message includes the first distance and is used to notify the second electronic device of the distance between the two.
S505: and selecting a second ranging mode to perform ranging, and determining the second distance, wherein the second ranging mode is the ranging mode with the smallest ranging error on the first distance.
Since the first ranging mode is not the ranging mode with the smallest ranging error on the first distance, the first electronic device and/or the second electronic device may select the second ranging mode to perform ranging. The first electronic device and/or the second electronic device may determine that the ranging mode with the smallest ranging error on the first distance is the second ranging mode by the method shown in table 1, and then the first electronic device and/or the second electronic device perform ranging to determine the second distance.
For example, the distance between the electronic device 1 and the electronic device 2 is 2.75m, the first ranging mode is bluetooth ranging, the second ranging mode is ultrasonic ranging, the error of bluetooth ranging is smaller than that of ultrasonic ranging within 0.5m, and the error of bluetooth ranging is larger than that of ultrasonic ranging outside 0.5 m. Limited to the error of bluetooth ranging, the electronic device determines a first distance of 3m in step S501. Then, the electronic device may determine that the error of the bluetooth ranging is greater than the error of the ultrasonic ranging on the first distance 3m, and the electronic device selects the second ranging mode to be the ultrasonic ranging. The electronic device performs ultrasonic ranging, determining a distance of 2.85m.
It can be understood that, in combination with step S504 and step S505, the electronic device measures the first distance by using the ranging mode with the lowest power consumption, and then measures the second distance by using the ranging mode with the smallest error on the first distance, which combines both power consumption and accuracy.
S506: and performing ranging in a third ranging mode, determining the third distance, wherein the third ranging mode is the ranging mode with the lowest power consumption.
And when at least any one of the first electronic equipment and/or the second electronic equipment is moved, the distance between the electronic equipment possibly changes, and the first electronic equipment and/or the second electronic equipment periodically perform distance measurement in a third distance measurement mode to determine a third distance. The third ranging mode is the ranging mode with the lowest power consumption, and the electronic device may determine that the ranging mode with the lowest power consumption is the third ranging mode through the mode shown in table 1.
It can be appreciated that, because the distance between the electronic devices changes, the ranging mode with the lowest power consumption can be selected to perform ranging, and thus the power consumption of the electronic devices can be reduced.
S507: and judging whether the error of the third ranging mode on the third distance is smaller than an error threshold value.
Judging whether the error of the third ranging mode on the third distance is smaller than an error threshold value, if so, executing step S508; if not, step S509 is performed.
Wherein the error threshold may be a fixed value representing the maximum error that the electronic device may accept.
Wherein the error threshold may be a variable. For example, the error threshold may be related to the traffic triggering the electronic device to perform ranging, and the error threshold may be different for different traffic as shown in table 2 below.
Alternatively, in some embodiments of the present application, the error threshold may become infinite when the third distance is greater than a certain threshold. For example, the third distance is greater than the upper distance limit for all traffic. For another example, the third distance is greater than some fixed threshold preset on the electronic device.
Table 2 is an exemplary schematic representation of the error threshold versus traffic provided by an embodiment of the present application.
Service triggering ranging Error threshold Upper limit of distance
Pairing services Threshold 1 Upper limit of distance 1
Internet surfing capability sharing service Threshold 2 Upper distance limit 2
Call sharing service Threshold 3 Upper distance limit 3
Short message sharing service Threshold 4 Upper distance limit 4
As shown in table 2, different traffic corresponds to different error thresholds. Pairing service corresponds to a threshold 1, internet surfing capability sharing service corresponds to a threshold 2, call sharing service corresponds to a threshold 3, and short message sharing service corresponds to a threshold 4. Similarly, different services correspond to different upper distance limits, pairing tasks correspond to an upper distance limit 1, internet surfing capability sharing services correspond to an upper distance limit 2, conversation sharing services correspond to an upper distance limit 3, and short message sharing services correspond to an upper distance limit 4.
Optionally, in some embodiments of the present application, the upper distance limit represents a maximum value of distances between two electronic devices running the service, and when the distance between the two electronic devices is greater than the upper distance limit required by the service, the service is logged off; when the distance between the two electronic devices is smaller than the upper limit of the distance required by the service, the service starts to run or certain operations of the service are executed.
Alternatively, in some embodiments of the present application, the service is not logged off when the distance between the two electronic devices is greater than the upper distance limit of the service.
The threshold 1 corresponding to the pairing task is generally larger, that is, the pairing task may allow a certain error in the ranging result. This is because, for the pairing service, it is more likely that the plurality of second electronic devices are relatively far from the first electronic device. And the distance measurement is performed on the different second electronic devices in a short time, and the error of the distance of the different second electronic devices, which is determined by the first electronic device through any distance measurement mode, hardly influences the distance sorting of the distances between the different second electronic devices and the first electronic device.
For example, after bluetooth is turned on, the electronic device 1 performs ranging for the surrounding bluetooth headset. The bluetooth headset that the electronic device periphery can find once paired includes bluetooth headset 1 and bluetooth headset 2. The electronic device may establish a connection with the bluetooth headset 1 and the bluetooth headset 2, respectively, or may establish a connection with the bluetooth headset 1 and the bluetooth headset 2 simultaneously. After the connection is established, the pairing task triggers ranging for bluetooth headset 1 and bluetooth headset 2. The electronic equipment determines that the distance between the Bluetooth headset 1 and the Bluetooth headset 2 is 1.4m and 1.5m respectively, the real distance between the Bluetooth headset 1 and the Bluetooth headset 2 and the electronic equipment is 1.43m and 1.47m, and the error caused by ranging is positive and negative 0.03m respectively. Even if the distance measurement error is enlarged to 0.04m, the distances between the Bluetooth headset 1 and the Bluetooth headset 2 determined by the electronic device are 1.44m and 1.46m respectively, and the distance between the Bluetooth headset 1 and the electronic device determined by the electronic device is still not influenced to be smaller than the distance between the Bluetooth headset 2 and the electronic device.
It will be appreciated that in the examples above, even where the error is most extreme, in part, the error does not affect the relative near-far relationship of the two second electronic devices and the first electronic device. For example, when the distance between the two second electronic devices is greater than 2 times the error of the ranging result, the first electronic device does not erroneously determine the relative near-far relationship between the two second electronic devices and the first electronic device.
The threshold 2 corresponding to the internet surfing capability sharing service is generally smaller, that is, the result of the distance measurement required by the internet surfing capability sharing service has smaller error. The first reason is that the internet surfing capability sharing service is directly related to property safety of the user as a private service, and the second electronic device needs to be ensured to be within a certain distance, so that the electronic device sharing the internet surfing capability to the second electronic device needs to obtain an accurate ranging result. Secondly, the communication protocol/communication capability on which the internet surfing capability sharing service depends is sensitive to distance changes, different communication protocols may need to be adopted for different distances, and the power of a transmitter may need to be adjusted according to different distances so as to ensure the quality of the internet surfing capability sharing service.
For example, the upper limit of the distance between the internet surfing capability and the service is 5m, and when the distance between the second electronic device and the electronic device is smaller than 5m, the creation of the internet surfing capability and the service is triggered, as shown in fig. 3 above. After the internet surfing capability sharing service is created and validated, if the distance between the second electronic equipment and the electronic equipment is greater than 5m, the internet surfing capability sharing service can be logged off; if the distance between the second electronic device and the electronic device is smaller than 5m, the distance between the two electronic devices can be used for adjusting the communication protocol and the power of the transmitter, on which the internet surfing capability is dependent, of the sharing service.
The call sharing service and the sms sharing service are similar to the internet surfing capability sharing service in terms of distance requirements, and are different in terms of the difference in the amount of data transmitted by text information or voice information compared with the data traffic transmission, so that the distance measurement error threshold is different.
S508: and determining the ranging result as a third distance.
Because the error of the third ranging mode is smaller than the error threshold, the requirement of the service can be met, and the third distance can be used as a ranging result.
S509: and determining a ranging mode smaller than the error threshold value as a fourth ranging mode based on the last obtained distance and the error threshold value, executing the fourth ranging mode, and determining a fourth distance.
And determining a ranging mode smaller than the error threshold value based on the last obtained distance and the error threshold value, executing the ranging mode and determining a fourth distance. Wherein the fourth ranging scheme may be the same as the third ranging scheme.
Before determining the fourth distance, the last obtained distance may be substituted into the formula shown in table 1 above, thereby obtaining the error of different ranging modes. By comparing the magnitude relation between the errors of different ranging modes and the error threshold value, the ranging mode smaller than the error threshold value can be determined.
When there are a plurality of ranging methods with an error smaller than the error threshold, one ranging method may be selected at random, or a ranging method with low power consumption may be selected, which is not limited herein.
It should be noted that, unlike the above steps S503 and S507, the error of the ranging scheme determined in step S509 cannot represent the error of the fourth distance, and the error of the ranging scheme at a certain distance in steps S503 and S507 represents the error of the distance obtained by the ranging scheme.
It should be noted that, if the distance is determined through step S503, step S504 or step S505 when the first electronic device and/or the second electronic device are in the stationary state, in some embodiments of the present application, after determining that the first electronic device and the second electronic device are not both stationary, step S506, step S507 and step S508 may be skipped, and step S509 may be directly executed.
S510: and judging whether the error of the fourth ranging mode on the fourth distance is smaller than an error threshold value.
The first electronic device and/or the second electronic device determines whether the error of the ranging mode at the fourth distance is less than an error threshold. If the error of the ranging mode is greater than or equal to the error threshold on the fourth distance, step S509 is executed; if the error of the ranging method is smaller than the error threshold value at the fourth distance, step S511 is performed.
S511: and determining the distance measurement result as a fourth distance.
The first electronic device and/or the second electronic device determines that the result of the ranging is a fourth distance.
It should be noted that, the distance measurement result is the distance between the two electronic devices determined by the first electronic device and/or the second electronic device, and the distance greater than the error threshold value determined in the distance measurement process may not be the distance between the two electronic devices.
It should be noted that, after the electronic device and the second electronic device stop moving in the process of executing steps S506, S507, S508, S509, S510, and S511, similarly to step S503, it is determined whether the ranging mode of last performing ranging is the ranging mode with the smallest error on the distance obtained by last ranging, if so, the result of last ranging is taken as a final result; if not, selecting the ranging mode with the smallest error on the distance obtained by the last ranging to execute the ranging mode, and taking the ranging result as the final result, and further adjusting the connection-dependent protocol or adjusting the power of the transmitter.
It should be noted that, in the process of executing step S506, step S507, step S508, step S509, step S510, and step S511, the electronic device performs ranging in a periodic manner. More specifically, after the first electronic device and/or the second electronic device change from rest to motion, the ranging is performed by the ranging mode with the lowest power consumption at first, and when the ranging is smaller than the error threshold, the ranging mode with the lowest power consumption is performed next, which is equivalent to periodically performing the ranging by using the third ranging mode.
When the first electronic device and the second electronic device each perform the ranging method as shown in fig. 4, the ranging results obtained respectively are distance 1 and distance 2. After the first electronic device and the second electronic device exchange the distance 1 and the distance 2 through the connection, a smaller value of the distance 1 and the distance 2 can be selected as a ranging result.
Alternatively, in some embodiments of the present application, after the first electronic device and the second electronic device exchange the distance 1 and the distance 2 through the connection, an average value of the distance 1 and the distance 2 may be selected as a ranging result.
It should be noted that the first electronic device and the second electronic device may exchange distances each determined by the same ranging method, and then determine a distance based on the two distances as a ranging result, where a method of determining a distance based on the two distances as a ranging result may be a method of selecting a smaller value of the two distances as a ranging result, or selecting an average value of the distance 1 and the distance 2 as a ranging result, which is not limited herein.
In the following, examples of ranging modes that can be executed by the electronic device include bluetooth ranging and ultrasonic ranging, and an exemplary procedure for executing the ranging method provided by the embodiment of the present application by the electronic device is described. The following first exemplarily describes bluetooth ranging and ultrasonic ranging.
Fig. 6A and fig. 6B are schematic diagrams illustrating bluetooth ranging according to an embodiment of the present application.
As shown in fig. 6A, bluetooth ranging may include step S6A01, step S6A02, step S6A03, step S6A04.
S6A01: a connection is established and a device ID is negotiated.
After the electronic device 1 and the electronic device 2 establish a connection, device IDs for ranging of the electronic device 1 and the electronic device 2 may be negotiated and determined. The connection may be established by WIFI, bluetooth, near Field Communication (NFC), zigbee, and the like, which is not limited herein.
S6a02: a ranging signal carrying the device ID of the electronic device 2 is transmitted.
The electronic device 2 transmits a ranging signal carrying the device ID of the electronic device 2.
S6a03: distance 1 is determined based on a received signal strength indication (RSSI, received signal strength indication) of the ranging signal.
The electronic device 1 determines the distance 1 based on the RSSI, where the RSSI is related to the distance of signal transmission, and reference may be made to the content shown in fig. 6C below, which is not described herein.
S6a04: a message carrying the device ID of the electronic device 1, distance 1 is sent.
The electronic device 2 sends a message carrying the device ID of the electronic device 2, distance 2. The electronic device 1 can determine the distance 1 from the message.
As shown in fig. 6B, bluetooth ranging may include step S6B01, step S6B02, step S6B03, step S6B04, step S6B05, step S6B06.
S6B01: a connection is established and a device ID is negotiated.
S6B02: a ranging signal 1 carrying the device ID of the electronic device 2 is transmitted.
The electronic device 1 transmits a ranging signal 1 carrying the device ID of the electronic device 2.
S6B03: distance 1 is determined based on the received signal strength indication of ranging signal 1.
The electronic device 2 receives the ranging signal 1 and determines the distance 1 based on the RSSI.
S6B04: a ranging signal 2 carrying the device ID of the electronic device 1 is transmitted.
The electronic device 2 transmits a ranging signal 2 carrying the device ID of the electronic device 1.
S6B05: distance 2 is determined based on the received signal strength indication of ranging signal 2.
The electronic device 1 receives the ranging signal 2 and determines the distance 2 based on the RSSI.
S6B06: the smaller of the distances 1 and 2 is determined to be the distance between the two electronic devices.
The electronic device 1 and the electronic device 2 exchange the distance 1 and the distance 2 by connecting, and then the smaller value of the distance 1 and the distance 2 can be determined as the distance between the two electronic devices.
It should be noted that the content shown in fig. 6A and fig. 6B is only an exemplary illustration of bluetooth ranging, and is not limited to a specific implementation of bluetooth ranging, and any ranging implementation based on bluetooth protocol belongs to bluetooth ranging in the embodiments of the present application. For example, the first electronic device may send a ranging request to the second electronic device based on the connection, and the second electronic device may send ranging signal 1 after receiving the ranging request. The first electronic device determines distance 1 as the distance between the two electronic devices based on the RSSI of ranging signal 1.
Fig. 6C is an exemplary diagram of a relationship between received signal strength indication and distance according to an embodiment of the present application.
As shown in fig. 6C, in the case where the distance between two electronic devices is smaller than the distance 1, the RSSI and the distance are substantially linear, and the change in the RSSI with the distance is smooth. When the value of RSSI is greater than the received signal strength indication value 1, i.e., the distance between two electronic devices is greater than the distance 1, the rate of change of RSSI is too large, and slight jitter of RSSI may cause a large change in distance and a large error.
Alternatively, in some embodiments of the present application, when the distance obtained by bluetooth ranging is greater than distance 1, the error of bluetooth ranging is considered to be too large, which is greater than the error threshold of all service requirements. For example, the distance 1 is 35cm.
Fig. 7 is an exemplary schematic diagram of ultrasonic ranging according to an embodiment of the present application.
As shown in fig. 7, the ultrasonic ranging may include step S701, step S702, step S703, step S704.
S701: a connection is established and a device ID is negotiated.
The connection may be established by WIFI, bluetooth, near Field Communication (NFC), zigbee, and the like, which is not limited herein.
It is worth noting that bluetooth ranging may use the same device ID as ultrasonic ranging.
S702: an ultrasonic signal 1 carrying the device ID of the electronic device 2 is transmitted.
The electronic device 1 transmits an ultrasonic signal 1 carrying the device ID of the electronic device 2.
S703: an ultrasonic signal 2 carrying the device ID of the electronic device 1 and processing delay is transmitted.
The electronic device 2 transmits an ultrasonic signal 2 carrying the device ID of the electronic device 2 with processing delay. The processing time delay is the time delay from the time when the electronic device 2 receives the ultrasonic signal 1 to the time when the ultrasonic signal 2 is sent.
S704: distance 1 is determined based on the time interval and the processing delay.
The electronic device 1 determines the distance 1 based on the time interval and the processing delay. The time interval is a time delay from the electronic device 1 to the sending of the ultrasonic signal 1 until the receiving of the ultrasonic signal 2. The electronic device 1 may calculate the transmission delay of the ultrasonic signal based on the time interval and the processing delay, and then determine the distance 1 based on the speed of the ultrasonic signal in space and the transmission delay, where the distance 1 is the distance between two electronic devices.
It should be noted that the content shown in fig. 7 is only an exemplary illustration of the ultrasonic ranging, and does not limit the specific implementation of the ultrasonic ranging, and any ranging mode in the ultrasonic frequency band belongs to the ultrasonic ranging in the embodiment of the present application.
After ultrasonic ranging and bluetooth ranging are introduced, the following describes a specific process of the electronic device executing the ranging method provided by the embodiment of the application under different scenes.
Fig. 8A and fig. 8B are schematic diagrams of an electronic device according to an embodiment of the present application for performing a ranging method according to an embodiment of the present application.
As shown in fig. 8A, the method for performing ranging provided by the embodiment of the present application by using the electronic device provided by the embodiment of the present application may include the following steps:
s801: a connection is established and a device ID is negotiated.
S802: and selecting a Bluetooth ranging mode to perform ranging, and determining a distance 1.
The distance measuring modes supported by the electronic equipment comprise Bluetooth distance measuring and ultrasonic distance measuring. The power consumption of Bluetooth ranging is lower than that of ultrasonic ranging, and the time consumption of Bluetooth ranging is lower than that of ultrasonic ranging. When the distance of the Bluetooth ranging is smaller than the distance threshold value 1, the error of the Bluetooth ranging is smaller than or equal to the ultrasonic ranging; when the distance of the Bluetooth ranging is greater than or equal to the distance threshold value 1, the error of the Bluetooth ranging is greater than the ultrasonic ranging.
Or when the distance determined by the Bluetooth ranging is smaller than the distance threshold value 1, the error of the Bluetooth ranging is smaller than the error threshold value required by the electronic equipment; under the condition that the distance of the Bluetooth ranging is greater than or equal to a distance threshold value 1, the error of the Bluetooth ranging is greater than an error threshold value required by the electronic equipment; and the error of the ultrasonic ranging is always smaller than the error threshold required by the electronic device.
Since the distance between the electronic device 1 and the electronic device 2 is not yet determined after the connection between the electronic device 1 and the electronic device 2 is established, the ranging mode with the lowest power consumption and the shortest time consumption can be selected to perform the ranging, that is, the bluetooth ranging is selected to perform the ranging. The result of the electronic device performing bluetooth ranging is a distance 1.
The bluetooth ranging may refer to the text descriptions corresponding to fig. 6A, fig. 6B, and fig. 6C, which are not repeated here.
S803: it is determined that distance 1 is greater than distance threshold 1.
S804: and selecting an ultrasonic ranging mode to perform ranging, and determining a distance 2.
Since distance 1 is greater than distance threshold 1, the error of bluetooth ranging is greater than ultrasonic ranging. That is, since the distance measurement method with the highest accuracy at the distance 1 is not bluetooth distance measurement but ultrasonic distance measurement, the distance 2 is determined by selecting ultrasonic distance measurement to perform distance measurement based on the above steps S503 and S505. Wherein the distance 2 is the distance between the electronic device 1 and the electronic device 2.
As shown in fig. 8B, the method for performing ranging provided by the embodiment of the present application by using the electronic device provided by the embodiment of the present application may include the following steps:
the descriptions of S801 and S802 are shown in the corresponding text descriptions of fig. 8A, and are not repeated here.
S805: it is determined that the distance 1 is smaller than the distance threshold 1, the distance 1 being the distance between the electronic device 1 and the electronic device 2.
When the distance of the bluetooth ranging is less than the threshold value 1, the error of the bluetooth ranging is less than or equal to the ultrasonic ranging, so based on step S503 and step S504 above, it is determined that the distance 1 is the distance between the electronic device 1 and the electronic device 2.
It should be noted that the ranging process shown in fig. 8A and 8B may be referred to as the first ranging after the connection is established. After the primary ranging is completed, if the electronic device and the second electronic device are not both stationary, the electronic device executes step S506, step S507, step S508, and step S509 in fig. 5, and when the ranging modes supported by the electronic device are bluetooth ranging and ultrasonic ranging, the electronic device executes the ranging modes according to the embodiment of the present application as shown in fig. 9.
Fig. 9 is an exemplary schematic diagram of an electronic device performing a ranging method according to an embodiment of the present application when two electronic devices provided in the embodiment of the present application are not both stationary.
S901: and after the first electronic equipment and the second electronic equipment are connected, performing first distance measurement to determine a distance 1.
The method for performing the first ranging after the connection between the first electronic device and the second electronic device may refer to the text descriptions corresponding to fig. 8A and 8B, which are not repeated herein.
The distance measuring modes supported by the first electronic equipment and the second electronic equipment comprise Bluetooth distance measuring and ultrasonic distance measuring.
S902: in response to the first electronic device and/or the second electronic device moving, it is determined whether the distance 1 is less than a distance threshold 1.
In response to the first electronic device and/or the second electronic device moving, it is determined whether the distance 1 is less than a distance threshold 1. If yes, go to step S903; if not, step S905 is performed.
When the distance of the Bluetooth ranging is smaller than the distance threshold value 1, the error of the Bluetooth ranging is smaller than or equal to the ultrasonic ranging; when the distance of the Bluetooth ranging is greater than the distance threshold value 1, the error of the Bluetooth ranging is greater than the ultrasonic ranging.
S903: bluetooth ranging is periodically performed.
Since the distance 1 determined by the first electronic device when performing the first ranging is smaller than the distance threshold 1 and the error of the bluetooth ranging is smaller than or equal to the ultrasonic ranging, the bluetooth ranging can be periodically performed.
Or when the distance determined by the Bluetooth ranging is smaller than the distance threshold value 1, the error of the Bluetooth ranging is smaller than the error threshold value required by the electronic equipment; under the condition that the distance of the Bluetooth ranging is greater than or equal to a distance threshold value 1, the error of the Bluetooth ranging is greater than an error threshold value required by the electronic equipment; and the error of the ultrasonic ranging is always smaller than the error threshold required by the electronic device.
S904: and judging whether the distance obtained by Bluetooth ranging is greater than or equal to a distance threshold value 1.
The first electronic device judges whether the distance obtained by Bluetooth ranging is greater than or equal to a distance threshold value 1. If yes, go to step S905; if not, go to step S903.
S905: ultrasonic ranging is periodically performed.
Since the distance obtained by bluetooth ranging or the first ranging is equal to or greater than the distance threshold 1, the error of bluetooth ranging is greater than the error of ultrasonic ranging, and ultrasonic ranging is selectively performed according to the above steps S507, S509. And, since the distance between the first electronic device and/or the second electronic device is varied in the moving process of the first electronic device and/or the second electronic device, the first electronic device periodically performs the ultrasonic ranging.
S906: and judging whether the distance obtained by ultrasonic ranging is greater than or equal to a distance threshold value 1.
After the distance is obtained through ultrasonic ranging each time, whether the distance obtained through ultrasonic ranging is greater than or equal to a distance threshold value 1 is judged. If yes, go to step S905; if not, step S903 is performed.
In consideration of different requirements of different services on distance and error threshold values, the ranging method provided by the embodiment of the application can also adjust the combination of different ranging modes according to different services, thereby simultaneously realizing power consumption reduction and error reduction.
Fig. 10A is another exemplary schematic diagram of a method flow of a ranging method according to an embodiment of the present application.
As shown in fig. 10A, S10A1: and after the first electronic equipment and the second electronic equipment are connected, selecting a first ranging mode to perform ranging, determining a first distance, and determining one or more services based on the first distance.
After the first electronic device establishes a connection with the second electronic device, a first ranging mode is selected to perform ranging, and the first distance is determined, which may be described in the text of step S501.
The first electronic device and/or the second electronic device may compare the first distance to a distance upper limit for each service, which is a service that will be created later when the first distance is less than the distance upper limit for a service. Wherein the number of services may be one or more. The upper limit of the distance of the service may be referred to the corresponding text description of table 2, which is not repeated here.
Optionally, in some embodiments of the present application, after each time the first electronic device and/or the second electronic device determine the distance, in a case where an error of a ranging manner of determining the distance is smaller than an error threshold of the service and the distance determined by the ranging manner is smaller than an upper distance limit of the service, the first electronic device and/or the second electronic device correspondingly creates the service and executes an operation corresponding to the service.
Optionally, in some embodiments of the present application, after each time the first electronic device and/or the second electronic device determine the distance, if the distance determined by the ranging manner is greater than the upper distance limit of the service, the first electronic device and/or the second electronic device may log off the service correspondingly.
S10A2: and judging whether the error of the first ranging mode is smaller than an error threshold value.
The first electronic device and/or the second electronic device may determine an error of the first ranging mode and then determine whether the error of the first ranging mode is less than an error threshold. When the number of the services is multiple, the error threshold is the minimum value of the error thresholds of the multiple services; when the number of services is one, the error threshold is the error threshold of the service.
It should be noted that, when the number of services is zero, the error threshold is infinity, and the error of any ranging mode is smaller than the error threshold.
When the error of the first ranging mode is less than the error threshold, executing step S10A3; when it is determined that the error of the first ranging method is equal to or greater than the error threshold, step S10A4 is performed.
S10A3: and executing the operation corresponding to the one or more services.
The first electronic device and/or the second electronic device may run the one or more services and perform operations corresponding to the one or more services.
In the scenario shown in fig. 1A, the service is a multi-screen collaboration service, and the operation corresponding to the service is: the electronic device 3 will adjust the position of the control 101 in the device list, etc. In the scenario shown in fig. 2, the service is a pairing task, and the electronic device 2 initiates a connection request with the bluetooth headset 1. In the scenario shown in fig. 3, the service is a network access capability sharing service, the electronic device 1 and/or the electronic device 2 may create or cancel the network access capability sharing service, adjust the power of the transmitter according to the first distance, and so on. In the scenario shown in fig. 4, the service is a communication sharing service and/or a sms sharing service, and the electronic device 1 and/or the electronic device 2 may create or cancel the communication sharing service and/or the sms sharing service, and display or not display the control 405 and the control 406, etc.
S10A4: and selecting a second ranging mode smaller than the error threshold to perform ranging, determining a second distance, and performing operations corresponding to the one or more services.
Since the error of the first ranging mode is greater than or equal to the error threshold, the distance obtained by the first ranging mode may cause the traffic to fail to operate normally, the second ranging mode smaller than the error threshold is selected to perform ranging, the second distance is determined, and the operation corresponding to the one or more traffic is performed.
The operation corresponding to the one or more services may refer to the corresponding text description in step S10A3, which is not described herein.
Optionally, in some embodiments of the present application, after determining the second distance, the one or more services may be redetermined based on the second distance, and then step S10A4 is repeatedly performed until the determined one or more services on the first electronic device and/or the second electronic device are unchanged.
S10A5: and in response to the movement of the first electronic device and/or the second electronic device, periodically performing ranging in a third ranging manner based on the distance obtained by the last ranging to obtain a third distance.
In response to movement of the first electronic device and/or the second electronic device, the first electronic device and/or the second electronic device periodically perform ranging in a third ranging manner based on the distance obtained by the last ranging to obtain a third distance.
If the last ranging is not available, the third ranging mode is the ranging mode with the lowest power consumption; if the distance obtained by the last distance measurement is larger than the maximum value in the upper distance limits of all the services, the third distance measurement mode is the distance measurement mode with the lowest power consumption.
After determining the third distance, one or more services need to be redetermined, and then a ranging mode with an error smaller than an error threshold of the one or more services is selected, which is equivalent to repeatedly executing step S10A5 until the first electronic device and/or the second electronic device are stationary. The method for redefining one or more services may refer to step S10A1 above, and will not be described herein. In the moving process of the first electronic device and/or the second electronic device, since the distance between the electronic devices may change due to the movement of the first electronic device and/or the second electronic device, the ranging needs to be periodically performed in the third ranging mode and one or more services need to be continuously redetermined.
The method for determining the third ranging method based on the distance determined by the previous ranging may refer to the content shown in fig. 10B.
Fig. 10B is an exemplary schematic diagram of a method for determining a third ranging mode based on a distance determined by a previous ranging according to an embodiment of the present application.
As shown in fig. 10B, the method for determining the third ranging method based on the distance determined by the previous ranging includes steps S10B1, S10B2, S10B3, and S10B4.
S10B1: one or more services are determined based on the last determined distance.
The method for determining one or more services may refer to step S10A1 above, and will not be described herein.
The one or more services determined in step S10B1 may be different from the one or more services determined in step S10A1, and the first electronic device and/or the second electronic device may also create or cancel the corresponding service.
S10B2: and judging whether the error of the ranging mode with the lowest power consumption is smaller than an error threshold value.
The first electronic device and/or the second electronic device judges whether the error of the ranging mode with the lowest power consumption is smaller than an error threshold value. When the number of the services is multiple, the error threshold is the minimum value of the error thresholds of the multiple services; when the number of services is one, the error threshold is the error threshold of the service. Wherein the one or more services are the services determined in step S10B 1.
If the error of the ranging mode with the lowest power consumption is smaller than the error threshold, executing the step S10B3; if the error of the ranging mode with the lowest power consumption is equal to or greater than the error threshold, step S10B4 is executed.
S10B3: and selecting the ranging mode with the lowest power consumption as the third ranging mode.
The first electronic device and/or the second electronic device selects a ranging mode with the lowest power consumption as a third ranging mode.
S10B4: a ranging mode smaller than the error threshold is selected as the third ranging mode.
The first electronic device and/or the second electronic device selects a ranging mode smaller than the error threshold as a third ranging mode.
The following describes the ranging methods shown in fig. 10A and fig. 10B by taking a service as a network access capability sharing service, and examples of ranging methods supported by the first electronic device and the second electronic device include bluetooth ranging and ultrasonic ranging.
The upper limit of the distance of the internet surfing capability sharing service is 1m, and the error threshold value is 10cm. When the distance between the electronic devices is greater than 35cm, the error of ultrasonic ranging is smaller than that of Bluetooth ranging, and when the distance between the electronic devices is smaller than or equal to 35cm, the error of ultrasonic ranging is greater than or equal to that of Bluetooth ranging. The error of bluetooth ranging increases with increasing distance. When the distance between the electronic devices is greater than 40cm, the error of Bluetooth ranging is greater than or equal to 10cm, the error of ultrasonic ranging is less than 10cm, and the power consumption of ultrasonic ranging is greater than Bluetooth ranging.
It should be noted that the above parameters such as error, power consumption, etc. of bluetooth ranging and ultrasonic ranging are merely exemplary, and the embodiments of the present application are not limited thereto. For example, ultrasonic ranging may also consume less power than bluetooth ranging.
Fig. 11A is an exemplary schematic diagram of an electronic device performing a ranging method in a network access capability sharing scenario according to an embodiment of the present application.
As shown in fig. 11A, the distance between two electronic devices is greater than 100cm at time 0; then, from the time 0 to the time t0, the distance between the two electronic devices is gradually reduced to 100cm; from time t0 to time t1, the distance between the two electronic devices gradually decreases from 100cm to 40cm; from time t1 to time t2, the distance between the two electronic devices gradually decreases from 40cm to 35cm; from time t2 to time t3, the distance between the two electronic devices is less than 35cm; from the time t3 to the time t4, the distance between the two electronic devices is not changed, and the two electronic devices are stationary; from time t4 to time t5, the distance between the two electronic devices increases to 35cm; from time t5 to time t6, the distance between the two electronic devices increases from 35cm to 40cm; from time t6 to time t7, the distance between the two electronic devices increases from 40cm to 100cm; from time t7 to time t8, the distance between the two electronic devices gradually increases; after time t8, the distance between the two electronic devices is unchanged, and the two electronic devices are stationary.
After the first electronic device and the second electronic device establish connection, the first ranging is performed, and it is determined at time 0 that the distance between the two electronic devices is greater than 100cm. After the first electronic device and the second electronic device are connected, the distance between the two electronic devices is determined to be greater than 100cm through Bluetooth ranging.
The distance between two electronic devices is less than 100cm and less than the upper limit of the distance of the internet surfing capability sharing service before the time t1 after the time t0, so that a distance measurement mode meeting the error threshold of the internet surfing capability sharing service needs to be used, namely, the distance between the two electronic devices is measured by using ultrasonic distance measurement.
Before t3 after t1, the first electronic device and/or the second electronic device determine that the ranging mode meeting the error threshold of the internet surfing capability sharing service includes bluetooth ranging and ultrasonic ranging, and then one ranging mode can be randomly selected to perform ranging. Alternatively, in some embodiments of the present application, bluetooth ranging may be selected because bluetooth ranging consumes less power than ultrasonic ranging. Alternatively, in some embodiments of the present application, a ranging mode with higher accuracy may be selected according to the change of the distance. For example, ultrasonic ranging is selected before time t2 after time t1, and bluetooth ranging is selected before time t3 after time t 2.
And before t4 after t3, the first electronic equipment and the second electronic equipment are stationary, the distance between the two electronic equipment is smaller than 35cm, and the distance measurement mode with the lowest power consumption is selected to perform the distance measurement, namely, the Bluetooth distance measurement is selected to perform the distance measurement.
Before t6 after t4, the first electronic device and/or the second electronic device determine that the ranging mode meeting the error threshold of the internet surfing capability sharing service includes bluetooth ranging and ultrasonic ranging, and then one ranging mode can be randomly selected to perform ranging. Alternatively, in some embodiments of the present application, bluetooth ranging may be selected because bluetooth ranging consumes less power than ultrasonic ranging. Alternatively, in some embodiments of the present application, a ranging mode with higher accuracy may be selected according to the change of the distance. For example, ultrasonic ranging is selected before time t6 after time t5, and bluetooth ranging is selected before time t5 after time t 4.
The distance between two electronic devices is less than 100cm and less than the upper limit of the distance of the internet surfing capability sharing service before the time t7 after the time t6, so that a distance measurement mode meeting the error threshold of the internet surfing capability sharing service needs to be used, namely, the distance between the two electronic devices is measured by using ultrasonic distance measurement.
And before t8 after t7, the distance between the two electronic devices is larger than the upper limit of the distance of the internet surfing capability sharing service, and the two electronic devices are not stationary, so that Bluetooth ranging is periodically executed.
After the time t8, because the distance between the two electronic devices is greater than the upper limit of the distance of the internet surfing capability sharing service, and the two electronic devices are stationary, the Bluetooth ranging is performed once.
It is worth to be noted that, under the condition that the first electronic device and the second electronic device are both stationary, distance measurement is only performed once; in the case where the first electronic device and the second electronic device are not both stationary, ranging is periodically performed.
The first electronic device and the second electronic device may also perform ranging with reference to the method shown in fig. 9, as shown in fig. 11B.
Fig. 11B is an exemplary schematic diagram of an electronic device performing a ranging method according to an embodiment of the present application.
Unlike what is shown in fig. 11A, the ranging method described in fig. 11B does not consider the case of the upper range limit of traffic and the error threshold of traffic.
Wherein 35cm corresponds to the distance threshold in fig. 9, and when the distance between two electronic devices is less than or equal to 35cm, the error of ultrasonic ranging is greater than or equal to bluetooth ranging; when the distance between the two electronic devices is larger than 35cm, the error of ultrasonic ranging is smaller than Bluetooth ranging.
After the first electronic device and the second electronic device establish connection, the first ranging is performed, and it is determined at time 0 that the distance between the two electronic devices is greater than 100cm. After the first electronic device and the second electronic device are connected, the distance between the two electronic devices is determined to be greater than 100cm through Bluetooth ranging.
The distance between the two electronic devices gradually decreases to 35cm after time 0 and before time t 2. The first electronic device and the second electronic device perform periodic ultrasonic ranging.
The distance between the two electronic devices gradually decreases from 35cm after time t2 and before time t 3. The first electronic device and the second electronic device perform periodic bluetooth ranging.
Both electronic devices are stationary after time t3 and before time t 4. The first electronic device and the second electronic device perform bluetooth ranging once.
The distance between the two electronic devices gradually increases to 35cm after time t4 and before time t 5. The first electronic device and the second electronic device perform periodic bluetooth ranging.
After time t5, the distance between the two electronic devices gradually increases from 35cm, and the first electronic device and the second electronic device perform periodic ultrasonic ranging.
It should be noted that, in conjunction with the content shown in fig. 11A and fig. 11B, the ranging method provided in the embodiment of the present application may only consider the ranging errors of different ranging modes, and may also consider the upper range limit and/or the error threshold of the service on the electronic device.
Finally, the hardware architecture and the software architecture of the electronic device provided by the embodiment of the application are introduced.
Fig. 12 is an exemplary schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present application.
The electronic device may be a cell phone, tablet, desktop, laptop, handheld, notebook, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook, as well as a cellular telephone, personal digital assistant (personal digital assistant, PDA), augmented reality (augmented reality, AR) device, virtual Reality (VR) device, artificial intelligence (artificial intelligence, AI) device, wearable device, vehicle-mounted device, smart home device, and/or smart city device, with embodiments of the application not being particularly limited as to the particular type of electronic device.
The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge 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, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a 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.
It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the application, the electronic device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement a touch function of the electronic device.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing function of the electronic device. The processor 110 and the display screen 194 communicate via a DSI interface to implement the display functionality of the electronic device.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge an electronic device, or may be used to transfer data between the electronic device and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the connection relationship between the modules illustrated in the embodiments of the present application is only illustrative, and does not limit the structure of the electronic device. In other embodiments of the present application, the electronic device may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc. applied on an electronic device. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. for application on an electronic device. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device implements display functions via a GPU, a display screen 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 used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device may implement shooting functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also perform algorithm optimization on noise and brightness of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, and so on.
Video codecs are used to compress or decompress digital video. The electronic device may support one or more video codecs. In this way, the electronic device may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent cognition of electronic devices can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The internal memory 121 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM).
The random access memory may include a static random-access memory (SRAM), a dynamic random-access memory (dynamic random access memory, DRAM), a synchronous dynamic random-access memory (synchronous dynamic random access memory, SDRAM), a double data rate synchronous dynamic random-access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM), etc.;
the nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. divided according to an operation principle, may include single-level memory cells (SLC), multi-level memory cells (MLC), triple-level memory cells (TLC), quad-level memory cells (QLC), etc. divided according to a storage specification, may include universal FLASH memory (english: universal FLASH storage, UFS), embedded multimedia memory cards (embedded multi media Card, eMMC), etc. divided according to a storage specification.
The random access memory may be read directly from and written to by the processor 110, may be used to store executable programs (e.g., machine instructions) for an operating system or other on-the-fly programs, may also be used to store data for users and applications, and the like.
The nonvolatile memory may store executable programs, store data of users and applications, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect external non-volatile memory to enable expansion of the memory capabilities of the electronic device. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and video are stored in an external nonvolatile memory.
The electronic device may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device may listen to music, or to hands-free conversations, through speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device picks up a phone call or voice message, the voice can be picked up by placing the receiver 170B close to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device may be provided with at least one microphone 170C. In other embodiments, the electronic device may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronics determine the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a movement gesture of the electronic device. In some embodiments, the angular velocity of the electronic device about three axes (i.e., x, y, and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device by moving in the opposite direction, thereby realizing anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronics calculate altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device is a flip machine, the electronic device may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device may measure the distance by infrared or laser. In some embodiments, the scene is photographed and the electronic device can range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device emits infrared light outwards through the light emitting diode. The electronic device uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that an object is in the vicinity of the electronic device. When insufficient reflected light is detected, the electronic device may determine that there is no object in the vicinity of the electronic device. The electronic device may detect that the user holds the electronic device near the ear to talk using the proximity light sensor 180G, so as to automatically extinguish the screen for power saving purposes. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device can adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect if the electronic device is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic equipment can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access the application lock, fingerprint photographing, fingerprint incoming call answering and the like.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device performs a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, the electronics perform a reduction in performance of a processor located near temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device heats the battery 142 to avoid low temperatures causing the electronic device to shut down abnormally. In other embodiments, the electronic device performs boosting of the output voltage of the battery 142 when the temperature is below a further threshold to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device. The electronic device may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic equipment interacts with the network through the SIM card, so that the functions of communication, data communication and the like are realized. In some embodiments, the electronic device employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.
In an embodiment of the present application, the wireless communication module 160 may be used to perform bluetooth ranging; the speaker 170A and the receiver 170B may be used to receive ultrasonic signals, and the microphone 170C may be used to transmit ultrasonic signals.
Fig. 13A is an exemplary schematic diagram of a software architecture of an electronic device according to an embodiment of the present application.
The software system of the electronic device may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the application, an Android system with a layered architecture is taken as an example, and the software structure of the electronic equipment is illustrated.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 13A, the application package may include applications for cameras, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 13A, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is for providing communication functions of the electronic device. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Fig. 13B is another exemplary schematic diagram of a software architecture of an electronic device according to an embodiment of the present application.
As shown in fig. 13B, an application or service (service) may send a ranging request 1 to the converged decision center module, where the ranging request 1 may include a device ID of the second electronic device. The ranging request 1 may also include an upper range limit, an error threshold, corresponding to the traffic running on the application or service.
After receiving the ranging request 1, the fusion decision center module may send the ranging request 2 to the bluetooth ranging module or send the ranging request 3 to the ultrasonic ranging module. After receiving the ranging request 2, the Bluetooth ranging module triggers ranging, and then returns the determined distance to the fusion decision center. After receiving the ranging request 3, the ultrasonic ranging module triggers ranging and then returns the determined distance to the fusion decision center.
The fusion decision center module can determine whether the distance measurement is performed by the Bluetooth distance measurement module or the ultrasonic distance measurement module. For example, the fusion decision center determines whether to send ranging request 2 or ranging request 3 according to the last obtained distance, the upper distance limit, and the error threshold.
The fusion decision center module can also determine whether any one of the two electronic devices is moving through the movement detection module. If both electronic devices are stationary, performing a ranging, such as bluetooth ranging or ultrasonic ranging; if both electronic devices are not stationary, ranging is periodically performed.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to detection …" depending on the context. Similarly, the phrase "at the time of determination …" or "if detected (a stated condition or event)" may be interpreted to mean "if determined …" or "in response to determination …" or "at the time of detection (a stated condition or event)" or "in response to detection (a stated condition or event)" depending on the context.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.

Claims (30)

1. A ranging method applied to a first electronic device, comprising:
determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment;
determining a distance measurement mode with the smallest error on the first distance as a second distance measurement mode;
and determining a second distance through the second distance measuring mode, and determining the second distance as the distance between the first electronic equipment and the second electronic equipment, wherein the first distance measuring mode is different from the second distance measuring mode.
2. The method according to claim 1, wherein the method further comprises:
After the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection;
the connection is established based on one or more modes of WiFi, bluetooth, NFC and ZigBee.
3. The method of claim 2, wherein after the first electronic device and the second electronic device establish a connection, before the determining the first distance by the first ranging method, the method further comprises:
and determining that the first electronic device and the second electronic device support the first ranging mode and the second ranging mode based on the connection.
4. A method according to any one of claims 1 to 3, wherein,
the distance measuring mode supported by the first electronic equipment comprises Bluetooth distance measuring and ultrasonic distance measuring;
the first ranging mode is the Bluetooth ranging mode;
the determining that the ranging mode with the smallest error on the first distance is a second ranging mode specifically includes: and after judging that the first distance is larger than a first distance threshold, determining that the second distance measurement mode is the ultrasonic distance measurement.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
The first distance threshold is 35 cm.
6. The method according to any one of claims 1-5, further comprising:
in response to determining that the first electronic device and the second electronic device are both in a non-stationary state, periodically determining a third distance through a third ranging mode, wherein the third ranging mode is a ranging mode with lowest power consumption in ranging modes supported by the first electronic device;
judging whether the error of the third ranging mode on the third distance is smaller than an error threshold value or not;
if the error of the third ranging mode on the third distance is smaller than the error threshold, determining that the third distance is the distance between the first electronic device and the second electronic device;
and if the error of the third ranging mode on the third distance is greater than or equal to the error threshold, periodically determining a fourth distance as the distance between the first electronic device and the second electronic device through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, and the error of the fourth ranging mode on the fourth distance is smaller than the error threshold.
7. The method of claim 6, wherein the step of providing the first layer comprises,
The third ranging mode is the Bluetooth ranging mode, and the fourth ranging mode is the ultrasonic ranging mode;
the determining whether the error of the third ranging mode at the third distance is smaller than the error threshold specifically includes: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the error threshold; and if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the third distance is greater than or equal to the error threshold.
8. The method of claim 7, wherein the step of determining the position of the probe is performed,
the second distance threshold is 35 cm.
9. A ranging method applied to a first electronic device, comprising:
determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment;
determining one or more first services based on the first distance, wherein the first distance is less than or equal to a first upper distance limit, which is the minimum value of the upper distance limits of the one or more first services;
Judging whether the error of the first ranging mode on the first distance is smaller than a first error threshold, wherein the first error threshold is the minimum value of error thresholds of one or more businesses;
and if the error of the first ranging mode on the first distance is smaller than the first error threshold, determining that the first distance is the distance between the first electronic device and the second electronic device.
10. The method according to claim 9, wherein the method further comprises:
after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection;
the connection is established based on one or more modes of WiFi, bluetooth, NFC and ZigBee.
11. The method of claim 10, wherein after the first electronic device and the second electronic device establish a connection, before the determining the first distance by the first ranging method, the method further comprises:
and determining that the first electronic device and the second electronic device support the first ranging mode and the second ranging mode based on the connection.
12. The method according to any one of claims 9-11, further comprising:
if the error of the first ranging mode on the first distance is larger than or equal to the first error threshold, determining a second ranging mode based on the first distance and the first error threshold, wherein the error of the second ranging mode on the first distance is smaller than the first error threshold;
and determining a second distance in the second distance measuring mode, and determining the second distance as the distance between the first electronic equipment and the second electronic equipment.
13. The method of claim 12, wherein the step of determining the position of the probe is performed,
the distance measuring mode supported by the first electronic equipment comprises Bluetooth distance measuring and ultrasonic distance measuring;
the first distance measurement mode is the Bluetooth distance measurement mode, and the second distance measurement mode is the ultrasonic distance measurement mode;
the determining whether the error of the first ranging mode on the first distance is smaller than a first error threshold value specifically includes: judging whether the first distance is smaller than the first distance threshold value; if the first distance is smaller than the first distance threshold, determining that the error of the first ranging mode on the first distance is smaller than the first error threshold; if the first distance is greater than or equal to the first distance threshold, determining that the error of the first ranging mode on the first distance is greater than or equal to the first error threshold;
The first distance threshold is related to the first error threshold.
14. The method according to any one of claims 9-13, further comprising:
in response to determining that the first electronic device and/or the second electronic device are in a non-stationary state, determining a third ranging mode based on the last determined distance between the first electronic device and the second electronic device;
and periodically determining a third distance through the third distance measuring mode.
15. The method according to claim 14, wherein determining the third ranging pattern based on the last determined distance, specifically comprises:
if the distance between the first electronic device and the second electronic device determined last time is greater than the maximum value of the upper limits of the distances of all the services, the third distance measurement mode is the distance measurement mode with the lowest power consumption;
if the last determined distance is not greater than the maximum value of the distance upper limit of the business, determining one or more second businesses; and determining the third ranging mode based on a second error threshold, wherein the second error threshold is the minimum value of the error thresholds of the one or more second services, the last determined distance between the first electronic device and the second electronic device is smaller than a second distance upper limit, and the second distance is the minimum value of the distance upper limits of the one or more second services.
16. The method of claim 15, further comprising, after the periodically determining the third distance by the third ranging method:
determining one or more third services based on the third distance;
judging whether the error of the third ranging mode on the third distance is smaller than a third error threshold, wherein the third error threshold is the minimum value of the error thresholds of the one or more third services;
if the error of the third ranging mode on the third distance is smaller than the third error threshold, determining that the third distance is the distance between the first electronic device and the second electronic device;
and if the error of the third ranging mode on the third distance is greater than or equal to the third error threshold, determining a fourth distance periodically through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, the error of the fourth ranging mode on the third distance is less than the error threshold, and the fourth distance is the distance between the first electronic equipment and the second electronic equipment.
17. The method of claim 16, wherein the step of determining the position of the probe comprises,
the third ranging mode is the Bluetooth ranging mode, and the fourth ranging mode is the ultrasonic ranging mode;
The determining whether the error of the third ranging mode in the third distance is smaller than a third error threshold value specifically includes: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the second error threshold; if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the first distance is greater than or equal to the second error threshold;
the second distance threshold is related to the third error threshold.
18. The method according to any one of claims 9 to 17, wherein,
the one or more first services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services; the one or more second services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services;
the method further comprises the steps of: and when the one or more first services comprise a network surfing capability sharing service, after determining that the distance between the first electronic device and the second electronic device is smaller than the upper distance limit of the network surfing capability sharing service, the first electronic device and the second electronic device share the network surfing capability, and the network surfing capability is derived from the first electronic device or the second electronic device.
19. The method according to any one of claims 9 to 17, wherein,
the one or more first services comprise one or more of pairing tasks, internet surfing capability sharing services, call sharing services and short message sharing services;
the method further comprises the steps of: and when the one or more first services comprise a call sharing service and a short message sharing service, after determining that the distance between the first electronic device and the second electronic device is smaller than the upper distance limit of the call sharing service and the short message sharing service, the first electronic device displays a first control and a second control, wherein the first control corresponds to the call function of the second electronic device, and the second control corresponds to the short message function of the second electronic device.
20. A ranging method applied to a system including a first electronic device and a second electronic device, comprising:
after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection;
the first electronic device determines a first distance based on a first ranging mode, and the second electronic device determines a second distance based on the first ranging mode;
The first electronic device and the second electronic device exchanging the first distance and the second distance;
the first electronic device and the second electronic device determine a third distance that is a distance between the first electronic device and the second electronic device, the third distance being a smaller value of the first distance and the second distance.
21. The method of claim 20, wherein the first ranging mode is bluetooth ranging, ultrasonic ranging, or ultra wideband signal ranging; the connection is established based on one or more modes of WiFi, bluetooth, NFC and ZigBee.
22. An electronic device, the electronic device comprising: one or more processors and memory;
the memory is coupled with the one or more processors, the memory is for storing computer program code, the computer program code comprising computer instructions that the one or more processors call to cause the electronic device to perform: determining a first distance in a first distance measurement mode, wherein the first distance measurement mode is the distance measurement mode with the shortest time consumption or the lowest power consumption among the distance measurement modes supported by the first electronic equipment; determining a distance measurement mode with the smallest error on the first distance as a second distance measurement mode; and determining a second distance through the second distance measuring mode, and determining that the second distance is the distance between the first electronic equipment and the second electronic equipment, wherein the first distance measuring mode is different from the second distance measuring mode.
23. The method of claim 22, wherein the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: after the first electronic device and the second electronic device establish connection, determining the electronic device to be subjected to distance measurement as the second electronic device based on the connection; the connection is established based on one or more modes of WiFi, bluetooth, NFC and ZigBee; and determining that the first electronic device and the second electronic device support the first ranging mode and the second ranging mode based on the connection.
24. The method according to claim 22 or 23, wherein the ranging means supported by the first electronic device comprises bluetooth ranging, ultrasonic ranging; the first ranging mode is the Bluetooth ranging mode; the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: and after judging that the first distance is larger than a first distance threshold, determining that the second distance measurement mode is the ultrasonic distance measurement.
25. The method of any of claims 22-24, wherein the one or more processors are further configured to invoke the computer instructions to cause the electronic device to perform: in response to determining that the first electronic device and the second electronic device are both in a non-stationary state, periodically determining a third distance through a third ranging mode, wherein the third ranging mode is a ranging mode with lowest power consumption in ranging modes supported by the first electronic device; judging whether the error of the third ranging mode on the third distance is smaller than an error threshold value or not; if the error of the third ranging mode on the third distance is smaller than the error threshold, determining that the third distance is the distance between the first electronic device and the second electronic device; and if the error of the third ranging mode on the third distance is greater than or equal to the error threshold, periodically determining a fourth distance as the distance between the first electronic device and the second electronic device through a fourth ranging mode, wherein the fourth ranging mode is different from the third ranging mode, and the error of the fourth ranging mode on the fourth distance is smaller than the error threshold.
26. The method of claim 25, wherein the third ranging mode is the bluetooth ranging and the fourth ranging mode is the ultrasonic ranging; the one or more processors are specifically configured to invoke the computer instructions to cause the electronic device to perform: judging whether the third distance is smaller than a second distance threshold value; if the third distance is smaller than the second distance threshold, determining that the error of the third ranging mode on the third distance is smaller than the error threshold; and if the third distance is greater than or equal to the second distance threshold, determining that the error of the third ranging mode on the third distance is greater than or equal to the error threshold.
27. An electronic device, the electronic device comprising: one or more processors and memory;
the memory is coupled with the one or more processors, the memory for storing computer program code comprising computer instructions that the one or more processors invoke to cause the electronic device to perform the method of any of claims 9-19.
28. A chip system for application to an electronic device, the chip system comprising one or more processors to invoke computer instructions to cause the electronic device to perform the method of any of claims 1-19.
29. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1-19.
30. A computer program product comprising computer instructions which, when executed by one or more processors, implement the method of any of claims 1-19.
CN202210283225.7A 2022-03-22 2022-03-22 Distance measurement method and electronic equipment Pending CN116819434A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210283225.7A CN116819434A (en) 2022-03-22 2022-03-22 Distance measurement method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210283225.7A CN116819434A (en) 2022-03-22 2022-03-22 Distance measurement method and electronic equipment

Publications (1)

Publication Number Publication Date
CN116819434A true CN116819434A (en) 2023-09-29

Family

ID=88119001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210283225.7A Pending CN116819434A (en) 2022-03-22 2022-03-22 Distance measurement method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116819434A (en)

Similar Documents

Publication Publication Date Title
CN112231025B (en) UI component display method and electronic equipment
CN109890067B (en) Method and electronic equipment for identifying specific position on specific route
CN110910872B (en) Voice interaction method and device
CN111371849A (en) Data processing method and electronic equipment
CN112445762A (en) File sharing method and equipment for mobile terminal
CN115333941B (en) Method for acquiring application running condition and related equipment
CN114006698B (en) token refreshing method and device, electronic equipment and readable storage medium
CN113380240B (en) Voice interaction method and electronic equipment
CN116819434A (en) Distance measurement method and electronic equipment
CN116346982B (en) Method for processing audio, electronic device and readable storage medium
CN117013660B (en) Charging icon display method and electronic equipment
CN115993592B (en) Bluetooth ranging method, electronic equipment and storage medium
CN116743921B (en) Method for displaying number-carrying network number, electronic equipment and storage medium
CN115513571B (en) Control method of battery temperature and terminal equipment
CN118054851A (en) Equipment networking method and electronic equipment
CN117177216A (en) Information interaction method and device and electronic equipment
CN118072723A (en) Collaborative wake-up method and device and electronic equipment
CN117692977A (en) Network residence method and related equipment
CN117978308A (en) Bluetooth ranging method, electronic equipment and system
CN116668997A (en) Positioning method, user interface and electronic equipment
CN117311484A (en) Method for adjusting power consumption of equipment and electronic equipment
CN116996900A (en) Data transmission method and electronic equipment
CN117119098A (en) Account shielding method, communication system and electronic equipment
CN117708009A (en) Signal transmission method and electronic equipment
CN118233446A (en) Application downloading method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination