Communication method and electronic equipment

By using an adaptive switching ranging method, the problem of Bluetooth channel detection consuming resources in vehicle communication is solved, enabling flexible switching between inside and outside the vehicle, reducing power consumption and improving communication quality.

CN122073675APending Publication Date: 2026-05-22HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411693268.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Bluetooth channel detection and ranging consumes a large amount of air interface resources in communication between electronic devices and vehicles, affecting audio and call interaction, and simultaneously scanning Bluetooth and satellite broadcasting increases power consumption.

Method used

Depending on whether the electronic device is inside the vehicle, the ranging method is adaptively switched. The second ranging method with lower accuracy is used when the device is inside the vehicle, while the first ranging method with higher accuracy is used when the device is outside the vehicle. This is combined with Bluetooth and StarFlash communication technologies to reduce air interface resource usage and power consumption.

Benefits of technology

While meeting ranging requirements, it reduces the occupation of air interface resources and power consumption, improves in-vehicle communication quality, and simplifies user operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122073675A_ABST
    Figure CN122073675A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and electronic equipment, and relates to the technical field of terminals. According to the invention, the first electronic device can adaptively switch the distance measurement mode according to whether the second electronic device is located in the vehicle, so that when the second electronic device is located in the vehicle, air interface resources occupied by the distance measurement function can be reduced, and the communication quality of other devices in the vehicle is prevented from being affected. The method comprises the steps that under the condition that second electronic equipment is located outside a vehicle, first electronic equipment obtains the distance between the first electronic equipment and the second electronic equipment through a first distance measuring mode; under the condition that the second electronic equipment is located in the vehicle, the first electronic equipment obtains the distance between the first electronic equipment and the second electronic equipment through the second distance measuring mode. Wherein the distance measurement precision of the second distance measurement mode is smaller than that of the first distance measurement mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a communication method and electronic device. Background Technology

[0002] With the development of terminal technology, car key functionality can be installed in electronic devices. After establishing a wireless communication connection with the vehicle via Bluetooth, the electronic device can control the vehicle through this key function. For example, based on this wireless communication connection, the vehicle can automatically unlock when it detects the electronic device approaching, thus simplifying the unlocking process for the user. Another example is that after a user enters the vehicle with an electronic device, the vehicle can determine the user's location based on the wireless communication connection, thereby providing the user with corresponding location services, such as adjusting the seat, air conditioning, and entertainment system settings.

[0003] The vehicle uses Bluetooth channel sounding (CS) technology to achieve ranging. However, CS ranging consumes a significant amount of air interface resources, affecting the interaction between electronic devices and the vehicle. For example, it can impact audio and communication between the electronic devices and the vehicle. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a communication method and an electronic device. The technical solution provided by this application allows the first electronic device to adaptively switch the ranging mode based on whether the second electronic device is located inside the vehicle. This reduces the air interface resources occupied by the ranging function when the second electronic device is inside the vehicle, thus avoiding impact on the communication quality of other devices on the vehicle.

[0005] To achieve the above-mentioned technical objectives, this application provides the following technical solution:

[0006] In a first aspect, a communication method is provided, applied to a first electronic device, which is a vehicle or a processing module within a vehicle. The method includes: when a second electronic device is located outside the vehicle, the first electronic device acquires the distance to the second electronic device using a first ranging method; when the second electronic device is located inside the vehicle, the first electronic device acquires the distance to the second electronic device using a second ranging method. The ranging accuracy of the second ranging method is less than that of the first ranging method.

[0007] In this way, the ranging mode can be flexibly switched between inside and outside the vehicle, which can meet the ranging requirements while reducing power consumption and improving the rational use of air interface resources.

[0008] According to the first aspect, after the first electronic device obtains the distance between itself and the second electronic device through the second ranging method, the method further includes: after detecting that the door is open, obtaining the distance between itself and the second electronic device through the first ranging method.

[0009] In one scenario, after the car door opens, the user may need to get out of the vehicle. In this case, the first electronic device switches the ranging method from the second ranging method back to the first ranging method. This facilitates obtaining more accurate ranging results subsequently.

[0010] According to the first aspect, or any implementation of the first aspect above, the method further includes: detecting that the vehicle door is closed. If the second electronic device is located inside the vehicle, the distance between the device and the second electronic device is obtained using a second ranging method. If the second electronic device is located outside the vehicle, the distance between the device and the second electronic device is obtained using a first ranging method.

[0011] For example, after detecting that a car door is open, the first electronic device performs distance measurement using a first ranging method. During this process, the first electronic device may detect that the car door is closed. If the first electronic device detects that the car door is closed, there are two possibilities: First, the user closes the door without exiting the vehicle, in which case the second electronic device is still inside the vehicle, and the first electronic device can switch the ranging method back to the second ranging method. This satisfies the ranging requirements of the first electronic device while reducing the occupation of air interface resources and power consumption. Second, the user exits the vehicle and closes the door, in which case the second electronic device is outside the vehicle, and the first electronic device can continue to perform distance measurement using the first ranging method. This achieves more accurate ranging results.

[0012] In this way, the ranging method can be flexibly adjusted based on user needs and actual conditions.

[0013] According to the first aspect, or any implementation of the first aspect above, the first ranging method is any one or more of the following: ranging based on Bluetooth channel detection, ranging based on StarFlash Low Power Access technology, and multi-node ranging; the second ranging method is ranging based on received signal strength indication and / or single-node ranging.

[0014] Thus, the multiple flexible implementations of the first and second ranging methods not only save power consumption but also increase the flexibility of switching ranging methods.

[0015] According to the first aspect, or any implementation of the first aspect above, the method further includes: the first electronic device determining whether the distance between itself and the second electronic device is less than or equal to a first threshold. If the distance between the first electronic device and the second electronic device is less than or equal to the first threshold, it is determined that the second electronic device is located inside the vehicle.

[0016] In this way, determining whether the second electronic device is located inside the vehicle by measuring distance makes it easier to decide whether the ranging method needs to be adjusted.

[0017] According to the first aspect, or any implementation of the first aspect above, the first electronic device determines whether the distance between itself and the second electronic device is less than or equal to a first threshold, including: the first electronic device determines whether the distance between itself and the second electronic device is less than or equal to the first threshold by any one or more of the following methods: first ranging method, second ranging method, connectionless ranging method, ultrasonic positioning, and global satellite positioning.

[0018] In this way, the first electronic device can also flexibly determine whether the second electronic device is inside the vehicle in a variety of ways, so as to trigger the switching of the ranging method.

[0019] According to the first aspect, or any implementation of the first aspect above, before obtaining the distance to the second electronic device, the method further includes: sending a first broadcast based on a first wireless communication technology, the first broadcast carrying at least one of the following: a first address of the first electronic device based on the first wireless communication technology; a first indication indicating that the first electronic device supports the second wireless communication technology; and a second indication indicating that the second address carried in the broadcast sent by the first electronic device based on the second wireless communication technology is a random address. The first broadcast is used to establish a wireless communication connection with the second electronic device based on the second wireless communication technology.

[0020] The first wireless communication technology is, for example, Bluetooth communication technology, and the second wireless communication technology is, for example, StarScan communication technology.

[0021] In this way, the second electronic device can establish a star-flash connection with the first electronic device by receiving a Bluetooth broadcast (such as the first broadcast) sent by the first electronic device. This eliminates the need for the second electronic device to have star-flash scanning enabled by default, reducing the power consumption of star-flash scanning.

[0022] According to the first aspect, or any implementation of the first aspect above, before obtaining the distance between the first electronic device and the second electronic device, the method further includes: sending to the server a first communication address of the first electronic device based on a first wireless communication technology and a second communication address based on a second wireless communication technology.

[0023] The first wireless communication address is, for example, the Bluetooth address of the first electronic device, and the second wireless communication address is, for example, the Star Flash address of the first electronic device.

[0024] Among them, the first wireless communication address and the second wireless communication address are the actual communication addresses of the first electronic device.

[0025] In this way, the first electronic device automatically uploads its Bluetooth address and / or Star Flash address to the server, which makes it easier for the second electronic device to flexibly obtain the Bluetooth address and / or Star Flash address of the first electronic device and establish a Bluetooth connection or Star Flash connection.

[0026] Secondly, a communication method is provided, applied to a second electronic device. The method includes: receiving a first broadcast sent by a first electronic device, the first broadcast being a broadcast sent by the first electronic device based on a first wireless communication technology; acquiring first information carried in the first broadcast; and establishing a communication connection with the first electronic device based on a second wireless communication technology according to the first information. The communication connection is used when the second electronic device is located outside a vehicle, and the first electronic device is a vehicle or a processing module within a vehicle, to acquire the distance between itself and the second electronic device using a first ranging method corresponding to the communication connection. The communication connection is also used when the second electronic device is located inside a vehicle, and the first electronic device acquires the distance between itself and the second electronic device using a second ranging method corresponding to the communication connection. The ranging accuracy of the second ranging method is less than the ranging accuracy of the first ranging method.

[0027] In this way, the second electronic device does not need to enable scanning based on the second wireless communication technology by default, and can also establish a communication connection based on the second wireless communication technology based on the first wireless communication technology, thereby reducing the power consumption of scanning based on the second wireless communication technology.

[0028] Furthermore, the ability to flexibly switch between ranging methods inside and outside the vehicle not only meets ranging requirements but also reduces power consumption and improves the rational use of air interface resources.

[0029] According to the second aspect, the first information includes at least one of the following: a first address of the first electronic device based on the first wireless communication technology, a first indication for indicating that the first electronic device supports the second wireless communication technology, and a second indication for indicating that the second address carried in a broadcast sent by the first electronic device based on the second wireless communication technology is a random address.

[0030] For example, the Bluetooth broadcast sent by the first electronic device carries the Bluetooth address of the first electronic device.

[0031] As another example, if the first electronic device supports the Star Flash function, a first indication for indicating that the first electronic device supports the Star Flash function can be carried in the transmitted Bluetooth broadcast.

[0032] As another example, the first electronic device carries a random starlight address in the starlight broadcast it sends. Then, the first electronic device can carry a second indication in the Bluetooth broadcast it sends, indicating that the starlight address carried in the starlight broadcast it sends is a random address.

[0033] Thus, by implementing the first information in multiple ways, it is convenient for the second electronic device to flexibly establish a communication connection with the second electronic device based on the second wireless communication connection technology.

[0034] According to the second aspect, or any implementation thereof, the first information includes a first address of the first electronic device based on a first wireless communication technology; establishing a communication connection with the first electronic device based on a second wireless communication technology according to the first information includes: obtaining at least one pair of locally stored communication addresses, each pair of communication addresses corresponding to the first wireless communication technology and the second wireless communication technology respectively; if a first communication address identical to the first address exists in the at least one pair of communication addresses, obtaining a second communication address corresponding to the first communication address; and establishing a communication connection with the first electronic device according to the second communication address.

[0035] In this way, the second electronic device does not need to enable star flash scanning by default, reducing the power consumption of star flash scanning. Furthermore, the second electronic device can quickly determine the star flash broadcast sent by the first electronic device based on the star flash address found on the end side, improving the efficiency of star flash connection establishment.

[0036] According to the second aspect, or any implementation thereof, establishing a communication connection with the first electronic device based on the second wireless communication technology, according to the first information, includes: if the first information includes a first indication, obtaining a first address included in the first information, wherein the first indication is used to indicate that the first electronic device supports the second wireless communication technology; obtaining a second communication address corresponding to the first communication address that is the same as the first address from at least one pair of communication addresses stored locally; and establishing a communication connection with the second electronic device according to the second communication address.

[0037] In this way, the second electronic device does not need to enable star flash scanning by default, reducing the power consumption of star flash scanning. Furthermore, the second electronic device can quickly determine the star flash broadcast sent by the first electronic device based on the star flash address found on the end side, improving the efficiency of star flash connection establishment.

