Method and device for sharing digital vehicle key, computer equipment and storage medium
1. A method for sharing digital car keys is applied to an intelligent lock, and is characterized by comprising the following steps:
if an authorization request is detected, sending the authorization request to a main intelligent device so that the main intelligent device authorizes a non-main intelligent device;
if a registration request sent by the non-master intelligent device is received, acquiring authorization information of the master intelligent device, and registering the non-master intelligent device;
if the registration of the non-master intelligent device is finished, requesting a non-owner public key from the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state;
if the non-owner public key in the first encryption state is received, decrypting the non-owner public key to obtain the non-owner public key;
encrypting the intelligent lock public key according to the non-owner public key to obtain an intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state;
and sending authorization success information to the non-master intelligent device according to the vehicle key certificate in the first encryption state.
2. The method of claim 1, wherein the step of sending an authorization success message to the non-master smart device according to the vehicle key certificate in the first encrypted state comprises:
if an unlocking request sent by the non-master intelligent device is detected, sending verification information to the non-master intelligent device so that the non-master intelligent device sends the vehicle key certificate according to the verification information;
verifying the vehicle key certificate;
and if the verification is successful, the intelligent lock is opened.
3. The method of claim 2, wherein the authentication information includes first authentication information and second authentication information, and the step of sending the authentication information to the non-master smart device to enable the non-master smart device to send the vehicle key certificate according to the authentication information if the unlocking request sent by the non-master smart device is detected includes:
generating a first random verification code, encrypting the first random verification code according to the intelligent lock public key to obtain first verification information, and sending the first verification information to the non-master intelligent device so that the non-master intelligent device obtains the first random verification code through the first verification information, encrypts the first random verification code to obtain intermediate verification information, and sends the intermediate verification information;
decrypting the intermediate authentication information to authenticate the first random authentication code and generating a second random authentication code;
and encrypting the second random verification code according to the intelligent lock public key to obtain second verification information and sending the second verification information to the non-master intelligent device so that the non-master intelligent device obtains the second random verification code through the second verification information and encrypts and sends the second random verification code and the vehicle key certificate.
4. The method of claim 2, wherein the step of unlocking the smart lock if the verification is successful comprises:
judging whether the distance between the non-main intelligent equipment and the non-main intelligent equipment is smaller than a preset distance or not;
and if the distance is smaller than the preset distance, the intelligent lock is unlocked.
5. The method of claim 1, wherein the step of enabling the master smart device to authorize the non-master smart device comprises:
if a sharing authorization request sent by the non-main intelligent device is detected, sending information of the non-main intelligent device to a vehicle owner to acquire authorization information, wherein the authorization information comprises an authorizer and an authorization mode;
and sending the authorization information, the intelligent lock public key and the vehicle key certificate encrypted by the vehicle owner public key to the non-master intelligent device to complete authorization of the non-master intelligent device.
6. The method of claim 1, wherein the step of causing the non-master smart device to decrypt and verify the smart lock public key and send the vehicle key certificate in a first encrypted state comprises:
decrypting the intelligent lock public key in the first encryption state according to a non-owner private key to obtain the intelligent lock public key;
verifying the public key of the intelligent lock;
if the verification is successful, generating a security code;
and encrypting the vehicle key certificate and the security code according to the intelligent lock public key to obtain a vehicle key certificate in a first encryption state and a security code in the first encryption state, and sending the vehicle key certificate in the first encryption state and the security code in the first encryption state.
7. The method of claim 6, wherein the step of sending an authorization success message to the non-master smart device according to the vehicle key certificate in the first encrypted state comprises:
decrypting the vehicle key certificate in the first encryption state and the security code in the first encryption state according to a private key of an intelligent lock to obtain the vehicle key certificate and the security code;
verifying the vehicle key certificate;
if the verification is successful, the security code is encrypted according to the non-vehicle owner public key to obtain the security code in a first encryption state and the security code is sent to the non-main intelligent device, so that the non-main intelligent device verifies the security code to complete authorization of the non-main intelligent device.
8. A shared digital car key device, the device comprising:
the first request unit is used for sending an authorization request to a main intelligent device to enable the main intelligent device to authorize non-main intelligent devices if the authorization request is detected;
the first registration unit is used for acquiring the authorization information of the main intelligent device and registering the non-main intelligent device if a registration request sent by the non-main intelligent device is received;
the second request unit is used for requesting a non-owner public key to the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state if the registration of the non-master intelligent device is completed;
the first decryption unit is used for decrypting the non-owner public key in the first encryption state to obtain the non-owner public key if the non-owner public key in the first encryption state is received;
the first encryption unit is used for encrypting the intelligent lock public key according to the non-owner public key to obtain the intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state;
and the first sending unit is used for sending authorization success information to the non-main intelligent equipment according to the vehicle key certificate in the first encryption state.
9. A computer device, comprising a memory and a processor coupled to the memory; the memory is used for storing a computer program; the processor is adapted to run a computer program stored in the memory to perform the steps of the method according to any of claims 1-7.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7 on a smart device having a capacitive touch screen.
Background
At present, the switch lock and the ignition of a motorcycle or an electric vehicle (two-wheel vehicle) can be operated by using a vehicle key, the traditional vehicle key can be unlocked and ignited only by physically contacting the motorcycle or the electric vehicle, although a few operations for realizing the switch lock and the ignition through wireless control are already carried out, a physical vehicle key is still needed, however, the motorcycle and the electric vehicle are used as a convenient vehicle, the requirement that the motorcycle or the electric vehicle needs to be lent to relatives, friends or colleagues exists in daily use, the existing lending mode is to lend the vehicle key to people needing to use the vehicle, namely, the distance between a vehicle owner and the person borrowing the vehicle is required to be closer, certain risks exist, and the inconvenience is very high.
Disclosure of Invention
The embodiment of the invention provides a method and a device for sharing a digital car key, computer equipment and a storage medium, which can share the digital car key to other intelligent equipment, so that the intelligent equipment can unlock an intelligent lock, and the convenience is improved.
In a first aspect, an embodiment of the present invention provides a method for sharing digital car keys, where the method specifically includes: if an authorization request is detected, sending the authorization request to a main intelligent device so that the main intelligent device authorizes a non-main intelligent device;
if a registration request sent by the non-master intelligent device is received, acquiring authorization information of the master intelligent device, and registering the non-master intelligent device;
if the registration of the non-master intelligent device is finished, requesting a non-owner public key from the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state;
if the non-owner public key in the first encryption state is received, decrypting the non-owner public key to obtain the non-owner public key;
encrypting the intelligent lock public key according to the non-owner public key to obtain an intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state;
and sending authorization success information to the non-master intelligent device according to the vehicle key certificate in the first encryption state.
In a second aspect, an embodiment of the present invention further provides a device for sharing digital car keys, where the device specifically includes: the first request unit is used for sending an authorization request to a main intelligent device to enable the main intelligent device to authorize non-main intelligent devices if the authorization request is detected;
the first registration unit is used for acquiring the authorization information of the main intelligent device and registering the non-main intelligent device if a registration request sent by the non-main intelligent device is received;
the second request unit is used for requesting a non-owner public key to the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state if the registration of the non-master intelligent device is completed;
the first decryption unit is used for decrypting the non-owner public key in the first encryption state to obtain the non-owner public key if the non-owner public key in the first encryption state is received;
the first encryption unit is used for encrypting the intelligent lock public key according to the non-owner public key to obtain the intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state;
and the first sending unit is used for sending authorization success information to the non-main intelligent equipment according to the vehicle key certificate in the first encryption state.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The embodiment of the invention provides a method, a device, computer equipment and a storage medium for sharing digital car keys, wherein the method comprises the following steps: if an authorization request is detected, sending the authorization request to a main intelligent device so that the main intelligent device authorizes a non-main intelligent device; if a registration request sent by the non-master intelligent device is received, acquiring authorization information of the master intelligent device, and registering the non-master intelligent device; if the registration of the non-master intelligent device is finished, requesting a non-owner public key from the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state; if the non-owner public key in the first encryption state is received, decrypting the non-owner public key to obtain the non-owner public key; encrypting the intelligent lock public key according to the non-owner public key to obtain an intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state; and sending authorization success information to the non-master intelligent device according to the vehicle key certificate in the first encryption state. The embodiment of the invention authorizes the non-master intelligent device through the master intelligent device when detecting the authorization request, thereby enabling the non-master intelligent device and the intelligent lock to be registered, acquiring authorization information through registering the non-master intelligent device, and finally completing authorization of the non-master intelligent device through verifying the non-master intelligent device and the intelligent lock, thereby enabling the non-master intelligent device to unlock the intelligent lock.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for sharing a digital car key according to an embodiment of the present invention;
fig. 2 is a schematic sub-flow diagram of a method for sharing a digital car key according to an embodiment of the present invention
Fig. 3 is a schematic sub-flow chart of a method for sharing a digital car key according to an embodiment of the present invention;
fig. 4 is a schematic sub-flow chart of a method for sharing a digital car key according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for sharing a digital car key according to another embodiment of the present invention;
fig. 6 is a schematic sub-flow chart of a method for sharing a digital car key according to another embodiment of the present invention;
fig. 7 is a schematic sub-flow chart of a method for sharing a digital car key according to another embodiment of the present invention;
FIG. 8 is a schematic block diagram of a digital vehicle key sharing apparatus provided by an embodiment of the present invention;
fig. 9 is a schematic block diagram of an authorization request unit of a digital car key sharing device according to an embodiment of the present invention
Fig. 10 is a schematic block diagram of a first encryption unit of the digital car key sharing device according to the embodiment of the present invention;
fig. 11 is a schematic block diagram of a first transmitting unit of the digital car key sharing device according to the embodiment of the present invention;
FIG. 12 is a schematic block diagram of a digital car key sharing apparatus according to another embodiment of the present invention;
fig. 13 is a schematic block diagram of a fifth transmitting unit of the digital car key sharing device according to another embodiment of the present invention;
fig. 14 is a schematic block diagram of a first starting unit of a digital car key sharing device according to another embodiment of the present invention;
fig. 15 is a schematic block diagram of an intelligent device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a method for sharing a digital car key according to an embodiment of the present invention. The method for sharing the digital car key can be applied to the intelligent lock of the motorcycle or the electric car. The method of the invention not only can carry out the locking and unlocking and ignition operations on the motorcycle or the electric vehicle through the digital vehicle key, but also can share the digital vehicle key to other equipment, so that other users can also carry out the locking and unlocking and ignition operations on the motorcycle or the electric vehicle through the digital vehicle key.
S110, if an authorization request is detected, the authorization request is sent to a main intelligent device so that the main intelligent device can authorize the non-main intelligent device.
In the embodiment of the present invention, the master smart device generally refers to a smart device bound by a vehicle owner and a motorcycle or an electric vehicle (hereinafter, described as an electric vehicle), and the non-master smart device generally refers to a smart device that needs to obtain authorization from the master smart device due to a lease relationship with the vehicle owner. When a user needs to rent the electric vehicle, the user can scan the two-dimensional code on the electric vehicle through the mobile phone to send an authorization request to the intelligent lock of the electric vehicle. The intelligent lock is a lock arranged in the electric vehicle and used for controlling the opening and closing of the electric vehicle and ignition.
In some embodiments, such as this embodiment, as shown in FIG. 2, the step S110 may include steps S111-S112.
And S111, if the sharing authorization request sent by the non-main intelligent device is detected, sending the information of the non-main intelligent device to a vehicle owner to acquire the authorization information, wherein the authorization information comprises an authorizer and an authorization mode.
In the embodiment of the invention, the non-master intelligent device sends an authorization request to the intelligent lock by scanning the two-dimensional code, the intelligent lock can send information to the non-master intelligent device after receiving the authorization request, so that the non-master intelligent device sends the authorization request to the intelligent lock cloud platform, the intelligent lock cloud platform sends the authorization request to the master intelligent device, and the master intelligent device can remind the vehicle owner of the device request authorization after receiving the authorization request and inquire whether the vehicle owner authorizes the vehicle owner or not and an authorization mode, wherein the authorization mode can comprise authorization according to times and authorization according to time, for example, the authorization is cancelled after the unlocking times are successful, or the authorization is cancelled after a certain time. . The intelligent lock cloud platform is used as an intermediate platform between the non-master intelligent device and the master intelligent device, so that the master intelligent device and the non-master intelligent device can exchange information through the intelligent lock cloud platform.
And S112, sending the authorization information, the intelligent lock public key and the vehicle key certificate encrypted by the vehicle owner public key to the non-master intelligent device to complete authorization of the non-master intelligent device.
In the embodiment of the invention, after the main intelligent device obtains the authorization information, the vehicle key certificate is encrypted through the vehicle owner public key, and the intelligent lock public key, the encrypted vehicle key certificate and the authorization information are sent to the non-main intelligent device. The intelligent lock comprises an intelligent lock private key, and can open information encrypted by the intelligent lock public key.
And S120, if a registration request sent by the non-master intelligent device is received, acquiring authorization information of the master intelligent device, and registering the non-master intelligent device.
In the embodiment of the present invention, after obtaining the authorization information of the master smart device, the non-master smart device sends a connection request, which may be a bluetooth connection request, to the smart lock, so as to complete the connection with the smart lock. After the connection is completed, the non-master smart device sends a registration request to the smart lock to facilitate the smart lock to register the authorization information. After the intelligent lock registers the non-main intelligent device according to the authorization information, the ID of the authorized device, what the authorization mode is and the ID of the authorized device can be known, so that subsequent verification is facilitated to complete authorization.
S130, if the registration of the non-master intelligent device is completed, requesting a non-owner public key from the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state.
In the embodiment of the invention, after the registration of the non-master intelligent device is completed, the intelligent lock already acquires the authorization information at the moment, but the non-master intelligent device also already acquires the vehicle key certificate and the intelligent lock public key encrypted by the vehicle owner public key, and then the intelligent lock public key needs to verify the vehicle key certificate so as to confirm the authenticity of the vehicle key certificate. The first step of the verification process is to request a non-owner public key from the non-master intelligent device, the non-master intelligent device corresponds to a non-owner public key after obtaining the authorization information, the non-owner public key is generated by the non-master intelligent device, the non-owner public keys of all the non-master intelligent devices are different, after the non-master intelligent device receives the request of the all-love intelligent lock, the non-owner public key is encrypted by the intelligent lock to generate a non-owner public key in a first encryption state, and the non-owner public key in the first encryption state is sent to the intelligent lock.
S140, if the non-owner public key in the first encryption state is received, decrypting the non-owner public key to obtain the non-owner public key.
In the embodiment of the present invention, after receiving the non-owner public key in the first encryption state, the intelligent lock decrypts the non-owner public key to obtain the non-owner public key, for example, the non-owner intelligent device encrypts the non-owner public key through the intelligent lock public key to obtain the non-owner public key in the first encryption state, and the intelligent lock decrypts the intelligent lock private key through the intelligent lock private key to obtain the non-owner public key.
S150, encrypting the intelligent lock public key according to the non-vehicle owner public key to obtain the intelligent lock public key in the second encryption state, and sending the intelligent lock public key to the non-main intelligent device so that the non-main intelligent device decrypts and verifies the intelligent lock public key and sends the vehicle key certificate in the first encryption state.
In the embodiment of the invention, after the intelligent lock obtains the non-owner public key, the intelligent lock encrypts the intelligent lock public key through the non-owner public key to obtain the intelligent lock public key in the second encryption state, and sends the intelligent lock public key to the non-master intelligent equipment. After the non-master intelligent device receives the intelligent lock public key in the second encryption state, the intelligent lock public key in the second encryption state is encrypted through the non-owner public key, so that the non-master intelligent device can decrypt the intelligent lock public key in the second encryption state through the non-owner private key to obtain the intelligent lock public key, verify the intelligent lock public key and the intelligent lock public key stored on the device, encrypt the vehicle key certificate encrypted by the owner public key through the intelligent lock public key to obtain the vehicle key certificate in the first encryption state after verification is error-free, and send the vehicle key certificate in the first encryption state to the intelligent lock.
In some embodiments, such as this embodiment, as shown in FIG. 3, the step S150 may include steps S151-S154.
And S151, decrypting the intelligent lock public key in the first encryption state according to the non-owner private key to obtain the intelligent lock public key.
In the embodiment of the invention, the non-main intelligent device comprises the non-owner public key and the non-owner private key, and the information encrypted by the non-owner public key can be decrypted by the non-owner private key. In the embodiment of the invention, the intelligent lock public key in the first encryption state is decrypted by the non-owner private key to obtain the intelligent lock public key, and the intelligent lock public key is sent by the intelligent lock and can be verified with the intelligent lock public key stored in the non-owner intelligent device so as to improve the safety.
S152, verifying the public key of the intelligent lock.
In the embodiment of the present invention, the smart lock public key in the first encryption state sent by the smart lock may be different from the smart lock public key acquired by the non-master smart device from the master smart device, and therefore, verification is required to confirm the association between the smart lock and the non-master smart device.
And S153, if the verification is successful, generating a security code.
In the embodiment of the present invention, after the verification is successful, it indicates that the smart lock is associated with the non-master smart device, and then the non-master smart device generates a security code for the verification in the subsequent steps.
S154, encrypting the vehicle key certificate and the security code according to the public key of the intelligent lock to obtain the vehicle key certificate in the first encryption state and the security code in the first encryption state, and sending the vehicle key certificate in the first encryption state and the security code in the first encryption state.
In the embodiment of the invention, after the security code is generated, the security code and the vehicle key certificate which is obtained from the main intelligent device in advance and encrypted by the vehicle owner public key are encrypted by the intelligent lock public key to obtain the vehicle key certificate in the first encryption state and the security code in the first encryption state, and the vehicle key certificate and the security code are sent to the intelligent lock.
And S160, sending authorization success information to the non-main intelligent equipment according to the vehicle key certificate in the first encryption state.
In the embodiment of the invention, after receiving the car key certificate in the first encryption state, the intelligent lock decrypts the car key certificate through the intelligent lock private key to obtain the car key certificate, the intelligent lock comprises an intelligent lock public key and an intelligent lock private key, the car key certificate is verified through the two pieces of information, when the verification is successful, the information of successful authorization can be sent to the non-master intelligent device, and the non-master intelligent device can feed back the information to inform the master intelligent device through the intelligent lock cloud platform after receiving the information of successful authorization.
In some embodiments, such as this embodiment, as shown in FIG. 4, the step S160 may include steps S161-S163.
S161, decrypting the vehicle key certificate in the first encryption state and the security code in the first encryption state according to the private key of the smart lock to obtain the vehicle key certificate and the security code.
And S162, verifying the vehicle key certificate.
In the embodiment of the invention, the vehicle key certificate in the first encryption state and the security code in the first encryption state are respectively decrypted by the private key of the intelligent lock to obtain the vehicle key certificate and the security code. The intelligent lock comprises an intelligent lock private key and an intelligent lock public key, the vehicle key certificate can be verified through the intelligent lock private key and the intelligent lock public key, so that the authenticity of the vehicle key certificate is judged, and the safety code is used for subsequent verification.
And S163, if the verification is successful, encrypting the security code according to the public key of the non-owner to obtain the security code in the first encryption state, and sending the security code to the non-main intelligent device so that the non-main intelligent device verifies the security code to complete the authorization of the non-main intelligent device.
In the embodiment of the invention, when the vehicle key certificate is correct, the security code is encrypted through the non-vehicle owner public key to obtain the security code in the first encryption state and is sent to the non-main intelligent device, when the non-main intelligent device receives the security code in the first encryption state, the non-vehicle owner public key is used for decrypting the security code to obtain the security code, the security code is compared with the previously generated security code, so that secondary operation is carried out, and if the verification is correct, the non-main intelligent device sends information of successful authorization sending to the intelligent lock cloud platform.
In some embodiments, such as this embodiment, as shown in FIG. 5, the step S160 may be followed by steps S170-S190.
S170, if the unlocking request sent by the non-master intelligent device is detected, sending verification information to the non-master intelligent device so that the non-master intelligent device sends the vehicle key certificate according to the verification information.
In the embodiment of the invention, after the non-master intelligent device is authorized, the non-master intelligent device can control the electric vehicle to be turned on and off by controlling the intelligent lock to be turned on and off. When the non-master intelligent device needs to use the electric vehicle, an unlocking request is sent to the intelligent lock, and after the intelligent lock receives the unlocking request, verification information is sent to the non-master intelligent device to request the non-master intelligent device to send a vehicle key certificate. It should be noted that after the authorization of the non-master smart device is completed, when the non-master smart device needs to be unlocked next time, the unlocking request can be sent only by establishing connection with the smart lock, for example, by connecting with the smart lock through bluetooth.
And S180, verifying the vehicle key certificate.
And S190, if the verification is successful, the intelligent lock is unlocked.
In the embodiment of the invention, after the vehicle key certificate sent by the non-master intelligent device is received, the intelligent lock verifies the vehicle key certificate through the intelligent lock public key and the intelligent lock private key of the intelligent lock, and if the verification is successful, the electric vehicle is directly started.
In some embodiments, such as the present embodiment, the verification information includes first verification information and second verification information, and as shown in fig. 6, the step S170 may include steps S171-S173.
And S171, generating a first random verification code, encrypting the first random verification code according to the public key of the intelligent lock to obtain first verification information, and sending the first verification information to the non-master intelligent device, so that the non-master intelligent device obtains the first random verification code through the first verification information, encrypts the first random verification code to obtain intermediate verification information, and sends the intermediate verification information.
In the embodiment of the invention, after the intelligent lock receives the unlocking request, the first random verification code is generated, the first random verification code is encrypted through the public key of the intelligent lock to obtain the first verification information, and the first verification information is sent to the non-main intelligent equipment. After the non-master intelligent device receives the first verification information, the first verification information is decrypted through the intelligent lock public key to obtain a first random verification code, after the first random verification code is obtained, the first random verification code is encrypted through the non-master intelligent device public key to obtain intermediate verification information, and the intermediate verification information is sent to the intelligent lock.
S172, the intermediate verification information is decrypted to verify the first random verification code, and a second random verification code is generated.
In the embodiment of the invention, after receiving the intermediate verification information sent by the non-master intelligent device, the intelligent lock decrypts the intermediate verification information through the non-master public key to obtain the first random verification code, compares the first random verification code with the first random verification code generated by the intelligent lock, and generates the second random verification code if the results are the same, and performs secondary verification.
And S173, encrypting the second random verification code according to the public key of the intelligent lock to obtain second verification information, and sending the second verification information to the non-master intelligent device, so that the non-master intelligent device obtains the second random verification code through the second verification information, and encrypts and sends the second random verification code and the vehicle key certificate.
In the embodiment of the invention, the second random verification code is encrypted according to the public key of the intelligent lock to obtain second verification information, and the second verification information is sent to the non-master intelligent device. And after receiving the second verification information, the non-master intelligent device decrypts the second verification information by using the intelligent lock public key to obtain the second verification information. The first random verification code and the second random verification code can enable the intelligent lock and the non-master intelligent device to mutually verify the public key of the intelligent lock and the public key of the non-master intelligent device, and therefore information verification is completed. After the second verification information is obtained, the second random verification code and the vehicle key certificate encrypted by the vehicle owner public key are encrypted through the non-vehicle owner public key, and the encrypted second random verification code and the vehicle key certificate encrypted by the vehicle owner public key are sent to the intelligent lock.
In some embodiments, such as this embodiment, as shown in FIG. 7, the step S190 may include steps S191-S192.
And S191, judging whether the distance between the non-main intelligent device and the non-main intelligent device is smaller than a preset distance.
In the embodiment of the invention, after the verification of the vehicle key certificate is completed, the distance between the non-main intelligent device and the non-main intelligent device needs to be further judged, and whether the electric vehicle is started or not is judged according to different distances. Taking bluetooth connection as an example, the closer the distance is, the stronger the RSSI (received Signal Strength indication) value in the bluetooth broadcast Signal is, the farther the distance is, the weaker the RSSI value in the bluetooth broadcast Signal is, and if the preset safety distance is 1 meter, when the distance between the non-main intelligent device and the electric vehicle is less than 1 meter, the intelligent lock is opened.
And S192, if the distance is smaller than the preset distance, the intelligent lock is unlocked.
In the embodiment of the invention, when the distance between the non-master intelligent device and the electric vehicle is less than the preset distance, the intelligent lock is opened, and if the distance is greater than the preset distance, the intelligent lock is refused to be opened.
Fig. 8 is a schematic block diagram of a shared digital car key device 100 according to an embodiment of the present invention. As shown in fig. 8, the present invention further provides a sharing digital car key device 100 corresponding to the above method for sharing digital car keys. The digital car key sharing apparatus 100 includes a unit for performing the above-described digital car key sharing method. Specifically, referring to fig. 8, the shared digital car key device 100 includes an authorization request unit 110, a registration information unit 120, a first request unit 130, a first decryption unit 140, a first encryption unit 150, and a first sending unit 160.
The authorization request unit 110 is configured to send an authorization request to a master smart device if the authorization request is detected, so that the master smart device authorizes a non-master smart device; the registration information unit 120 is configured to, if a registration request sent by the non-master smart device is received, obtain authorization information of the master smart device, and register the non-master smart device; the first requesting unit 130 is configured to request the non-master smart device for a non-owner public key if the registration of the non-master smart device is completed, so that the non-master smart device sends the non-owner public key in a first encrypted state; the first decryption unit 140 is configured to decrypt the non-owner public key in the first encrypted state to obtain the non-owner public key if the non-owner public key in the first encrypted state is received; the first encryption unit 150 is configured to encrypt the smart lock public key according to the non-vehicle owner public key to obtain a smart lock public key in a second encryption state, and send the smart lock public key to the non-master smart device, so that the non-master smart device decrypts and verifies the smart lock public key and sends a vehicle key certificate in a first encryption state; the first sending unit 160 is configured to send authorization success information to the non-master smart device according to the vehicle key certificate in the first encryption state.
In some embodiments, for example, in the present embodiment, referring to fig. 9, the authorization request unit 110 includes a second sending unit 111 and a third sending unit 112.
The second sending unit 111 is configured to send information of the non-master smart device to an owner to obtain the authorization information if a request for sharing authorization sent by the non-master smart device is detected, where the authorization information includes an authorizer and an authorization manner; the third sending unit 112 is configured to send the authorization information, the smart lock public key and the vehicle key certificate encrypted by the vehicle owner public key to the non-master smart device to complete authorization of the non-master smart device.
In some embodiments, for example, in the present embodiment, referring to fig. 10, the book first encryption unit 150 includes a second decryption unit 151, a first verification unit 152, a first generation unit 153, and a second encryption unit 154.
The second decryption unit 151 is configured to decrypt the smart lock public key in the first encryption state according to a non-owner private key to obtain the smart lock public key; the first verification unit 152 is configured to verify the public key of the smart lock; the first generating unit 153 is configured to generate a security code if the verification is successful; the second encryption unit 154 is configured to encrypt the vehicle key certificate and the security code according to the smart lock public key to obtain a vehicle key certificate in a first encryption state and a security code in the first encryption state, and send the vehicle key certificate in the first encryption state and the security code in the first encryption state.
In some embodiments, for example in this embodiment, referring to fig. 11, the first sending unit 160 includes a third decryption unit 161, a second verification unit 162, and a fourth sending unit 163.
The third decryption unit 161 is configured to decrypt, according to the smart lock private key, the vehicle key certificate in the first encryption state and the security code in the first encryption state to obtain the vehicle key certificate and the security code; the second verification unit 162 is configured to verify the vehicle key certificate; the fourth sending unit 163 is configured to, if the verification is successful, encrypt the security code according to the non-vehicle owner public key to obtain the security code in the first encryption state, and send the security code to the non-host smart device, so that the non-host smart device verifies the security code to complete authorization of the non-host smart device.
In some embodiments, for example, in this embodiment, referring to fig. 12, the shared digital car key device 100 further includes a fifth sending unit 170, a third verifying unit 180, and a first starting unit 190.
The fifth sending unit 170 is configured to, if it is detected that the unlocking request is sent by the non-master smart device, send verification information to the non-master smart device, so that the non-master smart device sends the vehicle key certificate according to the verification information; the third verifying unit 180 is configured to verify the vehicle key certificate, and the first starting unit 190 is configured to unlock the smart lock if the verification is successful.
In some embodiments, for example, in this embodiment, referring to fig. 13, the fifth sending unit 170 includes a second generating unit 171, a third generating unit 172, and a third encrypting unit 173.
The second generating unit 171 is configured to generate a first random verification code, encrypt the first random verification code according to the smart lock public key to obtain the first verification information, and send the first verification information to the non-master smart device, so that the non-master smart device obtains the first random verification code through the first verification information and encrypts the first random verification code to obtain intermediate verification information, and send the intermediate verification information; the third generating unit 172 is configured to decrypt the intermediate verification information to verify the first random verification code, and generate a second random verification code; the third encryption unit 173 is configured to encrypt the second random verification code according to the smart lock public key to obtain the second verification information, and send the second verification information to the non-master smart device, so that the non-master smart device obtains the second random verification code through the second verification information, and encrypts and sends the second random verification code and the vehicle key certificate.
In some embodiments, for example, in the present embodiment, referring to fig. 14, the first enabling unit 190 includes a judging unit 191 and a second enabling unit 192.
The judging unit 191 is configured to judge whether a distance between the non-master smart device and the non-master smart device is smaller than a preset distance; the second starting unit 192 is configured to unlock the smart lock if the distance is smaller than a preset distance.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the above-mentioned shared digital car key device and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-mentioned sharing digital car key device can be implemented in the form of a computer program, which can be run on the smart device as shown in fig. 15.
Referring to fig. 15, fig. 15 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal, wherein the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
Referring to fig. 15, the computer device 500 includes a processor 502, memory and interface 507 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, causes the processor 502 to perform a method of sharing digital car keys.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute a shared digital car key method.
The interface 505 is used to communicate with other devices. Those skilled in the art will appreciate that the architecture shown in fig. 15 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing device 500 to which the disclosed aspects apply, as a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
if an authorization request is detected, sending the authorization request to a main intelligent device so that the main intelligent device authorizes a non-main intelligent device;
if a registration request sent by the non-master intelligent device is received, acquiring authorization information of the master intelligent device, and registering the non-master intelligent device;
if the registration of the non-master intelligent device is finished, requesting a non-owner public key from the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state;
if the non-owner public key in the first encryption state is received, decrypting the non-owner public key to obtain the non-owner public key;
encrypting the intelligent lock public key according to the non-owner public key to obtain an intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state;
and sending authorization success information to the non-master intelligent device according to the vehicle key certificate in the first encryption state.
It should be understood that in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of:
if an authorization request is detected, sending the authorization request to a main intelligent device so that the main intelligent device authorizes a non-main intelligent device;
if a registration request sent by the non-master intelligent device is received, acquiring authorization information of the master intelligent device, and registering the non-master intelligent device;
if the registration of the non-master intelligent device is finished, requesting a non-owner public key from the non-master intelligent device so that the non-master intelligent device sends the non-owner public key in a first encryption state;
if the non-owner public key in the first encryption state is received, decrypting the non-owner public key to obtain the non-owner public key;
encrypting the intelligent lock public key according to the non-owner public key to obtain an intelligent lock public key in a second encryption state and sending the intelligent lock public key to the non-master intelligent equipment so that the non-master intelligent equipment decrypts and verifies the intelligent lock public key and sends a vehicle key certificate in a first encryption state;
and sending authorization success information to the non-master intelligent device according to the vehicle key certificate in the first encryption state.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing an intelligent device to perform all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种机械密码挂锁