Method and apparatus for controlling welcoming of vehicle, medium, device, and vehicle
A method for controlling a vehicle welcoming to a user, includes: recognizing, by a processor of the vehicle, an identification (ID) of a target vehicle key; searching, by the processor, a correspondence for a welcoming manner corresponding to the ID of the target vehicle key, the correspondence comprising a plurality of IDs of a plurality of vehicle keys and a plurality of welcoming manners corresponding to the IDs of the vehicle keys; and controlling, by the processor, the vehicle to perform a first welcoming action in the welcoming manner.
1 . A method for controlling a vehicle welcoming a user, comprising:
detecting, by a processor of the vehicle, a first distance between a target vehicle key and the vehicle with a first ranging method, pairing the vehicle with the target vehicle key through a wireless communication, and recognizing an identification (ID) of the target vehicle key through asymmetric encryption;
searching, by the processor, a correspondence for a welcoming manner corresponding to the ID of the target vehicle key, the correspondence comprising a plurality of IDs of a plurality of vehicle keys and a plurality of welcoming manners corresponding to the IDs of the vehicle keys;
detecting, by the processor, a second distance between the target vehicle key and the vehicle with a second ranging method, and controlling the vehicle to perform a first welcoming action in the welcoming manner, wherein a measurement precision of the second ranging method is higher than a measurement precision of the first ranging method; and
obtaining, by the processor, a charging status of the vehicle, and determining whether the charging status of the vehicle is greater than a charging status threshold, wherein the charging status threshold is for determining whether to execute an additional welcoming action corresponding to the ID of the target vehicle key, the charging status is a remaining state of charge of the vehicle, and the welcoming manner comprises configurations of lights, music, or pedal stretching/retraction functions according to the ID of the target vehicle key.
2 . The method according to claim 1 , wherein recognizing the ID of the target vehicle key comprises:
communicating with the target vehicle key and recognizing the ID of the target vehicle key when a distance between the target vehicle key and the vehicle is less than a first threshold.
3 . The method according to claim 2 , wherein communicating with the target vehicle key and recognizing the ID of the target vehicle key comprises:
communicating with the target vehicle key through wireless communication, and connecting to and pairing with the target vehicle key;
receiving a public key and ciphertext sent by the target vehicle key, wherein the target vehicle key generates a public-private key pair, encrypts the ID of the target vehicle key by using a private key of the public-private key pair to obtain the ciphertext, and sends the ciphertext and the public key of the public-private key pair to the vehicle; and
decrypting the ciphertext based on the public key to obtain the ID of the target vehicle key.
4 . The method according to claim 2 , wherein after the recognizing the ID of the target vehicle key,
the detecting a second distance between the target vehicle key and the vehicle with a second ranging method comprises:
in response to that the first distance is less than a second threshold, detecting the second distance between the target vehicle key and the vehicle with the second ranging method; and
controlling the vehicle to perform a first welcoming action in the welcoming manner comprises:
in response to that the second distance is less than a third threshold, controlling the vehicle to perform the first welcoming action in the welcoming manner, wherein the first threshold is greater than the second threshold, and the second threshold is greater than the third threshold.
5 . The method according to claim 4 , further comprising:
obtaining an ambient volume of an environment where the vehicle is located;
in response to that the second distance is less than the third threshold and the ambient volume is less than a volume threshold, obtaining a voice instruction around the vehicle;
in response to that the second distance is less than a fourth threshold and the ambient volume is greater than or equal to the volume threshold, obtaining the voice instruction around the vehicle, the fourth threshold being less than the third threshold; and
controlling the vehicle to perform a second welcoming action indicated in the voice instruction around the vehicle.
6 . The method according to claim 1 , further comprising:
obtaining a control instruction sent by the target vehicle key; and
controlling the vehicle to perform a third welcoming action indicated in the control instruction in response to that the charging status of the vehicle is greater than the charging status threshold, wherein the additional welcoming action comprises the third welcoming action.
7 . The method according to claim 5 , further comprising: detecting orientation information of the target vehicle key relative to the vehicle; wherein:
the obtaining a voice instruction around the vehicle comprises: obtaining an orientation corresponding to the orientation information from a plurality of orientations around the vehicle, and obtaining a voice instruction for the orientation corresponding to the orientation information.
8 . The method according to claim 5 , further comprising: detecting orientation information of the target vehicle key relative to the vehicle; wherein:
the obtaining a voice instruction around the vehicle comprises: obtaining a voice instruction in each of a plurality of orientations around the vehicle to obtain a voice instruction set, and obtaining a welcoming action corresponding to each of the voice instructions in the voice instruction set; and
the controlling the vehicle to perform a second welcoming action indicated in the voice instruction around the vehicle comprising:
determining whether a welcoming action corresponding to a first voice instruction in the voice instruction set conflicts with the second welcoming action indicated in the voice instruction around the vehicle for an orientation corresponding to the orientation information;
in response to that the welcoming action corresponding to the first voice instruction in the voice instruction set conflicts with the second welcoming action indicated in the voice instruction around the vehicle for the orientation corresponding to the orientation information, deleting the first voice instruction in the voice instruction set to obtain an updated voice instruction set; and
controlling the vehicle to perform a welcoming action indicated in each of the voice instructions in the updated voice instruction set.
9 . A non-transitory computer-readable storage medium, storing a computer program, wherein when the computer program is executed by a processor, the computer program causes the processor to perform operations comprising:
detecting a first distance between a target vehicle key and the vehicle with a first ranging method, pairing the vehicle with the target vehicle key through a wireless communication, and recognizing an identification (ID) of the target vehicle key through asymmetric encryption;
searching a correspondence for a welcoming manner corresponding to the ID of the target vehicle key, the correspondence comprising a plurality of IDs of a plurality of vehicle keys and a plurality of welcoming manners corresponding to the IDs of the vehicle keys;
detecting a second distance between the target vehicle key and the vehicle with a second ranging method, and controlling a vehicle to perform a first welcoming action in the welcoming manner, wherein a measurement precision of the second ranging method is higher than a measurement precision of the first ranging method; and
obtaining a charging status of the vehicle, and determining whether the charging status of the vehicle is greater than a charging status threshold, wherein the charging status threshold is for determining whether to execute an additional welcoming action corresponding to the ID of the target vehicle key, the charging status is a remaining state of charge of the vehicle, and the welcoming manner comprises configurations of lights, music, or pedal stretching/retraction functions according to the ID of the target vehicle key.
10 . The medium according to claim 9 , wherein recognizing the ID of the target vehicle key comprises:
communicating with the target vehicle key and recognizing the ID of the target vehicle key when a distance between the target vehicle key and the vehicle is less than a first threshold.
11 . The medium according to claim 10 , wherein communicating with the target vehicle key and recognizing the ID of the target vehicle key comprises:
communicating with the target vehicle key through wireless communication, and connecting to and pairing with the target vehicle key;
receiving a public key and ciphertext sent by the target vehicle key, wherein the target vehicle key generates a public-private key pair, encrypts the ID of the target vehicle key by using a private key of the public-private key pair to obtain the ciphertext, and sends the ciphertext and the public key of the public-private key pair to the vehicle; and
decrypting the ciphertext based on the public key to obtain the ID of the target vehicle key.
12 . The medium according to claim 10 , wherein after the recognizing the ID of the target vehicle key,
the operations further comprise:
in response to that the first distance is less than a second threshold, detecting the second distance between the target vehicle key and the vehicle with the second ranging method; and
controlling the vehicle to perform a first welcoming action in the welcoming manner comprises:
in response to that the second distance is less than a third threshold, controlling the vehicle to perform the first welcoming action in the welcoming manner, wherein the first threshold is greater than the second threshold, and the second threshold is greater than the third threshold.
13 . The medium according to claim 12 , wherein the operations further comprise:
obtaining an ambient volume of an environment where the vehicle is located;
in response to that the second distance is less than the third threshold and the ambient volume is less than a volume threshold, obtaining a voice instruction around the vehicle;
in response to that the second distance is less than a fourth threshold and the ambient volume is greater than or equal to the volume threshold, obtaining the voice instruction around the vehicle, the fourth threshold being less than the third threshold; and
controlling the vehicle to perform a second welcoming action indicated in the voice instruction around the vehicle.
14 . The medium according to claim 9 , wherein the operations further comprise:
obtaining a control instruction sent by the target vehicle key; and
controlling the vehicle to perform a third welcoming action indicated in the control instruction in response to that the charging status of the vehicle is greater than the charging status threshold, wherein the additional welcoming action comprises the third welcoming action.
15 . The medium according to claim 13 , wherein the operations further comprise: detecting orientation information of the target vehicle key relative to the vehicle; wherein:
the obtaining a voice instruction around the vehicle comprises: obtaining an orientation corresponding to the orientation information from a plurality of orientations around the vehicle, and obtaining a voice instruction for the orientation corresponding to the orientation information.
16 . The medium according to claim 13 , wherein the operations further comprise:
detecting an orientation information of the target vehicle key relative to the vehicle; wherein:
the obtaining a voice instruction around the vehicle comprises: obtaining a voice instruction in each of a plurality of orientations around the vehicle to obtain a voice instruction set, and obtaining a welcoming action corresponding to each of the voice instructions in the voice instruction set; and
the controlling the vehicle to perform a second welcoming action indicated in the voice instruction around the vehicle comprising:
determining whether a welcoming action corresponding to a first voice instruction in the voice instruction set conflicts with the second welcoming action indicated in the voice instruction around the vehicle for an orientation corresponding to the orientation information;
in response to that the welcoming action corresponding to the first voice instruction in the voice instruction set conflicts with the second welcoming action indicated in the voice instruction around the vehicle for the orientation corresponding to the orientation information, deleting the first voice instruction in the voice instruction set to obtain an updated voice instruction set; and
controlling the vehicle to perform a welcoming action indicated in each of the voice instructions in the updated voice instruction set.
17 . A vehicle, comprising an apparatus for controlling welcoming a user of the vehicle, wherein the apparatus comprises a storage medium storing a computer program, wherein when the computer program is executed by a processor, the computer program causes the processor to perform operations comprising:
detecting a first distance between a target vehicle key and the vehicle with a first ranging method, pairing the vehicle with the target vehicle key through a wireless communication, and recognizing an identification (ID) of the target vehicle key through asymmetric encryption;
searching a correspondence for a welcoming manner corresponding to the ID of the target vehicle key, the correspondence comprising a plurality of IDs of a plurality of vehicle keys and a plurality of welcoming manners corresponding to the IDs of the vehicle keys;
detecting a second distance between the target vehicle key and the vehicle with a second ranging method, and controlling the vehicle to perform a first welcoming action in the welcoming manner, wherein a measurement precision of the second ranging method is higher than a measurement precision of the first ranging method; and
obtaining, by the processor, a charging status of the vehicle, and determining whether the charging status of the vehicle is greater than a charging status threshold, wherein the charging status threshold is for determining whether to execute an additional welcoming action corresponding to the ID of the target vehicle key, the charging status is a remaining state of charge of the vehicle, and the welcoming manner comprises configurations of lights, music, or pedal stretching/retraction functions according to the ID of the target vehicle key.
18 . The vehicle according to claim 17 , wherein recognizing the ID of the target vehicle key comprises:
communicating with the target vehicle key and recognizing the ID of the target vehicle key when a distance between the target vehicle key and the vehicle is less than a first threshold.
19 . The vehicle according to claim 18 , wherein communicating with the target vehicle key and recognizing the ID of the target vehicle key comprises:
communicating with the target vehicle key through wireless communication, and connecting to and pairing with the target vehicle key;
receiving a public key and ciphertext sent by the target vehicle key, wherein the target vehicle key generates a public-private key pair, encrypts the ID of the target vehicle key by using a private key of the public-private key pair to obtain the ciphertext, and sends the ciphertext and the public key of the public-private key pair to the vehicle; and
decrypting the ciphertext based on the public key to obtain the ID of the target vehicle key.
20 . The vehicle according to claim 18 , wherein after the recognizing the ID of the target vehicle key,
the operations further comprise:
in response to that the first distance is less than a second threshold, detecting the second distance between the target vehicle key and the vehicle with the second ranging method; and
controlling the vehicle to perform a first welcoming action in the welcoming manner comprises:
in response to that the second distance is less than a third threshold, controlling the vehicle to perform the first welcoming action in the welcoming manner, wherein the first threshold is greater than the second threshold, and the second threshold is greater than the third threshold.