[0038] Furthermore, the process of determining whether a first electronic device has a star flash function is simplified by using the first star flash indicator.

[0039] According to the second aspect, or any implementation thereof, establishing a communication connection with the first electronic device based on the second wireless communication technology, based on the first information, includes: when the first information includes a second indication, scanning broadcasts transmitted based on the second wireless communication technology to obtain a second broadcast transmitted by the first electronic device, wherein the second broadcast carries target content, and the second indication is used to indicate that the second address carried in the broadcast transmitted by the first electronic device based on the second wireless communication technology is a random address; obtaining a second communication address corresponding to the first communication address that is the same as the first address included in the first information from at least one pair of communication addresses stored locally; and establishing a communication connection with the second electronic device based on the second communication address.

[0040] Thus, through the second instruction, a starlight connection is established between the second electronic device and the first electronic device in a random address scenario.

[0041] According to the second aspect, or any implementation of the second aspect above, before receiving the first broadcast sent by the first electronic device, the method further includes: downloading and saving a first communication address and a second communication address of the first electronic device from a server, wherein the first communication address corresponds to a first wireless communication technology and the second communication address corresponds to a second wireless communication technology.

[0042] The first wireless communication address is, for example, the Bluetooth address of the first electronic device, and the second wireless communication address is, for example, the Star Flash address of the first electronic device.

[0043] Among them, the first wireless communication address and the second wireless communication address are the actual communication addresses of the first electronic device.

[0044] In this way, the second electronic device can obtain the real communication address uploaded by the first electronic device from the server, which simplifies the process of establishing a communication connection between the second electronic device and the first electronic device.

[0045] According to the second aspect, or any implementation of the second aspect above, the first ranging method is any one or more of the following: ranging based on Bluetooth channel detection, ranging based on StarFlash Low Power Access technology, and multi-node ranging; the second ranging method is ranging based on received signal strength indication and / or single-node ranging.

[0046] Thus, the multiple flexible implementations of the first and second ranging methods not only save power consumption but also increase the flexibility of switching ranging methods.

[0047] Thirdly, a first electronic device is provided. The first electronic device includes a processor and a memory. The memory is coupled to the processor and stores computer program code, including computer instructions. When the processor reads the computer instructions from the memory, the first electronic device executes the following: when a second electronic device is located outside the vehicle, the first electronic device obtains the distance to the second electronic device using a first ranging method; when the second electronic device is located inside the vehicle, the first electronic device obtains the distance to the second electronic device using a second ranging method. The ranging accuracy of the second ranging method is less than that of the first ranging method. The first electronic device is a vehicle or a processing module within a vehicle.

[0048] According to the third aspect, when the processor reads computer instructions from the memory, the first electronic device also executes the following when it detects that the door is open: after detecting that the door is open, it obtains the distance between itself and the second electronic device using the first ranging method.

[0049] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from memory, it also causes the first electronic device to execute: detect that the door is closed. If the second electronic device is located inside the vehicle, the distance between the two devices is obtained using a second ranging method. If the second electronic device is located outside the vehicle, the distance between the two devices is obtained using a first ranging method.

[0050] According to the third aspect, or any implementation of the third aspect above, the first ranging method is any one or more of the following: ranging based on Bluetooth channel detection, ranging based on StarFlash Low Power Access technology, and multi-node ranging; the second ranging method is ranging based on received signal strength indication and / or single-node ranging.

[0051] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from memory, it further causes the first electronic device to perform the following: the first electronic device determines whether the distance between itself and the second electronic device is less than or equal to a first threshold. If the distance between the first electronic device and the second electronic device is less than or equal to the first threshold, it is determined that the second electronic device is located inside the vehicle.

[0052] According to the third aspect, or any implementation of the third aspect above, the first electronic device determines whether the distance between itself and the second electronic device is less than or equal to the first threshold, including: the first electronic device determines whether the distance between itself and the second electronic device is less than or equal to the first threshold by any one or more of the following methods: first ranging method, second ranging method, connectionless ranging method, ultrasonic positioning, and global satellite positioning.

[0053] According to the third aspect, or any implementation thereof, when the processor reads computer instructions from memory, it further causes the first electronic device to execute: sending a first broadcast based on a first wireless communication technology, wherein the first broadcast carries at least one of the following: a first address of the first electronic device based on the first wireless communication technology; a first indication indicating that the first electronic device supports a second wireless communication technology; and a second indication indicating that the second address carried in the broadcast sent by the first electronic device based on the second wireless communication technology is a random address. The first broadcast is used to establish a wireless communication connection with the second electronic device based on the second wireless communication technology.

[0054] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from memory, it also causes the first electronic device to execute: sending to the server a first communication address of the first electronic device based on a first wireless communication technology, and a second communication address based on a second wireless communication technology.

[0055] Fourthly, a second electronic device is provided. The second electronic device includes a processor and a memory. The memory is coupled to the processor and stores computer program code, including computer instructions. When the processor reads the computer instructions from the memory, the second electronic device executes: receiving a first broadcast sent by a first electronic device, the first broadcast being a broadcast sent by the first electronic device based on a first wireless communication technology; acquiring first information carried in the first broadcast; and establishing a communication connection with the first electronic device based on a second wireless communication technology according to the first information. The communication connection is used when the second electronic device is located outside a vehicle, and the first electronic device is a vehicle or a processing module within a vehicle, to acquire the distance between itself and the second electronic device using a first ranging method corresponding to the communication connection. The communication connection is also used when the second electronic device is located inside a vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the first electronic device is located inside the vehicle, and the second ranging method has a lower ranging accuracy than the first ranging method.

[0056] According to the fourth aspect, the first information includes at least one of the following: a first address of the first electronic device based on the first wireless communication technology, a first indication for indicating that the first electronic device supports the second wireless communication technology, and a second indication for indicating that the second address carried in a broadcast sent by the first electronic device based on the second wireless communication technology is a random address.

[0057] According to the fourth aspect, or any implementation thereof, the first information includes a first address of the first electronic device based on a first wireless communication technology; establishing a communication connection with the first electronic device based on a second wireless communication technology according to the first information includes: obtaining at least one pair of locally stored communication addresses, each pair of communication addresses corresponding to the first wireless communication technology and the second wireless communication technology respectively; if a first communication address identical to the first address exists in the at least one pair of communication addresses, obtaining a second communication address corresponding to the first communication address; and establishing a communication connection with the first electronic device according to the second communication address.

[0058] According to the fourth aspect, or any implementation thereof, establishing a communication connection with the first electronic device based on the second wireless communication technology, according to the first information, includes: if the first information includes a first indication, obtaining a first address included in the first information, wherein the first indication is used to indicate that the first electronic device supports the second wireless communication technology; obtaining a second communication address corresponding to the first communication address that is the same as the first address from at least one pair of communication addresses stored locally; and establishing a communication connection with the second electronic device according to the second communication address.

[0059] According to the fourth aspect, or any implementation thereof, establishing a communication connection with the first electronic device based on the second wireless communication technology, based on the first information, includes: when the first information includes a second indication, scanning broadcasts transmitted based on the second wireless communication technology to obtain a second broadcast transmitted by the first electronic device, wherein the second broadcast carries target content, and the second indication is used to indicate that the second address carried in the broadcast transmitted by the first electronic device based on the second wireless communication technology is a random address; obtaining a second communication address corresponding to the first communication address that is the same as the first address included in the first information from at least one pair of communication addresses stored locally; and establishing a communication connection with the second electronic device based on the second communication address.

[0060] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads computer instructions from memory, it also causes the second electronic device to execute: downloading and saving the first communication address and the second communication address of the first electronic device from the server, wherein the first communication address corresponds to the first wireless communication technology and the second communication address corresponds to the second wireless communication technology.

[0061] According to the fourth aspect, or any of the above implementations of the fourth aspect, the first ranging method is any one or more of the following: ranging based on Bluetooth channel detection, ranging based on Star Flash Low Power Access technology, and multi-node ranging; the second ranging method is ranging based on received signal strength indication and / or single-node ranging.

[0062] Fifthly, an electronic device is provided that has the function of implementing the method as described in the first aspect and any of its possible implementations; or, the electronic device has the function of implementing the method as described in the second aspect and any of its possible implementations. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function.

[0063] Sixthly, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as instructions or code) that, when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any embodiment thereof; or causes the electronic device to perform the method of the second aspect or any embodiment thereof.

[0064] In a seventh aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect; or causes the electronic device to perform the method of the second aspect or any one of the embodiments of the second aspect.

[0065] Eighthly, a circuit system is provided, the circuit system including a processing circuit configured to perform the method of the first aspect or any embodiment of the first aspect; or, the processing circuit is configured to perform the method of the second aspect or any embodiment of the second aspect.

[0066] A ninth aspect provides a chip system including at least one processor and at least one interface circuit, wherein the at least one interface circuit is configured to perform transceiver functions and send instructions to the at least one processor, wherein when the at least one processor executes instructions, the at least one processor executes the method of the first aspect or any embodiment thereof; or, the at least one processor executes the method of the second aspect or any embodiment thereof.

[0067] The technical effects of the aforementioned aspects can be referenced from each other, and will not be elaborated further here. Attached Figure Description

[0068] Figure 1 This is a schematic diagram illustrating a car key usage scenario provided in an embodiment of this application.

[0069] Figure 2 A schematic diagram of a communication system in which the communication method provided in the embodiments of this application is applied;

[0070] Figure 3 A schematic diagram of the hardware structure of the first electronic device provided in an embodiment of this application;

[0071] Figure 4 This is a schematic diagram of a communication node provided in an embodiment of this application;

[0072] Figure 5 Flowchart of the communication method provided in the embodiments of this application Figure 1 ;

[0073] Figure 6 Flowchart of the communication method provided in the embodiments of this application Figure 2 ;

[0074] Figure 7 Flowchart of the communication method provided in the embodiments of this application Figure 3 ;

[0075] Figure 8 Flowchart of the communication method provided in the embodiments of this application Figure 4 ;

[0076] Figure 9 Flowchart of the communication method provided in the embodiments of this application Figure 5 ;

[0077] Figure 10 Flowchart of the communication method provided in the embodiments of this application Figure 6 ;

[0078] Figure 11 A schematic diagram of the structure of the first electronic device provided in the embodiments of this application;

[0079] Figure 12 This is a schematic diagram of the structure of the second electronic device provided in an embodiment of this application;

[0080] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0081] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one or more (including two).

[0082] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0083] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0084] In some embodiments, electronic devices (such as mobile phones, watches, and wristbands) establish a wireless communication connection with a vehicle based on Bluetooth communication technology or SparkLink low energy (SLE) technology. Based on this wireless communication connection, vehicle control can be achieved through a car key function. Optionally, the vehicle establishes a Bluetooth connection with the electronic device, such as a Bluetooth low energy (BLE) connection. Afterward, the vehicle can determine the distance between the electronic device and the vehicle via CS ranging. Optionally, after the vehicle and the electronic device establish an SLE connection, the distance between the electronic device and the vehicle can be determined via SLE measurement (SLEM).

[0085] In this system, the vehicle uses CS ranging or SLEM to measure the distance between electronic devices and the vehicle, thereby enabling the corresponding functions. For example, Figure 1As shown, when the electronic device is located outside the vehicle, the vehicle can automatically unlock if the distance between the electronic device and the vehicle is less than or equal to 2 meters (or other distance thresholds), thus simplifying the unlocking process for the user. Alternatively, if the distance between the electronic device and the vehicle is greater than or equal to 5 meters (or other distance thresholds), the vehicle can automatically lock, thus simplifying the locking process for the user. As another example, when the electronic device is located inside the vehicle, the vehicle can determine the location of the electronic device by detecting the distance between the electronic device and the vehicle, and can provide personalized services to the user, such as adjusting the seat, air conditioning, and entertainment system settings.

[0086] However, CS ranging or SLEM consumes significant air interface resources. If this ranging method is used after the electronic device is inside the vehicle, it will affect the interaction between the electronic device and other devices. For example, it will affect the interaction between the electronic device and the vehicle for audio and voice communication. Furthermore, when the electronic device establishes a wireless communication connection with a keyboard and mouse, CS ranging or SLEM will affect the communication quality of that wireless connection, thus impacting the user experience.

[0087] Furthermore, most vehicles currently have BLE (Browser-Loop) functionality, while only a portion have SLE (Single-Loop) functionality. Therefore, if the electronic device uses an SLE key, it needs to scan both BLE and SLE broadcasts from the vehicle simultaneously to ensure it can also function for vehicles with only BLE functionality, providing a suitable key experience for users of these vehicles. However, simultaneously scanning both BLE and SLE broadcasts increases the power consumption of the electronic device.

[0088] Therefore, this application provides a communication method and an electronic device. The technical solution provided by this application can adaptively switch the ranging mode according to whether the user is on the vehicle, thereby reducing the air interface resources occupied by the ranging function after the user is on the vehicle and avoiding affecting the communication quality of other devices on the vehicle.

[0089] Figure 2 This is a schematic diagram of a communication system in which the communication method provided in the embodiments of this application is applied. Figure 2 As shown, the communication system includes a first electronic device 100 and a second electronic device 200.

[0090] Optionally, the first electronic device 100 may specifically be a vehicle-mounted system (or an in-vehicle terminal), a smart cockpit, a vehicle, or other terminal. The operating system installed on the first electronic device 100 includes, but is not limited to, […]. Alternatively, other operating systems may be used. The first electronic device 100 may also not have an operating system installed. This application embodiment does not limit the specific type of the first electronic device 100, whether an operating system is installed, or the operating system installed.

[0091] Optionally, the second electronic device 200 can be a wearable device such as a smartwatch, smart bracelet, smart ring, or smart glasses; or it can be a mobile terminal device such as a mobile phone, tablet, laptop, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or artificial intelligence (AI) device. The operating system installed on the second electronic device 200 includes, but is not limited to, […]. Alternatively, other operating systems may be used. This application does not limit the specific type of the second electronic device 200 or the operating system installed on it.

[0092] In some embodiments, when a user carries a second electronic device 200 closer to or further away from a first electronic device 100, the first electronic device 100 detects the distance between itself and the second electronic device 200 using a first ranging method. Based on this distance change, the first electronic device 100 determines whether to unlock or lock. For example, if the first electronic device 100 determines that the distance between itself and the second electronic device 200 is less than or equal to a threshold A, such as 3 meters or 2 meters, it can trigger automatic unlocking. Conversely, if the first electronic device 100 determines that the distance between itself and the second electronic device 200 is greater than or equal to a threshold B, such as 5 meters or 6 meters, it can trigger automatic locking.

[0093] In some embodiments, the first electronic device 100 can acquire the status of the vehicle door, such as open or closed. Optionally, the first electronic device 100 can determine whether the second electronic device 200 is located inside the vehicle based on the distance between itself and the second electronic device 200 and the vehicle door status. If the second electronic device 200 is located inside the vehicle, a second ranging method can be triggered to measure the distance between itself and the second electronic device 200. Optionally, the second ranging method can reduce the occupation of air interface resources and reduce power consumption compared to the first ranging method.

[0094] In some embodiments, such as Figure 2 As shown, the communication system described above may further include a server 300. Optionally, the server 300 may be a device or server with computing capabilities, such as a cloud server or a network server. The server 300 may be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.

[0095] In some embodiments, the first electronic device 100 may send its Bluetooth address and StarFlash address to the server 300. Optionally, the second electronic device 200 may download the Bluetooth address and StarFlash address of the first electronic device 100 from the server 300.

[0096] Optionally, the first electronic device 100, the second electronic device 200, and the server 300 in this embodiment can be implemented using different devices. These different devices can have the same, similar, or somewhat different hardware structures, for example... Figure 3 The hardware structure shown.

[0097] For example, the first electronic device 100 has such Figure 3 Taking the hardware structure shown as an example, for Figure 3 The hardware structure shown will be explained.

[0098] like Figure 3 As shown, the first electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a wireless communication module 160, an audio module 170, a sensor module 180, buttons 190, a motor 191, a camera 193, and a display screen 194, etc.

[0099] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the first electronic device 100. In other embodiments of this application, the first electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0100] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0101] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0102] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0103] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0104] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the first electronic device 100. In other embodiments of this application, the first electronic device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.

[0105] The wireless communication function of the first electronic device 100 can be implemented through an antenna, a wireless communication module 160, a modem processor, and a baseband processor.

[0106] Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in the first electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antennas can be multiplexed as diversity antennas for a wireless local area network. In some other embodiments, antennas can be used in conjunction with tuning switches.

[0107] The wireless communication module 160 can provide solutions for wireless communication applications on the first electronic device 100, including BLE, SLE, wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via the antenna.

[0108] In some embodiments, the first electronic device 100 can communicate with a network and other devices via wireless communication technologies. The wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, BLE, SLE, GNSS, WLAN, NFC, FM, and / or IR technologies. The GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), BeiDou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).

[0109] In some embodiments, the first electronic device 100 is configured with a communication node, which can be used to implement communication functions, ranging functions, etc. of the first electronic device 100. Optionally, the communication node includes a communication master node and a communication slave node. The first electronic device 100 can establish a communication connection with other electronic devices (such as the second electronic device 200) through the communication master node and perform ranging to obtain the distance between the second electronic device 200 and the first electronic device 100. After confirming that a communication connection has been established, the communication master node can wake up the communication slave node, trigger the communication slave node to perform ranging, and obtain the ranging data from the communication slave node. In this way, the communication master node can combine multiple ranging data to output a more accurate ranging result.

[0110] Optionally, the wireless communication module 160 of the first electronic device 100 includes at least one communication node for implementing the wireless communication function of the first electronic device 100. For example, the communication nodes configured on the first electronic device 100 may include BLE nodes, SLE nodes, ultra-wideband (UWB) nodes, etc.

[0111] For example, such as Figure 4 As shown, the first electronic device 100 is a vehicle, and the vehicle is equipped with a BLE / SLE master node. Optionally, BLE / SLE slave nodes are also configured at the four corners of the vehicle. Optionally, the BLE / SLE nodes are used to implement the vehicle's Bluetooth / Starlight communication function, ranging function, etc. Optionally, the vehicle may also be equipped with a UWB node. Optionally, the UWB node is used to implement the vehicle's ranging function, positioning function, etc.

[0112] It should be understood that BLE nodes and SLE nodes can be configured in the same or different locations on the vehicle. For example, as Figure 4 As shown, BLE nodes and SLE nodes are configured at the four corners of the vehicle; or, BLE nodes are configured at two corners of the vehicle, and SLE nodes are configured at the other two corners. Another example is configuring BLE nodes but not SLE nodes; or configuring SLE nodes but not BLE nodes.

[0113] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the first electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of the first electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.

[0114] Figure 5 This is a flowchart illustrating a communication method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 5 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0115] S501, the first electronic device 100 is in a locked state and sends a broadcast.

[0116] The locked state refers to the door being closed and locked.

[0117] In some embodiments, when the first electronic device 100 is in a locked state, other electronic devices equipped with car key functionality can automatically unlock the first electronic device 100 through the car key function. Specifically, after the first electronic device 100 establishes a wireless communication connection with other electronic devices, it can automatically unlock itself based on the car key. The first electronic device 100 can then send a broadcast to establish a communication connection with other electronic devices.

[0118] It should be understood that the first electronic device 100 is not limited to sending broadcasts when it is in a locked state. For example, the first electronic device 100 may also send broadcasts when it is in an unlocked state.

[0119] In some embodiments, the first electronic device 100 is configured with BLE nodes and / or SLE nodes to enable wireless communication functionality. Upon startup, the first electronic device 100 can send wireless communication broadcasts to connect to other electronic devices in the vicinity of the first electronic device 100 or within the vehicle.

[0120] Optionally, the first electronic device 100 sends a Bluetooth broadcast to establish a Bluetooth connection with other electronic devices. Optionally, after the Bluetooth connection is established, the first electronic device 100 can obtain the distance between the other electronic devices and the first electronic device 100 through CS ranging.

[0121] It should be understood that the first electronic device 100 can also send a starlight broadcast to establish a starlight connection with other electronic devices. Optionally, after the starlight connection is established, the first electronic device 100 can obtain the distance between itself and other electronic devices via SLEM. The following section describes the process of switching the ranging mode between the first electronic device 100 and the second electronic device 200, taking the establishment of a Bluetooth connection between the first electronic device 100 and the second electronic device 200, and the CS ranging based on the Bluetooth connection as an example. The SLEM process based on the starlight connection can be found in relevant content and will not be elaborated here.

[0122] Optionally, the Bluetooth broadcast may carry information about the first electronic device 100, such as Bluetooth address, Bluetooth name, and name of the first electronic device 100 (e.g., vehicle name).

[0123] S502, during the scanning process, the second electronic device 200 approaches the first electronic device 100.

[0124] In some embodiments, the second electronic device 200 enables Bluetooth and scans for potential Bluetooth broadcasts in the vicinity at regular intervals. Optionally, when a user brings the second electronic device 200 close to the first electronic device 100, the second electronic device 200 may receive a Bluetooth signal broadcast by the first electronic device 100, thereby triggering the establishment of a Bluetooth connection to facilitate subsequent implementation of car key functions such as automatic unlocking.

[0125] S503, the first electronic device 100 and the second electronic device 200 establish a communication connection.

[0126] In some embodiments, both the first electronic device 100 and the second electronic device 200 are configured with BLE nodes. A Bluetooth connection between the first electronic device 100 and the second electronic device 200 can be established through the pairing connection of the BLE nodes between the devices.

[0127] In some examples, the Bluetooth connection establishment process includes at least a pairing process and a connection process. After the first electronic device 100 and the second electronic device 200 enable Bluetooth, they can discover each other via Bluetooth near-field communication. Then, the first electronic device 100 and the second electronic device 200 can enter the pairing process. During the pairing process, the first electronic device 100 can display a randomly generated pairing code, such as a personal identification number (PIN), through interaction with the second electronic device 200. Afterwards, based on user confirmation, the first electronic device 100 (or the second electronic device 200) can determine that the pairing code displayed by both devices is the same, confirming the other device as a trusted device and triggering the connection process. Optionally, during the pairing process, after confirming the correct pairing code based on user operation, the first electronic device 100 can also exchange a security key with the second electronic device 200 through interaction. This security key can be used to encrypt subsequent data transmitted between the first electronic device 100 and the second electronic device 200 via the Bluetooth connection. Thus, the pairing process ensures the security of Bluetooth communication between the first electronic device 100 and the second electronic device 200. Afterwards, once the first electronic device 100 has confirmed that it has completed the pairing process with the second electronic device 200, it can enter the connection process and establish a Bluetooth connection with the second electronic device 200.

[0128] Optionally, after establishing a Bluetooth connection with the second electronic device 200, the first electronic device 100 may save the pairing information of the second electronic device 200. Optionally, the pairing information may include, for example, the device identifier, Bluetooth identifier, Bluetooth address, and other information of the second electronic device 200.

[0129] Optionally, after the first electronic device 100 establishes a Bluetooth connection with the second electronic device 200 for the first time, when the first electronic device 100 and the second electronic device 200 scan for the other device, they can directly initiate the connection process based on the already saved pairing information and trigger the establishment of a Bluetooth connection.

[0130] S504. The first electronic device 100 is in a locked state and performs distance measurement through the first distance measurement method.

[0131] S505, the vehicle is unlocked and the second electronic device 200 is inside the vehicle, the first electronic device 100 switches to the second ranging mode for ranging.

[0132] Compared to the second ranging method, the first ranging method has higher ranging accuracy, but it occupies more air interface resources and has higher power consumption. For example, the first ranging method is CS ranging (or SLEM), and the second ranging method is received signal strength indicator (RSSI) ranging.

[0133] In some embodiments, a Bluetooth connection has been established between the first electronic device 100 and the second electronic device 200. The first electronic device 100 and the second electronic device 200 can transmit wireless signals based on this Bluetooth connection to achieve communication. The first electronic device 100 and / or the second electronic device 200, based on CS ranging technology, can obtain the distance between the devices by using the wavelength of the wireless signal and the channel state. The relationship between the wavelength λ and frequency f of the wireless signal can be described by the speed of light c. For example, the higher the frequency, the shorter the wavelength. During communication, the wireless signal is affected by various factors on the wireless channel, such as path loss, reflection, scattering, and interference. Analyzing these influencing factors allows for the acquisition of channel state information.

[0134] Optionally, in wireless ranging, electronic devices obtain the distance between devices by measuring the phase difference or time delay difference of wireless signals, where the phase difference or time delay difference is directly related to the wavelength. For example, based on the phase difference method, when there is a certain distance between the transmitter and receiver, the propagation of the wireless signal will generate a phase difference. By measuring the phase difference of the wireless signal, the path difference of the wireless signal propagation can be calculated, thereby estimating the distance. As another example, based on the time delay difference method, by measuring the propagation delay of the wireless signal and combining it with the wave speed (i.e., the propagation speed of electromagnetic waves in a medium) and frequency of the wireless signal, the distance between devices can be calculated.

[0135] For example, during communication, the first electronic device 100 communicates with the second electronic device 200 based on the 2.4 GHz (Hz) frequency of Bluetooth communication. This 2.4 GHz frequency has 80 frequency points. The first electronic device 100 can send a wireless signal to the second electronic device 200 at each frequency point, and the second electronic device 200 will also send a corresponding wireless signal back to the first electronic device 100. Therefore, based on the phase difference method described above, the first electronic device 100 can obtain the distance between itself and the second electronic device 200, thus achieving CS ranging.

[0136] In some embodiments, the second ranging method is RSSI ranging. During the propagation of a wireless signal through the air, the signal strength attenuates with increasing propagation distance. Therefore, by measuring the RSSI value, the electronic device can determine the distance between the signal source and the receiving device. The relationship between wireless signal strength and distance is typically non-linear and is affected by environmental factors such as multipath propagation and obstacles.

[0137] For example, a first electronic device 100 sends a wireless signal to a second electronic device 200 and receives a wireless signal fed back by the second electronic device 200. The first electronic device 100 can obtain the distance between the first electronic device 100 and the second electronic device 200 by the change in the RSSI value of the wireless signal between the devices.

[0138] In some embodiments, while the first electronic device 100 is in a locked state, a Bluetooth connection is established with a nearby second electronic device 200. During this process, the second electronic device 200 is located outside the first electronic device 100, such as outside a vehicle. The first electronic device 100 can then measure the distance between itself and the second electronic device 200 using a first ranging method, thereby achieving a more accurate distance measurement result. Subsequently, when the user opens the car door, gets in, and closes the door, the first electronic device 100 can switch to a second ranging method to measure the distance between itself and the second electronic device 200, thereby reducing the occupation of air interface resources, avoiding interference with communication between the second electronic device 200 and other electronic devices in the vehicle, and reducing power consumption.

[0139] For example, the first electronic device 100 can switch the ranging mode from CS ranging to RSSI ranging.

[0140] Once a user gets into the vehicle and closes the door, it indicates that the user will remain inside the vehicle for a certain period of time. Therefore, the first electronic device 100 can switch to the second distance measurement method. Alternatively, the first electronic device 100 can switch to the second distance measurement method simply by determining that the user has boarded the vehicle. Optionally, the first electronic device 100 can determine whether the user has boarded the vehicle based on the distance between it and the second electronic device 200.

[0141] In this way, the ranging mode can be flexibly switched between inside and outside the vehicle, which can meet the ranging requirements while reducing power consumption and improving the rational use of air interface resources.

[0142] Optionally, the first electronic device 100 can detect the open or closed state of the car door through door detection. For example, a sensor is installed on the car door, and the first electronic device 100 can obtain the open / closed state of the car door through the detection data of the sensor, thereby determining whether the user is opening or closing the car door. The sensor may be, for example, a pressure sensor, an electromagnetic induction sensor, or a door magnetic switch (such as a door switch sensor).

[0143] Optionally, the first electronic device 100 can determine whether the user has opened the car door, gotten in, and closed it, and whether the second electronic device 200 (such as a car key) is inside the car, based on the distance between it and the second electronic device 200 and the open / closed state of the car door.

[0144] In some embodiments, the first electronic device 100 can determine whether the second electronic device 200 is inside or outside the vehicle based on the distance between them. Alternatively, the first electronic device 100 can also determine whether the second electronic device 200 is inside or outside the vehicle using other positioning methods. For example, the first electronic device 100 can determine the location of the second electronic device 200 using ultrasonic positioning, GPS positioning, or other methods, thereby determining whether the second electronic device 200 is inside or outside the vehicle.

[0145] For example, the second electronic device 200 is equipped with GPS functionality and is capable of obtaining GPS positioning information. The first electronic device 100 can request this GPS positioning information from the second electronic device 200 to determine the location of the second electronic device 200, thereby determining whether the second electronic device 200 is inside or outside the vehicle. For instance, if the GPS positioning of the second electronic device 200 deviates from that of the first electronic device 100 within a preset threshold (e.g., the distance is less than the preset threshold), it can be determined that the second electronic device 200 is inside the vehicle.

[0146] In this way, the first electronic device 100 can also flexibly determine whether the second electronic device 200 is inside the vehicle in a variety of ways, so as to trigger the switching of the ranging method.

[0147] The following example illustrates various switching scenarios of ranging methods, using the example of the first electronic device 100 determining whether the second electronic device 200 is inside or outside the vehicle based on the distance between the first electronic device 100 and the second electronic device 200.

[0148] In some embodiments, the first electronic device 100 measures the distance to the second electronic device 200 independently. Alternatively, both the first electronic device 100 and the second electronic device 200 measure the distance to the peer device, and the second electronic device 200 sends the measurement result to the first electronic device 100. In this way, by combining the measurement results of the first electronic device 100 and the measurement results of the second electronic device 200, a more accurate distance measurement result between the first electronic device 100 and the second electronic device 200 can be obtained.

[0149] Optionally, when both the first electronic device 100 and the second electronic device 200 are measuring the distance to the peer device, the first electronic device 100 can also instruct the second electronic device 200 to switch its ranging mode or stop ranging after switching the ranging mode. This avoids unnecessary power consumption caused by the second electronic device 200 continuing to use the original ranging mode after the first electronic device 100 switches its ranging mode.

[0150] In some embodiments, connectionless ranging can also be achieved between the first electronic device 100 and the second electronic device 200, meaning that step S503 is optional. For example, in step S502, the second electronic device 200 and the first electronic device 100 scan each other for broadcast signals sent by the other device. Then, the first electronic device 100 can determine the distance change between itself and the second electronic device 200 based on the received broadcast signal strength. Optionally, the first ranging method can also be a connectionless ranging method. For example, when the second electronic device 200 is located outside the vehicle, the first electronic device 100 obtains the distance between itself and the second electronic device 200 using a connectionless CS ranging method. The connectionless CS ranging method includes, for example, determining the distance based on the Bluetooth broadcast signal strength.

[0151] Thus, connectionless ranging can also reduce the occupation of equipment resources and reduce power consumption.

[0152] S506, the vehicle is unlocked and the door is detected to be open, the first electronic device 100 switches to the first ranging mode to measure distance.

[0153] In some embodiments, while a user is carrying the second electronic device 200 in the vehicle, they may need to get out of the vehicle. In this case, the user will unlock the vehicle (e.g., the first electronic device 100) and open the door. Correspondingly, the first electronic device 100 can detect the vehicle unlocking and the door opening. In this situation, the first electronic device 100 switches the ranging method from the second ranging method to the first ranging method. This facilitates obtaining more accurate ranging results subsequently.

[0154] For example, when the first electronic device 100 detects that the vehicle is unlocked and the door is open, it can switch the ranging method from RSSI ranging to CS ranging.

[0155] S507. The first electronic device 100 determines whether it detects that the car door is closed. If yes, proceed to step S505; if no, proceed to step S508.

[0156] S508, the first electronic device 100 continues to measure distance using the first ranging method.

[0157] In some embodiments, after detecting that the vehicle door is open, the first electronic device 100 continues to perform distance measurement using the first distance measurement method. During this process, the first electronic device 100 may detect that the vehicle door is closed. If the first electronic device 100 detects that the vehicle door is closed, there are two possibilities: either the user did not get out of the vehicle and the door was closed, or the user got out of the vehicle and the door was closed. Therefore, in step S507, after detecting that the vehicle door is closed, the first electronic device 100 returns to step S505 to determine whether the second electronic device 200 is inside the vehicle.

[0158] If the second electronic device 200 remains inside the vehicle, the first electronic device 100 can switch its ranging method from the first ranging method back to the second ranging method. For example, the first electronic device 100 can switch its ranging method from CS ranging to RSSI ranging. This satisfies the ranging requirements of the first electronic device 100 while reducing the overhead of air interface resources and power consumption. For instance, if the user carrying the second electronic device 200 does not disembark after the door opens, but other users or no users disembark, the first electronic device 100 can still use RSSI ranging to achieve better communication performance.

[0159] If the second electronic device 200 is outside the vehicle, the first electronic device 100 can continue to perform distance measurement using the first distance measurement method. This allows for obtaining more accurate distance measurement results. For example, the first electronic device 100 can continue to use CS distance measurement to obtain the distance measurement result between the first electronic device 100 and the second electronic device 200.

[0160] Optionally, the first electronic device 100 can determine whether the second electronic device 200 is located inside the vehicle based on the distance measurement result between the first electronic device 100 and the second electronic device 200.

[0161] In this way, the first electronic device 100 can flexibly switch the ranging mode according to whether the second electronic device 200 is inside the vehicle, thereby meeting the ranging requirements while reducing power consumption and improving the reasonable use of the air interface.

[0162] Furthermore, the second electronic device 200 can connect to other Bluetooth devices and flashing devices while functioning as a car key, meeting corresponding scenario requirements. For example, the second electronic device 200 can connect to an audio Bluetooth device, enabling smooth audio playback through that device.

[0163] In some embodiments, in step S506 above, after the first electronic device 100 detects that the vehicle is unlocked and the door is opened, it can switch the second ranging method to the first ranging method. Alternatively, in another implementation, the first electronic device 100 can also determine whether to switch the ranging method based on changes in the distance between itself and the second electronic device 200. For example, if the first electronic device 100, during distance measurement using the second ranging method, finds that the distance between itself and the second electronic device 200 exceeds a preset threshold, it can determine that the second electronic device 200 is not inside the vehicle. Then, the first electronic device 100 can also trigger a switch from the second ranging method to the first ranging method. Alternatively, the first electronic device 100 can trigger a switch from the second ranging method to the first ranging method only after detecting that the vehicle is unlocked, determining that the distance between itself and the second electronic device 200 exceeds the preset threshold. Or, the first electronic device 100 can trigger a switch from the second ranging method to the first ranging method only after detecting that the vehicle is unlocked, the door is open, and determining that the distance between itself and the second electronic device 200 exceeds the preset threshold. In this way, by combining changes in the status of the vehicle door and / or the distance between devices, the ranging method can be flexibly switched.

[0164] For example, the first electronic device 100 determines whether to switch the ranging mode by judging whether the second electronic device 200 is inside the vehicle. For instance, if the first electronic device 100 determines that the second electronic device 200 has moved from outside the vehicle to inside the vehicle, it can switch from the first ranging mode to the second ranging mode. Or, if the first electronic device 100 determines that the second electronic device 200 has moved from inside the vehicle to outside the vehicle, it can switch from the second ranging mode to the first ranging mode.

[0165] In some embodiments, such as Figure 4As shown, the first electronic device 100 can be configured with multiple BLE / SLE nodes. The cooperation between multiple communication nodes (which can be simplified as multiple nodes) can improve the accuracy of the ranging results. For example, after obtaining the ranging result, the slave node can send it to the master node. The master node can then combine the ranging results from both the master node and the slave nodes to output the final ranging result, which has higher accuracy. However, multi-node ranging may generate more power consumption and occupy more air interface resources. Therefore, based on the above description of the flexible switching scenario between the first and second ranging methods, the first electronic device 100 can also flexibly switch between single-node ranging and multi-node ranging depending on whether the second electronic device 200 is located inside the vehicle.

[0166] Optionally, the first ranging method is multi-node ranging, and the second ranging method is single-node ranging. Multi-node ranging refers to ranging through multiple BLE nodes (or SLE nodes), while single-node ranging refers to ranging through a single BLE node (or SLE node), such as the communication master node of the first electronic device 100.

[0167] For example, when the first electronic device 100 and the second electronic device 200 establish a communication connection, and the second electronic device 200 is outside the vehicle and the vehicle is not unlocked, the first electronic device 100 can obtain the distance measurement result through a first ranging method (such as a multi-node ranging method). Subsequently, the vehicle is unlocked, the user opens the door and gets in, and the second electronic device 200 is inside the vehicle, then the first electronic device 100 can obtain the distance measurement result through a second ranging method (such as a single-node ranging method). Afterwards, when the vehicle is unlocked again and the user opens the door, the first electronic device 100 can obtain the distance measurement result through the first ranging method, such as a multi-node ranging method. Afterwards, when the first electronic device 100 detects that the door is closed, if the second electronic device 200 is outside the vehicle, the first electronic device 100 can continue to obtain the distance measurement result through the first ranging method (such as a multi-node ranging method). If the second electronic device 200 is inside the vehicle, the first electronic device 100 can obtain the distance measurement result through the second ranging method (such as a single-node ranging method).

[0168] In this way, the first electronic device 100 can meet the ranging requirements while reducing power consumption and improving the reasonable use of the air interface by flexibly switching between single-node ranging and multi-node ranging.

[0169] Furthermore, the second electronic device 200 can connect to other Bluetooth devices and flashing devices while functioning as a car key, meeting corresponding scenario requirements. For example, the second electronic device 200 can connect to an audio Bluetooth device, enabling smooth audio playback through that device.

[0170] In some embodiments, in conjunction with the above description, the first ranging method is any one or more of the following: CS ranging, SLEM, and multi-node ranging. The second ranging method is RSSI ranging and / or single-node ranging.

[0171] For example, the first ranging method is multi-node CS ranging, and the second ranging method is single-node RSSI ranging. Another example is that the first ranging method is multi-node SLEM, and the second ranging method is single-node SLEM.

[0172] Thus, the multiple flexible implementations of the first and second ranging methods not only save power consumption but also increase the flexibility of switching ranging methods.

[0173] In some embodiments, the first electronic device 100 is equipped with Bluetooth functionality, enabling it to establish Bluetooth connections with other devices. Optionally, with the development of terminal technology, some first electronic devices 100 are equipped with a StarFlash function, enabling them to establish StarFlash connections with other devices. Optionally, in step S502 above, during the process of the second electronic device 200 scanning nearby devices, the second electronic device 200 generally simultaneously enables Bluetooth scanning and StarFlash scanning. This allows the second electronic device 200 to establish a StarFlash connection with the first electronic device 100 if the first electronic device 100 is equipped with the StarFlash function, and also allows the second electronic device 200 to establish a Bluetooth connection with the first electronic device 100 even if the first electronic device 100 is not equipped with the StarFlash function. This satisfies the wireless communication requirements between the second electronic device 200 and the first electronic device 100. However, simultaneously enabling Bluetooth scanning and StarFlash scanning increases the power consumption of the second electronic device 200, affecting its battery life. In this regard, the communication method provided in this application embodiment can first enable Bluetooth scanning to determine whether star flash scanning needs to be enabled, thereby reducing the power consumption of the scanning process. This achieves forward compatibility with scanning a first electronic device 100 that supports Bluetooth functionality, and backward compatibility with newly added first electronic devices 100 that support star flash scanning functionality.

[0174] Figure 6 This is a flowchart illustrating another communication method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 6 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0175] S601, the first electronic device 100 sends the Bluetooth address and / or the Star Flash address to the server 300.

[0176] In some embodiments, the first electronic device 100 is equipped with Bluetooth functionality. Therefore, the first electronic device 100 has a corresponding Bluetooth address, and can send its own Bluetooth address to the server 300.

[0177] Optionally, the first electronic device 100 is equipped with a star flash function. Then, the first electronic device 100 has a corresponding star flash address, and can send its own star flash address to the server 300.

[0178] For example, after its first startup, the first electronic device 100 sends its Bluetooth address and StarFlash address to the server 300. Alternatively, if the first electronic device 100 is not configured with StarFlash functionality, then after its first startup, the first electronic device sends its Bluetooth address to the server 300.

[0179] In some embodiments, the Bluetooth address is used for other devices to establish a Bluetooth connection with the first electronic device 100. Optionally, the StarScan address is used for other devices to establish a StarScan connection with the first electronic device 100.

[0180] S602, the second electronic device 200 sends a request to the server 300 to obtain vehicle information.

[0181] S603, Server 300 sends Bluetooth address and / or Star Flash address to Second Electronic Device 200.

[0182] In some embodiments, the second electronic device 200 is configured with a car key function. When the car key function is activated for the first time, the second electronic device 200 can bind to the corresponding vehicle according to user operation. For example, the second electronic device 200 can send a vehicle information retrieval request to the server 300 to obtain vehicle information.

[0183] Optionally, the vehicle information may include, for example, the Bluetooth address and / or StarFlash address of the first electronic device 100, Bluetooth name, StarFlash name, vehicle name, and other information.

[0184] In some embodiments, the second electronic device 200 saves the Bluetooth address and / or the Star Flash address after obtaining it.

[0185] Optionally, after the second electronic device 200 obtains the Bluetooth address and the Star Flash address, it can save the Bluetooth address and the Star Flash address, as well as the correspondence between the Bluetooth address and the Star Flash address.

[0186] It should be understood that steps S601-S603 above are not strongly bound to the following steps, that is, the second electronic device 200 does not need to request the Bluetooth address and / or Star Flash address of the first electronic device 100 from the server 300 before each scan.

[0187] S604, Second electronic device 200 starts Bluetooth scanning.

[0188] In some embodiments, the second electronic device 200 enables Bluetooth and scans for possible Bluetooth broadcasts in the vicinity at regular intervals to facilitate the establishment of a Bluetooth connection.

[0189] S605a, the first electronic device 100 sends a Bluetooth broadcast.

[0190] S606a, the first electronic device 100 sends a star flash broadcast.

[0191] In some embodiments, when the first electronic device 100 has Bluetooth functionality, it sends Bluetooth broadcasts at regular intervals, allowing other devices to connect to the first electronic device 100 via Bluetooth. When the first electronic device 100 has a star flash function, it sends star flash broadcasts at regular intervals, allowing other devices to connect to the first electronic device 100 via star flash.

[0192] Optionally, the Bluetooth broadcast sent by the first electronic device 100 carries the Bluetooth address of the first electronic device 100.

[0193] Optionally, the star-flash broadcast sent by the first electronic device 100 carries the star-flash address of the first electronic device 100.

[0194] It should be understood that the embodiments of this application do not limit the execution order between steps S604 and steps S605a-S606a. That is, the embodiments of this application do not limit the order in which the second electronic device 200 scans the broadcast and the first electronic device 100 sends the broadcast.

[0195] S607a. If the Bluetooth address in the Bluetooth broadcast is stored on the terminal side, the second electronic device 200 matches the star flash address corresponding to the Bluetooth address.

[0196] In some embodiments, after receiving a Bluetooth broadcast, the first electronic device 100 can obtain the Bluetooth address carried in the Bluetooth broadcast. Then, the second electronic device 200 searches its stored Bluetooth addresses for a Bluetooth address identical to the one carried in the Bluetooth broadcast.

[0197] If it exists, the second electronic device 200 can obtain the corresponding Star Flash address to the Bluetooth address. The Bluetooth address and Star Flash address that have a corresponding relationship belong to the same device, such as the first electronic device 100.

[0198] If the device does not have the Star Flash function, the second electronic device 200 can determine that the device currently sending the Bluetooth broadcast does not have the Star Flash function, and can establish a Bluetooth connection with the device through the obtained Bluetooth address. It should be understood that if the first electronic device 100 does not have the Star Flash function, the first electronic device 100 will not send the Star Flash broadcast, that is, the first electronic device 100 does not need to perform the above step S606a.

[0199] S608, the second electronic device 200 sends a Star Flash Connection Establishment Request to the first electronic device 100.

[0200] S609, the second electronic device 200 and the first electronic device 100 establish a star flash connection.

[0201] In some embodiments, after obtaining the StarScan address, the second electronic device 200 can send a StarScan connection establishment request to the first electronic device 100 through the StarScan address to establish a StarScan connection with the first electronic device 100.

[0202] In some examples, the second electronic device 200 receives a StarScan broadcast sent by the first electronic device 100, which carries a StarScan address. If the second electronic device 200 determines that the StarScan address carried in the StarScan broadcast is the same as the StarScan address matched by the second electronic device 200 via Bluetooth address matching, it can establish a StarScan connection with the first electronic device 100 through that StarScan address.

[0203] Optionally, during the process of the second electronic device 200 requesting the establishment of a StarScan connection with the first electronic device 100 directly based on the StarScan address found through Bluetooth address lookup, the second electronic device 200 may also enable the StarScan scanning function.

[0204] In other embodiments, after the second electronic device 200 finds the Star Flash address of the first electronic device 100 via Bluetooth address, it starts Star Flash scanning. After the scanned Star Flash broadcast carries an address that is the same as the Star Flash address found on the end side, it can trigger the first electronic device 100 corresponding to the Star Flash address to establish a Star Flash connection.

[0205] In this way, the second electronic device 200 does not need to enable star flash scanning by default, reducing the power consumption of star flash scanning. Furthermore, the second electronic device 200 can quickly determine the star flash broadcast sent by the first electronic device 100 based on the star flash address found on the end side, improving the efficiency of star flash connection establishment.

[0206] In addition, the first electronic device 100 automatically uploads its Bluetooth address and / or Star Flash address to the server 300, so that the second electronic device 200 can flexibly obtain the Bluetooth address and / or Star Flash address of the first electronic device 100.

[0207] In some scenarios, a star flash indicator is added to the Bluetooth broadcast sent by the first electronic device 100 to indicate that the first electronic device 100 has a star flash function, making it easier for the second electronic device 200 to distinguish whether the device sending the Bluetooth broadcast has a star flash function. Furthermore, updating the broadcast content ensures backward compatibility with the first electronic device 100, which only has Bluetooth functionality.

[0208] Optionally, such as Figure 7 As shown, the above steps S605a-S607a can be implemented as the following steps S605b-S607b.

[0209] S605b, the first electronic device 100 sends a Bluetooth broadcast, which carries a first star flash indicator.

[0210] The first star flash indicator is used to indicate that the first electronic device 100 has a star flash function.

[0211] S606b, the first electronic device 100 sends a star flash broadcast.

[0212] S607b, If the acquired Bluetooth broadcast carries a first star flash indicator and the terminal side stores the Bluetooth address in the Bluetooth broadcast, the second electronic device 200 matches the star flash address corresponding to the Bluetooth address.

[0213] In some embodiments, the second electronic device 200 receives a Bluetooth broadcast sent by the first electronic device 100 and obtains the Bluetooth address carried therein, as well as a first star flash indicator that may be carried therein.

[0214] In some examples, the second electronic device 200 determines that the first electronic device 100 has a star flash function based on the first star flash indication carried in the Bluetooth broadcast. Then, the second electronic device 200 can obtain the Bluetooth address and star flash address stored on the device side, and search for the star flash address that corresponds to the Bluetooth address carried in the Bluetooth broadcast. Afterwards, the second electronic device 200 can send a star flash connection establishment request to the first electronic device 100 based on the found star flash address to establish a star flash connection with the first electronic device 100.

[0215] Optionally, the second electronic device 200 receives a StarScan broadcast sent by the first electronic device 100, which carries a StarScan address. If the second electronic device 200 determines that the StarScan address carried in the StarScan broadcast is the same as the StarScan address obtained by the second electronic device 200 through Bluetooth address matching, it can establish a StarScan connection with the first electronic device 100 through the StarScan address.

[0216] Optionally, after the second electronic device 200 finds the Star Flash address of the first electronic device 100 via Bluetooth address, it starts Star Flash scanning. After scanning the Star Flash address found on the device side, it can trigger the first electronic device 100 corresponding to the Star Flash address to establish a Star Flash connection.

[0217] In other examples, the second electronic device 200 determines that the first electronic device 100 does not have a star flash function based on the first star flash indication not carried in the Bluetooth broadcast. Then, the second electronic device 200 can establish a Bluetooth connection with the first electronic device 100 based on the Bluetooth address carried in the Bluetooth broadcast.

[0218] In this way, the second electronic device 200 does not need to enable star flash scanning by default, reducing the power consumption of star flash scanning. Furthermore, the second electronic device 200 can quickly determine the star flash broadcast sent by the first electronic device 100 based on the star flash address found on the end side, improving the efficiency of star flash connection establishment.

[0219] Furthermore, the process of determining whether the first electronic device 100 has a star flash function is simplified by using the first star flash indicator.

[0220] In some scenarios, the first electronic device 100 carries a random private address (RPA) in its sent StarBlink broadcast. The RPA enhances device privacy and improves communication security. Optionally, the first electronic device 100 dynamically generates the RPA according to a preset period. Subsequently, when the second electronic device 200 receives the StarBlink broadcast from the first electronic device 100, it cannot verify the authenticity of the first electronic device 100's identity based on the RPA carried within, thus failing to establish a StarBlink connection. Therefore, adding a StarBlink indicator to the Bluetooth broadcast sent by the first electronic device 100 to instruct it to send an RPA allows the second electronic device 200 to distinguish whether the device sending the Bluetooth broadcast has StarBlink functionality and whether the sent StarBlink address is a random address. Furthermore, updating the broadcast content ensures backward compatibility with first electronic devices 100 that only have Bluetooth functionality, and makes the communication method provided in this embodiment applicable to random address scenarios.

[0221] Optionally, such as Figure 8 As shown, the above steps S605a-S607a can also be implemented as the following steps S605c-S607c.

[0222] S605c, the first electronic device 100 sends a Bluetooth broadcast, which carries a second star flash indicator.

[0223] The second star flash indicator is used to indicate that the first electronic device 100 has a star flash function and that the star flash address carried in the star flash broadcast sent is RPA.

[0224] S606c, the first electronic device 100, sends a starlight broadcast.

[0225] S607c, When the second star flash indicator is carried in the acquired Bluetooth broadcast, the second electronic device 200 starts star flash scanning of the target content.

[0226] In some embodiments, in step S602 above, the second electronic device 200 requests vehicle information from the server 300. In step S603, the information fed back by the server 300 to the second electronic device 200 may include not only the Bluetooth address and / or the Star Flash address, but also information related to the Star Flash function of the first electronic device 100, such as the Star Flash name.

[0227] In some embodiments, the second electronic device 200 receives a Bluetooth broadcast sent by the first electronic device 100 and obtains the Bluetooth address carried therein, as well as a possible second star flash indicator.

[0228] In some examples, the second electronic device 200 determines, based on the second StarScan instruction carried in the Bluetooth broadcast, that the first electronic device 100 has StarScan functionality and that the StarScan address carried in the StarScan broadcast is RPA. Then, the second electronic device 200 can initiate StarScan scanning of target content, which could be, for example, information obtained by the second electronic device 200 related to the StarScan functionality of the first electronic device 100, such as the StarScan name. Thus, after scanning the target content, the second electronic device 200 can determine that a first electronic device 100 is nearby, and a StarScan connection to be established.

[0229] Optionally, the second electronic device 200 can obtain the Bluetooth address and the Star Flash address stored on the end side, and search for the Star Flash address that corresponds to the Bluetooth address carried in the Bluetooth broadcast.

[0230] Optionally, if the second electronic device 200 scans the target content, the second electronic device 200 may establish a StarScan connection with the first electronic device 100 based on the target content. Alternatively, if the second electronic device 200 scans the target content, the second electronic device 200 may send a StarScan connection establishment request to the first electronic device 100 based on the found StarScan address, in order to establish a StarScan connection with the first electronic device 100.

[0231] In other examples, the second electronic device 200 determines that the first electronic device 100 does not have a star flash function based on a second star flash indicator not carried in the Bluetooth broadcast. Then, the second electronic device 200 can establish a Bluetooth connection with the first electronic device 100 based on the Bluetooth address carried in the Bluetooth broadcast.

[0232] Thus, through the second star flash indicator, the second electronic device 200 and the first electronic device 100 establish a star flash connection in a random address scenario.

[0233] It should be understood that the above description, using the example of the second electronic device 200 scanning Bluetooth broadcasts to determine whether the first electronic device 100 has StarFlash capability and establishing a StarFlash connection, exemplifies the process of establishing a wireless communication connection between the first electronic device 100 and the second electronic device 200. It should also be understood that the second electronic device 200 can also scan StarFlash broadcasts to determine whether the first electronic device 100 has Bluetooth capability to establish a Bluetooth connection. Alternatively, with the development of communication technology, the first electronic device 100 may possess more communication capabilities. In this case, the second electronic device 200 can also scan Bluetooth broadcasts, StarFlash broadcasts, or other broadcasts to determine the communication capabilities that the first electronic device 100 may possess to establish a wireless communication connection between the devices. For specific implementation methods, please refer to the above embodiments; this application will not elaborate further.

[0234] Figure 9 This is a flowchart illustrating another communication method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 9 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0235] S901, when the second electronic device is located outside the vehicle, the first electronic device obtains the distance between itself and the second electronic device through a first ranging method.

[0236] S902, when the second electronic device is located inside the vehicle, the first electronic device obtains the distance between itself and the second electronic device using a second ranging method.

[0237] The second ranging method has lower ranging accuracy than the first ranging method. The first ranging method consumes more power than the second ranging method. The first ranging method consumes more air interface resources than the second ranging method.

[0238] It should be understood that the execution order of steps S901 and S902 is not limited in the embodiments of this application. For example, the switching of the ranging mode of the first electronic device can be triggered after the user gets on or off the vehicle with the second electronic device.

[0239] In this way, the ranging mode can be flexibly switched between inside and outside the vehicle, which can meet the ranging requirements while reducing power consumption and improving the rational use of air interface resources.

[0240] The first ranging method is any one or more of the following: Bluetooth channel detection ranging, star flash low power access technology ranging, multi-node ranging; the second ranging method is received signal strength indication ranging and / or single-node ranging.

[0241] For example, the first ranging method is multi-node CS ranging, and the second ranging method is single-node RSSI ranging. Another example is that the first ranging method is multi-node SLEM, and the second ranging method is single-node SLEM.

[0242] Thus, the multiple flexible implementations of the first and second ranging methods not only save power consumption but also increase the flexibility of switching ranging methods.

[0243] In some embodiments, after the first electronic device obtains the distance between itself and the second electronic device using the second ranging method, the distance between itself and the second electronic device is obtained using the first ranging method after the door is detected to be open.

[0244] In one scenario, after the car door opens, the user may need to get out of the vehicle. In this case, the first electronic device switches the ranging method from the second ranging method back to the first ranging method. This facilitates obtaining more accurate ranging results subsequently.

[0245] In some embodiments, after a door is opened, it is detected that the door is then closed. If the second electronic device is inside the vehicle, the distance to the second electronic device is obtained using a second ranging method. If the second electronic device is outside the vehicle, the distance to the second electronic device is obtained using a first ranging method.

[0246] For example, after detecting that a car door is open, the first electronic device performs distance measurement using a first ranging method. During this process, the first electronic device may detect that the car door is closed. If the first electronic device detects that the car door is closed, there are two possibilities: First, the user closes the door without exiting the vehicle, in which case the second electronic device is still inside the vehicle, and the first electronic device can switch the ranging method back to the second ranging method. This satisfies the ranging requirements of the first electronic device while reducing the occupation of air interface resources and power consumption. Second, the user exits the vehicle and closes the door, in which case the second electronic device is outside the vehicle, and the first electronic device can continue to perform distance measurement using the first ranging method. This achieves more accurate ranging results.

[0247] In this way, the ranging method can be flexibly adjusted based on user needs and actual conditions.

[0248] In some embodiments, the first electronic device determines whether the distance between itself and the second electronic device is less than or equal to a first threshold. If the distance between the first electronic device and the second electronic device is less than or equal to the first threshold, it is determined that the second electronic device is located inside the vehicle.

[0249] In this way, determining whether the second electronic device is located inside the vehicle by measuring distance makes it easier to decide whether the ranging method needs to be adjusted.

[0250] In some embodiments, determining whether the distance between the first electronic device and the second electronic device is less than or equal to a first threshold includes: the first electronic device determining whether the distance between the first electronic device and the second electronic device is less than or equal to the first threshold by any one or more of a first ranging method, a second ranging method, a connectionless ranging method, ultrasonic positioning, and global satellite positioning.

[0251] For example, before the first electronic device and the second electronic device establish a communication connection, the distance between the devices can be obtained through connectionless ranging, thereby determining the ranging method.

[0252] For example, the first electronic device can obtain the GPS positioning results of the second electronic device, thereby determining the distance between them.

[0253] For example, the first electronic device uses ultrasonic positioning to determine the position of the second electronic device, thereby determining the distance between them.

[0254] For example, in the process of obtaining the distance between the first electronic device and the second electronic device through the first ranging method or the second ranging method, the first electronic device can determine the change in the distance between the second electronic device and the first electronic device.

[0255] In this way, the first electronic device can also flexibly determine whether the second electronic device is inside the vehicle in a variety of ways, so as to trigger the switching of the ranging method.

[0256] In some embodiments, a first electronic device transmits a first broadcast based on a first wireless communication technology. The first broadcast carries at least one of the following: a first address of the first electronic device based on the first wireless communication technology; a first indication indicating that the first electronic device supports a second wireless communication technology; and a second indication indicating that the second address carried in the broadcast transmitted by the first electronic device based on the second wireless communication technology is a random address. The first broadcast is used to establish a wireless communication connection with the second electronic device based on the second wireless communication technology.

[0257] The first wireless communication technology is, for example, Bluetooth communication technology, and the second wireless communication technology is, for example, StarScan communication technology.

[0258] In this way, the second electronic device can establish a star-flash connection with the first electronic device by receiving a Bluetooth broadcast (such as the first broadcast) sent by the first electronic device. This eliminates the need for the second electronic device to have star-flash scanning enabled by default, reducing the power consumption of star-flash scanning.

[0259] In some examples, the first electronic device may perform ranging using a first ranging method or a second ranging method based on a communication connection with the second electronic device.

[0260] In other examples, the distance between the first and second electronic devices can be obtained based on a connectionless ranging method.

[0261] In some embodiments, before obtaining the distance to the second electronic device, the first electronic device sends to the server a first communication address based on a first wireless communication technology and a second communication address based on a second wireless communication technology.

[0262] The first wireless communication address is, for example, the Bluetooth address of the first electronic device, and the second wireless communication address is, for example, the Star Flash address of the first electronic device.

[0263] Among them, the first wireless communication address and the second wireless communication address are the actual communication addresses of the first electronic device.

[0264] In this way, the first electronic device automatically uploads its Bluetooth address and / or Star Flash address to the server, which makes it easier for the second electronic device to flexibly obtain the Bluetooth address and / or Star Flash address of the first electronic device and establish a Bluetooth connection or Star Flash connection.

[0265] The above example illustrates the interaction scenario between the first and second electronic devices, using the example of the first electronic device switching its ranging method based on the position of the second electronic device. In other scenarios, the second electronic device can also execute the relevant interaction steps performed by the first electronic device.

[0266] For example, if the second electronic device is located outside the vehicle, and the distance between the second and first electronic devices is determined to be less than or equal to a threshold A (e.g., 3 meters, 2 meters) using a first ranging method or another ranging method (e.g., a connectionless ranging method), an unlock instruction can be sent to the first electronic device to trigger its automatic unlocking. Alternatively, if the second electronic device determines that the distance between it and the first electronic device is greater than or equal to a threshold B (e.g., 5 meters, 6 meters), a lock instruction can be sent to the first electronic device to trigger its automatic locking.

[0267] For example, when the second electronic device is located outside the vehicle, it uses a first ranging method to obtain the distance to the first electronic device. When the second electronic device is located inside the vehicle, it uses a second ranging method to obtain the distance to the first electronic device. In other words, the second electronic device can automatically switch ranging methods depending on whether it is located inside or outside the vehicle.

[0268] The implementation method of the second electronic device executing the relevant interactive steps executed by the first electronic device can be referred to the above embodiments, and will not be described one by one in the embodiments of this application.

[0269] Figure 10 This is a flowchart illustrating another communication method provided in an embodiment of this application. It should be noted that this method does not rely on... Figure 10 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0270] S1001, The second electronic device receives the first broadcast sent by the first electronic device based on the first wireless communication technology.

[0271] The first wireless communication technology is, for example, Bluetooth communication technology, and the second wireless communication technology is, for example, StarScan communication technology.

[0272] For example, the first electronic device sends a Bluetooth broadcast. Correspondingly, the second electronic device can receive the Bluetooth broadcast sent by the first electronic device during Bluetooth scanning.

[0273] In some embodiments, before receiving a first broadcast sent by a first electronic device, a second electronic device downloads and saves a first communication address and a second communication address of the first electronic device from a server. The first communication address corresponds to a first wireless communication technology, and the second communication address corresponds to a second wireless communication technology.

[0274] The first wireless communication address is, for example, the Bluetooth address of the first electronic device, and the second wireless communication address is, for example, the Star Flash address of the first electronic device.

[0275] Among them, the first wireless communication address and the second wireless communication address are the actual communication addresses of the first electronic device.

[0276] In this way, the second electronic device can obtain the real communication address uploaded by the first electronic device from the server, which simplifies the process of establishing a communication connection between the second electronic device and the first electronic device.

[0277] S1002, The second electronic device acquires the first information carried in the first broadcast.

[0278] The first information includes at least one of the following: a first address of the first electronic device based on the first wireless communication technology; a first indication for indicating that the first electronic device supports the second wireless communication technology; and a second indication for indicating that the second address carried in the broadcast sent by the first electronic device based on the second wireless communication technology is a random address.

[0279] The first wireless communication technology is Bluetooth communication technology, and the second wireless communication technology is StarFlash communication technology.

[0280] For example, the Bluetooth broadcast sent by the first electronic device carries the Bluetooth address of the first electronic device.

[0281] As another example, if the first electronic device supports the Star Flash function, a first indication for indicating that the first electronic device supports the Star Flash function can be carried in the transmitted Bluetooth broadcast.

[0282] As another example, the first electronic device carries a random starlight address in the starlight broadcast it sends. Then, the first electronic device can carry a second indication in the Bluetooth broadcast it sends, indicating that the starlight address carried in the starlight broadcast it sends is a random address.

[0283] Thus, by implementing the first information in multiple ways, it is convenient for the second electronic device to flexibly establish a communication connection with the second electronic device based on the second wireless communication connection technology.

[0284] S1003. The second electronic device establishes a communication connection with the first electronic device based on the first information and the second wireless communication technology.

[0285] In this way, the second electronic device does not need to enable scanning based on the second wireless communication technology by default, and can also establish a communication connection based on the second wireless communication technology based on the first wireless communication technology, thereby reducing the power consumption of scanning based on the second wireless communication technology.

[0286] In some embodiments, the first information includes a first address of the first electronic device based on a first wireless communication technology. The second electronic device establishes a communication connection with the first electronic device based on a second wireless communication technology according to the first information, including: the second electronic device acquiring at least one pair of locally stored communication addresses. Each pair of communication addresses corresponds to the first wireless communication technology and the second wireless communication technology, respectively. If a first communication address exists in the at least one pair of communication addresses that is identical to the first address, the second electronic device acquires the second communication address corresponding to the first communication address. The second electronic device then establishes a communication connection with the first electronic device based on the second communication address.

[0287] For example, the second electronic device can download the Bluetooth address and the StarScan address of the first electronic device from the server. The second electronic device can then save the Bluetooth address and the StarScan address, as well as the correspondence between them.

[0288] Referring to the relevant content described in steps S605a-S607a above, the second electronic device can match the Star Flash address of the first electronic device on the terminal side based on the obtained Bluetooth address. Therefore, the second electronic device can establish a Star Flash connection with the first electronic device based on this Star Flash address.

[0289] In this way, the second electronic device does not need to enable star flash scanning by default, reducing the power consumption of star flash scanning. Furthermore, the second electronic device can quickly determine the star flash broadcast sent by the first electronic device based on the star flash address found on the end side, improving the efficiency of star flash connection establishment.

[0290] In other embodiments, the second electronic device establishes a communication connection with the first electronic device based on a second wireless communication technology according to the first information, including: if the first information includes a first indication, the second electronic device obtains a first address included in the first information, the first indication being used to indicate that the first electronic device supports the second wireless communication technology. From at least one pair of communication addresses stored locally, the second electronic device obtains a second communication address corresponding to the first communication address that is the same as the first address. The second electronic device establishes a communication connection with the first electronic device based on the second communication address.

[0291] Referring to the relevant content described in steps S605b-S607b above, the second electronic device can determine that the first electronic device supports the Star Flash function based on the acquired first instruction. Then, the second electronic device can match the Star Flash address of the first electronic device on the terminal side based on the acquired Bluetooth address. Thus, the second electronic device can establish a Star Flash connection with the first electronic device based on this Star Flash address.

[0292] In this way, the second electronic device does not need to enable star flash scanning by default, reducing the power consumption of star flash scanning. Furthermore, the second electronic device can quickly determine the star flash broadcast sent by the first electronic device based on the star flash address found on the end side, improving the efficiency of star flash connection establishment.

[0293] Furthermore, the process of determining whether a first electronic device has a star flash function is simplified by using the first star flash indicator.

[0294] In some other embodiments, the second electronic device establishes a communication connection with the first electronic device based on a second wireless communication technology, according to the first information. This includes: if the first information includes a second indication, the second electronic device scans broadcasts transmitted based on the second wireless communication technology to obtain a second broadcast transmitted by the first electronic device, wherein the second broadcast carries target content, and the second indication is used to indicate that the second address carried in the broadcast transmitted by the first electronic device based on the second wireless communication technology is a random address. From at least one pair of communication addresses stored locally, the second electronic device obtains a second communication address corresponding to the first communication address that is the same as the first address included in the first information. The second electronic device then establishes a communication connection with the first electronic device based on the second communication address.

[0295] The target content could be, for example, the name of the StarSpark communication device of the first electronic device.

[0296] Referring to the relevant content described in steps S605c-S607c above, the second electronic device can determine, based on the acquired second instruction, that the Star Flash address carried in the Star Flash broadcast sent by the first electronic device is a random address. Therefore, the second electronic device can discover the first electronic device by scanning other target content. For example, the second electronic device can determine the presence of the first electronic device nearby by scanning its Star Flash name. Then, the second electronic device can establish a Star Flash connection with the first electronic device by matching its Star Flash address on the terminal side. Alternatively, the second electronic device can directly establish a Star Flash connection with the first electronic device using its Star Flash name.

[0297] Thus, through the second instruction, a starlight connection is established between the second electronic device and the first electronic device in a random address scenario.

[0298] In some embodiments, after the second electronic device establishes a communication connection with the first electronic device, this communication connection is used to allow the first electronic device, which is a vehicle or a processing module within a vehicle, to obtain the distance between itself and the second electronic device when the second electronic device is located outside the vehicle, using a first ranging method corresponding to the communication connection. The communication connection is also used to allow the first electronic device to obtain the distance between itself and the second electronic device when the second electronic device is located inside the vehicle, using a second ranging method corresponding to the communication connection. The ranging accuracy of the second ranging method is less than that of the first ranging method.

[0299] The first ranging method is any one or more of the following: Bluetooth channel detection ranging, star flash low power access technology ranging, multi-node ranging; the second ranging method is received signal strength indication ranging and / or single-node ranging.

[0300] In this way, the ranging mode can be flexibly switched between inside and outside the vehicle, which can meet the ranging requirements while reducing power consumption and improving the rational use of air interface resources.

[0301] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described herein. In addition, it should be noted that the process details involved in one embodiment of this document are similarly applicable to other embodiments, or different embodiments may be combined.

[0302] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments.

[0303] Furthermore, the various method embodiments can be implemented individually or in combination.

[0304] The above example illustrates the interaction scenario between the first and second electronic devices, using the example of a second electronic device establishing a StarFlash connection with the first electronic device based on a Bluetooth broadcast received from the first electronic device. In other scenarios, the first electronic device can also execute the relevant interaction steps performed by the second electronic device.

[0305] For example, the second electronic device reports its Bluetooth address and / or StarScan address to the server. Then, after receiving the Bluetooth broadcast from the second electronic device, the first electronic device can determine whether to establish a StarScan connection with the second electronic device based on the first information carried within it, thereby reducing the power consumption of the first electronic device scanning the StarScan broadcast.

[0306] The specific implementation methods for the first electronic device to execute the relevant interactive steps executed by the second electronic device can be referred to the above embodiments, and will not be described one by one in the embodiments of this application.

[0307] The above combination Figures 5-10 The communication method provided in the embodiments of this application is described in detail below. Figure 11 and Figure 12 This application provides a detailed description of the first electronic device and the second electronic device provided in its embodiments.

[0308] In one possible design, Figure 11 This is a schematic diagram of the structure of a first electronic device provided in an embodiment of this application. Figure 11 As shown, the first electronic device 1100 may include a processing unit 1101 and a transceiver unit 1102. The first electronic device 1100 can be used to implement the functions of the first electronic device 100 (such as a vehicle or a processing unit in a vehicle) involved in the above method embodiments.

[0309] Optionally, the processing unit 1101 is used to support the first electronic device 1100 in performing [operations]. Figure 5 S504, S505, S506, S507, and S508; and / or, for supporting the first electronic device 1100 in performing... Figure 9 S901 and S902 in the example.

[0310] Optionally, the transceiver unit 1102 is used to support the first electronic device 1100 in performing... Figure 5 S501 and S503 in the above; and / or, for supporting the first electronic device 1100 to perform Figure 6 S601, S605a, S606a, S608, and S609; and / or, for supporting the first electronic device 1100 in performing... Figure 7 S605b and S606b in the above; and / or, for supporting the first electronic device 1100 to perform Figure 8 S605c and S606c; and / or, for supporting the first electronic device 1100 to perform Figure 10 S1001 and S1003 in the example.

[0311] Optionally, the transceiver unit 1102 may include a receiving unit and a transmitting unit, which may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the first electronic device 1100 are respectively to implement the corresponding process of the communication method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, it will not be repeated here.

[0312] Optionally, Figure 11 The first electronic device 1100 shown may also include a storage unit ( Figure 11 (not shown in the image), this storage unit stores a program or instruction. When the processing unit 1101 and the transceiver unit 1102 execute the program or instruction, it causes... Figure 11 The first electronic device 1100 shown can perform the communication method described in the above method embodiments.

[0313] Figure 11 The technical effects of the first electronic device 1100 shown can be referred to the technical effects of the communication method described in the above method embodiments, and will not be repeated here.

[0314] In addition to being in the form of the first electronic device 1100, the technical solution provided in this application may also be a functional unit or chip in the first electronic device, or a device used in conjunction with the first electronic device.

[0315] In one possible design, Figure 12 This is a schematic diagram of the structure of the second electronic device provided in an embodiment of this application. Figure 12 As shown, the second electronic device 1200 may include a processing unit 1201 and a transceiver unit 1202. The second electronic device 1200 can be used to implement the functions of the second electronic device 100 (such as a mobile phone, wearable device, etc.) involved in the above method embodiments.

[0316] Optionally, the processing unit 1201 is used to support the execution of the second electronic device 1200. Figure 5 S502 in; and / or, for supporting the second electronic device 1200 to perform Figure 6 S604 and S607a; and / or, for supporting the second electronic device 1200 to perform Figure 7 S607b; and / or, for supporting the second electronic device 1200 to perform Figure 8 S607c; and / or, for supporting the second electronic device 1200 to perform Figure 10 S1002 in the middle.

[0317] Optionally, the transceiver unit 1202 is used to support the second electronic device 1200 in performing [operations]. Figure 5S501 and S503 in the above; and / or, for supporting the second electronic device 1200 to perform Figure 6 S602, S603, S605a, S606a, S608, and S609; and / or, for supporting the second electronic device 1200 in performing... Figure 7 S605b and S606b in the above; and / or, for supporting the second electronic device 1200 to perform Figure 8 S605c and S606c in the above; and / or, for supporting the second electronic device 1200 to perform Figure 10 S1001 and S1003 in the example.

[0318] Optionally, the transceiver unit 1202 may include a receiving unit and a transmitting unit, which may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the second electronic device 1200 are respectively to implement the corresponding process of the communication method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, it will not be repeated here.

[0319] Optionally, Figure 12 The second electronic device 1200 shown may also include a storage unit ( Figure 12 (not shown in the image), this storage unit stores a program or instruction. When the processing unit 1201 and the transceiver unit 1202 execute the program or instruction, it causes... Figure 12 The second electronic device 1200 shown can perform the communication method described in the above method embodiments.

[0320] Figure 12 The technical effects of the second electronic device 1200 shown can be referred to the technical effects of the communication method described in the above method embodiments, and will not be repeated here.

[0321] In addition to being in the form of a second electronic device 1200, the technical solution provided in this application may also be a functional unit or chip in a second electronic device, or a device used in conjunction with a second electronic device.

[0322] Figure 13 Another exemplary structure of an electronic device is shown. For example... Figure 13 As shown, the electronic device 1300 includes: a processor 1301, a memory 1302, and a transceiver 1303.

[0323] Optionally, the electronic device 1300 can be such as Figure 11 The first electronic device 1100 shown, or as... Figure 12 The second electronic device 1200 shown.

[0324] The processor 1301 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.

[0325] Transceiver 1303 is used for communication with other devices. In this embodiment, transceiver 1303 may be a module, circuit, bus, interface, or other device capable of communication functions, used for communication with other devices. Optionally, transceiver 1303 may be a standalone transmitter, used to send information to other devices, or it may be a standalone receiver, used to receive information from other devices. Transceiver 1303 may also be a component that integrates sending and receiving information functions; this embodiment does not limit the specific implementation of transceiver 1303.

[0326] The memory 1302 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via communication lines. The memory may also be integrated with the processor.

[0327] The memory 1302 stores computer execution instructions for implementing the solutions of this application, and its execution is controlled by the processor 1301. The processor 1301 executes the computer execution instructions stored in the memory 1302, thereby implementing the communication method provided in the following embodiments of this application.

[0328] Optionally, the computer execution instructions in the embodiments of this application may also be referred to as application code, instructions, computer program or other names, and the embodiments of this application do not specifically limit them.

[0329] In a specific implementation, as one example, processor 1301 may include one or more CPUs.

[0330] In a specific implementation, as one embodiment, the electronic device 1300 may include multiple processors. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0331] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 1300. In other embodiments of this application, the electronic device 1300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0332] This application also provides a chip system, including: a processor coupled to a memory, the memory being used to store programs or instructions, wherein when the program or instructions are executed by the processor, the chip system implements the methods in any of the above method embodiments.

[0333] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0334] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.

[0335] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0336] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.

[0337] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run on a computer, it causes the computer to perform the aforementioned steps to implement the communication method described in the above embodiments.

[0338] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the communication method described in the above embodiments.

[0339] In addition, this application also provides an apparatus. Specifically, the apparatus may be a component or module, and may include one or more processors and a memory connected together. The memory is used to store a computer program. When the computer program is executed by one or more processors, the apparatus performs the communication methods described in the above-described method embodiments.

[0340] The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0341] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an application-specific integrated circuit (ASIC).

[0342] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the division of the above functional modules is only used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0343] In the several embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of modules or units may be electrical, mechanical or other forms.

[0344] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0345] Computer-readable storage media include, but are not limited to, any of the following: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media capable of storing program code.

[0346] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A communication method, characterized in that, Applied to a first electronic device, wherein the first electronic device is a vehicle or a processing module in the vehicle, the method includes: When the second electronic device is located outside the vehicle, the first electronic device obtains the distance between itself and the second electronic device using a first ranging method; When the second electronic device is located inside the vehicle, the first electronic device obtains the distance between itself and the second electronic device using a second ranging method; The ranging accuracy of the second ranging method is less than that of the first ranging method.

2. The method according to claim 1, characterized in that, After the first electronic device obtains the distance between itself and the second electronic device using the second ranging method, the method further includes: After detecting that the car door is open, the distance between the device and the second electronic device is obtained using the first ranging method.

3. The method according to claim 2, characterized in that, The method further includes: The car door was detected as closed; When the second electronic device is located inside the vehicle, the distance between the device and the second electronic device is obtained using the second ranging method; When the second electronic device is located outside the vehicle, the distance between the device and the second electronic device is obtained using the first ranging method.

4. The method according to any one of claims 1-3, characterized in that, The first ranging method is any one or more of the following: Bluetooth channel detection ranging, star-flash low-power access technology ranging, and multi-node ranging; the second ranging method is received signal strength indication ranging and / or single-node ranging.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: The first electronic device determines whether the distance between itself and the second electronic device is less than or equal to a first threshold. If the distance between the first electronic device and the second electronic device is less than or equal to a first threshold, it is determined that the second electronic device is located inside the vehicle.

6. The method according to claim 5, characterized in that, The first electronic device determines whether the distance between itself and the second electronic device is less than or equal to a first threshold, including: The first electronic device determines whether the distance between itself and the second electronic device is less than or equal to a first threshold by using one or more of the first ranging method, the second ranging method, the connectionless ranging method, ultrasonic positioning, and global satellite positioning.

7. The method according to any one of claims 1-6, characterized in that, Prior to obtaining the distance to the second electronic device, the method further includes: A first broadcast is sent based on a first wireless communication technology, and the first broadcast carries at least one of the following: a first indication that the first electronic device supports a second wireless communication technology based on a first address of the first wireless communication technology; and a second indication that the second address carried in the broadcast sent by the first electronic device based on the second wireless communication technology is a random address. The first broadcast is used to establish a wireless communication connection with the second electronic device based on the second wireless communication technology.

8. The method according to any one of claims 1-7, characterized in that, Prior to obtaining the distance to the second electronic device, the method further includes: The first communication address of the first electronic device based on the first wireless communication technology and the second communication address based on the second wireless communication technology are sent to the server.

9. A communication method, characterized in that, Applied to a second electronic device, the method includes: Receive a first broadcast sent by a first electronic device, wherein the first broadcast is a broadcast sent by the first electronic device based on a first wireless communication technology; Obtain the first information carried in the first broadcast; Based on the first information, a communication connection is established with the first electronic device using the second wireless communication technology; Wherein, the communication connection is used so that when the second electronic device is located outside the vehicle, the first electronic device obtains the distance between itself and the second electronic device through a first ranging method corresponding to the communication connection, wherein the first electronic device is the vehicle or a processing module in the vehicle; The communication connection is further configured to allow the first electronic device to obtain the distance between itself and the second electronic device via a second ranging method corresponding to the communication connection when the second electronic device is located inside the vehicle; wherein the ranging accuracy of the second ranging method is less than that of the first ranging method.

10. The method according to claim 9, characterized in that, The first information includes at least one of the following: a first indication that the first electronic device supports the second wireless communication technology based on a first address of the first wireless communication technology; and a second indication that the second address carried in a broadcast sent by the first electronic device based on the second wireless communication technology is a random address.

11. The method according to claim 9 or 10, characterized in that, The first information includes a first address of the first electronic device based on the first wireless communication technology; the step of establishing a communication connection with the first electronic device based on the first information using a second wireless communication technology includes: Obtain at least one pair of communication addresses stored locally, wherein each pair of communication addresses corresponds to the first wireless communication technology and the second wireless communication technology respectively; If a first communication address that is the same as the first address exists in the at least one pair of communication addresses, obtain the second communication address corresponding to the first communication address; The communication connection is established with the first electronic device based on the second communication address.

12. The method according to any one of claims 9-11, characterized in that, The step of establishing a communication connection with the first electronic device based on the first information using the second wireless communication technology includes: If the first information includes a first indication, obtain the first address included in the first information, wherein the first indication is used to indicate that the first electronic device supports the second wireless communication technology; From at least one pair of communication addresses stored locally, obtain the second communication address corresponding to the first communication address that is the same as the first address; The communication connection is established with the second electronic device based on the second communication address.

13. The method according to claim 9 or 10, characterized in that, The step of establishing a communication connection with the first electronic device based on the first information using the second wireless communication technology includes: When the first information includes the second indication, scan the broadcast sent based on the second wireless communication technology to obtain the second broadcast sent by the first electronic device, the target content carried in the second broadcast, and the second indication is used to indicate that the second address carried in the broadcast sent by the first electronic device based on the second wireless communication technology is a random address; From at least one pair of communication addresses stored locally, obtain the second communication address corresponding to the first communication address that is the same as the first address included in the first information; The communication connection is established with the second electronic device based on the second communication address.

14. The method according to any one of claims 9-13, characterized in that, Prior to receiving the first broadcast sent by the first electronic device, the method further includes: The first communication address and the second communication address of the first electronic device are downloaded from the server and saved. The first communication address corresponds to the first wireless communication technology, and the second communication address corresponds to the second wireless communication technology.

15. The method according to any one of claims 9-14, characterized in that, The first ranging method is any one or more of the following: Bluetooth channel detection ranging, star-flash low-power access technology ranging, and multi-node ranging; the second ranging method is received signal strength indication ranging and / or single-node ranging.

16. An electronic device, characterized in that, include: A processor and a memory, the memory being coupled to the processor, the memory being used to store computer program code, the computer program code including computer instructions, which, when the processor reads the computer instructions from the memory, cause the electronic device to perform the method as described in any one of claims 1-8; or cause the electronic device to perform the method as described in any one of claims 9-15.

17. A vehicle, characterized in that, include: The electronic device as claimed in claim 16.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when executed on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-8; or causes the electronic device to perform the method as described in any one of claims 9-15.

19. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-8; or, causes the computer to perform the method as described in any one of claims 9-15.