Data transmission method, and related apparatus, device and storage medium
By extending the key and certificate system to the P2P network and using local keys and certificates for identity authentication, the problem of security risks in driving recorder data transmission is solved and the security and reliability of data transmission are improved.
Patent Information
- Application Number
- PCT/CN2023/078315
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-05-16
- Filing Date
- 2023-02-27
- Publication Date
- 2024-09-12
AI Technical Summary
There are security risks in the data transmission of existing driving recorders. Keys and certificates are stored on third-party servers, which makes the data easily stolen or tampered with during the transmission process. The security and reliability of data transmission are low.
By extending the key and certificate system into a decentralized peer-to-peer network (P2P), locally stored keys and certificates can be used to achieve identity authentication between vehicle terminals and mobile terminals, thereby improving the security and privacy of data transmission. performance and reliability.
It effectively improves the security and reliability of driving recorder data transmission, prevents data tampering and theft, and ensures privacy during data transmission.
Smart Images

Figure CN2023078315_12092024_PF_FP
Abstract
Description
A data transmission method, related device, equipment and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 16, 2022, with application number 2022105309073 and application name “A method, related devices, equipment and storage medium for data transmission”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the fields of security technology and vehicle networking technology, and in particular to data transmission technology. Background Art
[0003] In recent years, with the widespread adoption of the Internet of Things (IoT) and mobile networks, the use of dashcams has rapidly grown. These devices, installed in vehicles, have evolved from simple location tracking to multi-dimensional data recording, enabling remote image and video capture, driver behavior analysis, real-time live streaming, and location tracking.
[0004] Currently, driving data collected by dashcams can be stored on cloud devices through cloud transfer or cloud storage. Keys and certificates are stored on third-party servers. When a car owner wants to access the driving data collected by the dashcam, they directly initiate an access request to the cloud device, which then feeds the data back to the user.
[0005] However, existing solutions have at least the following issues: Driving data is highly private, and storing both keys and certificates on a third-party server still presents certain security risks. Specifically, driving data can be easily stolen or tampered with during transmission, resulting in low security and reliability.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a data transmission method, related apparatus, device, and storage medium, which can improve the security, privacy, and reliability of data transmission.
[0008] In view of this, the present application provides, on one hand, a data transmission method, performed by a second device, comprising:
[0009] receiving a first certificate sent by the first device, and sending a second certificate to the first device;
[0010] If both the first certificate and the second certificate are valid certificates, determining the first public key and the first device identifier based on the first certificate, wherein the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0011] If both the first device identifier and the second device identifier are registered identifiers, receiving a data access request sent by the first device, where the data access request is encrypted by the first device using the second public key or the first private key, the second public key is obtained by the first device based on the second certificate, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0012] In response to the data access request sent by the first device, target data is sent to the first device, wherein the target data is encrypted by the second device using the first public key or the second private key.
[0013] Another aspect of the present application provides a data transmission method, performed by a first device, comprising:
[0014] Sending the first certificate to the second device, and receiving the second certificate sent by the second device;
[0015] If both the first certificate and the second certificate are valid certificates, determining the second public key and the second device identifier based on the second certificate, wherein the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0016] If both the first device identifier and the second device identifier are registered identifiers, a data access request is sent to the second device, where the data access request is encrypted by the first device using the second public key or the first private key, the first public key and the first private key are a key pair generated by the first device, and the first device identifier is the identifier corresponding to the first device;
[0017] Target data sent by the second device is received, wherein the target data is encrypted by the second device using the first public key or the second private key.
[0018] Another aspect of the present application provides a data transmission device, comprising:
[0019] a transceiver module, configured to receive a first certificate sent by a first device, and send a second certificate to the first device;
[0020] a determination module, configured to determine, if both the first certificate and the second certificate are valid certificates, a first public key and a first device identifier based on the first certificate, wherein the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0021] The transceiver module is further configured to, if both the first device identifier and the second device identifier are registered identifiers, receive a data access request sent by the first device, wherein the data access request is encrypted by the first device using the second public key or the first private key, the second public key is obtained by the first device based on the second certificate, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0022] The transceiver module is further configured to respond to a data access request sent by the first device and send target data to the first device, wherein the target data is encrypted by the second device using the first public key or the second private key.
[0023] Another aspect of the present application provides a data transmission device, comprising:
[0024] a transceiver module, configured to send a first certificate to a second device and receive a second certificate sent by the second device;
[0025] a determination module, configured to determine, if both the first certificate and the second certificate are valid certificates, a second public key and a second device identifier based on the second certificate, wherein the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0026] a transceiver module, configured to send a data access request to the second device if both the first device identifier and the second device identifier are registered identifiers, wherein the data access request is encrypted by the first device using the second public key or the first private key, the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0027] The transceiver module is used to receive target data sent by the second device, wherein the target data is encrypted by the second device using the first public key or the second private key.
[0028] Another aspect of the present application provides a data transmission method, which is applied to a data transmission system, wherein the data transmission system includes a vehicle-mounted terminal and a mobile device, including:
[0029] The in-vehicle terminal receives the first certificate sent by the mobile terminal;
[0030] The mobile terminal receives the second certificate sent by the vehicle-mounted terminal;
[0031] If both the first certificate and the second certificate are valid certificates, the in-vehicle terminal determines the first public key and the first device identifier based on the first certificate, and the mobile terminal determines the second public key and the second device identifier based on the second certificate, wherein the first public key and the first private key are a key pair generated by the mobile terminal, the second public key and the second private key are a key pair generated by the in-vehicle terminal, the first device identifier is an identifier corresponding to the mobile terminal, and the second device identifier is an identifier corresponding to the in-vehicle terminal;
[0032] If the first device identifier and the second device identifier are both registered identifiers, the mobile terminal sends a data access request to the vehicle-mounted terminal, wherein the data access request is encrypted by the mobile terminal using the second public key or the first private key;
[0033] The vehicle-mounted terminal responds to the data access request sent by the mobile terminal and sends target driving data to the mobile terminal, wherein the target driving data is encrypted by the vehicle-mounted terminal using the first public key or the second private key.
[0034] On the other hand, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned methods when executing the computer program.
[0035] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned methods when the computer program is executed by a processor.
[0036] Another aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned methods when executed by a processor.
[0037] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0038] An embodiment of the present application provides a method for data transmission, first, the second device receives the first certificate sent by the first device, and sends the second certificate to the first device. At this time, if the first certificate and the second certificate are both valid certificates, the second device determines the first public key and the first device identifier based on the first certificate. Based on this, if the first device identifier and the second device identifier are both registered identifiers, the second device receives the data access request sent by the first device, and responds to the data access request by sending the target data to the first device. Among them, the first public key and the first private key are a key pair generated by the first device, the first device identifier is an identifier corresponding to the first device, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device. The data access request is encrypted by the first device using the second public key or the first private key, and the target data is encrypted by the second device using the first public key or the second private key. Through the above method, the key and certificate system is extended to a decentralized peer-to-peer (P2P) network, so that terminals in the P2P network (for example, vehicle-mounted terminals and mobile terminals) can use locally stored keys and certificates to authenticate each other, thereby improving the security, privacy and reliability of data transmission between terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is a schematic diagram of the architecture of a data transmission system according to an embodiment of the present application;
[0040] FIG2 is a schematic diagram of an environment of a vehicle networking system according to an embodiment of the present application;
[0041] FIG3 is a flow chart of a data transmission method according to an embodiment of the present application;
[0042] FIG4 is a schematic diagram of a working process of a vehicle terminal based on the Internet of Vehicles system according to an embodiment of the present application;
[0043] FIG5 is a schematic diagram of an interface for releasing a terminal identification binding relationship in an embodiment of the present application;
[0044] FIG6 is a schematic diagram of an interface for adding a terminal identification binding relationship in an embodiment of the present application;
[0045] FIG7 is a communication diagram of an intelligent connected vehicle according to an embodiment of the present application;
[0046] FIG8 is a schematic diagram of implementing terminal communication based on a QR code in an embodiment of the present application;
[0047] FIG9 is a schematic diagram of implementing terminal communication based on manually input information in an embodiment of the present application;
[0048] FIG10 is another schematic flow chart of the data transmission method according to an embodiment of the present application;
[0049] FIG11 is a schematic diagram of a mobile terminal workflow based on the Internet of Vehicles system according to an embodiment of the present application;
[0050] FIG12 is a schematic diagram of an interaction process based on the Internet of Vehicles system according to an embodiment of the present application;
[0051] FIG13 is a schematic diagram of a data transmission device according to an embodiment of the present application;
[0052] FIG14 is another schematic diagram of the data transmission device according to an embodiment of the present application;
[0053] FIG15 is a schematic structural diagram of a terminal in an embodiment of the present application. DETAILED DESCRIPTION
[0054] Currently, according to regulations, except for the car owner, no other third party has access to the content collected by the dashcam, including third-party service providers. This requires that even the car manufacturers themselves and the solution providers cannot store the customer's key. At the same time, it is required that the car owner and the car cannot deceive each other and the transmission content cannot be intercepted and cracked. Based on this, this application provides a data security transmission solution based on a peer-to-peer (P2P) network.
[0055] As a new type of network application, P2P offers advantages over the client-server (C / S) model, primarily in terms of increased information volume and the freedom and openness of anonymous services. P2P's greatest advantage lies in its ability to support reliable and convenient information retrieval. In a P2P network, peer nodes share a portion of their resources. These shared resources provide services and content over the network and can be accessed directly by other peer nodes without requiring an intermediary. Therefore, peer nodes in a P2P network act as both resource providers (i.e., servers) and resource acquirers (i.e., clients).
[0056] In order to improve the security, privacy and reliability of data transmission in a P2P network. The present application provides a method for data transmission, which is applied to a data transmission system as shown in Figure 1. As shown in the figure, the data transmission system includes several node devices. The present application does not limit the number of node devices. The node device can be a server or a terminal. The present application uses the node device as a terminal as an example. The client is deployed on the terminal, where the client can run on the terminal in the form of a browser or in the form of an independent application (APP). The specific presentation form of the client is not limited here. The server involved in the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a car terminal and an aircraft, etc., but is not limited to these. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0057] P2P has promoted the development of the Internet of Vehicles industry. With the rapid development of automobile technology, future cars will develop towards networking and intelligence. The installation of various intelligent systems and communication technologies will bring more possibilities to future transportation. For ease of understanding, please refer to Figure 2, which is an environmental schematic diagram of the Internet of Vehicles system in the embodiment of this application. As shown in the figure, information sharing between cars, cars and equipment, cars and roads, and cars and the cloud is achieved through information and communication technology. In the process of Internet of Vehicles communication, an identity authentication system is established to give trusted digital identities to infrastructure such as vehicles, road side units (RSU) and information service platforms to resist security attacks such as information forgery and tampering.
[0058] The Internet of Vehicles (IoV) is the automotive application of the Internet of Things (IoT). The IoT uses various devices and technologies, such as information sensors, radio frequency identification (RFID), global positioning systems (GPS), infrared sensors, and laser scanners, to collect real-time information about any object or process requiring connection or interaction, including acoustic, optical, thermal, electrical, mechanical, chemical, biological, and location data. Through various network access options, this enables ubiquitous connectivity between objects and between objects and people, enabling intelligent perception, identification, and management of objects and processes. The IoT is an information carrier based on the internet and traditional telecommunications networks, connecting all independently addressable, common physical objects into an interconnected network.
[0059] Cloud IOT aims to connect the information sensed and instructions received by sensor devices in traditional IoT to the Internet, truly realize networking, and achieve storage and calculation of massive data through cloud computing technology. Since the characteristic of IoT is that things are connected to each other and the current operating status of each "object" is perceived in real time, a large amount of data information will be generated in this process. How to aggregate this information and how to filter useful information from the massive information to support decision-making for subsequent development have become key issues affecting the development of IoT. Cloud IOT based on cloud computing and cloud storage technology has therefore become a strong support for the application of IoT technology.
[0060] Since this application involves some terms related to professional fields, for ease of understanding, the relevant terms will be explained below.
[0061] (1) Car: generally refers to smart cars or smart connected cars.
[0062] (2) In-vehicle terminal: This terminal can be equipped with an in-vehicle system (i.e., the system used by the car), typically using the Android system. The in-vehicle terminal integrates multiple functions such as positioning, communication, and driving recorder, and has business scheduling functions and data processing capabilities. In this application, it is assumed that the in-vehicle system has a high level of security and cannot be cracked, so the private key cannot be obtained.
[0063] (3) Vehicle Owner: The owner of the vehicle. This generally refers to the vehicle owner's mobile device, including but not limited to computers and mobile phones. In this application, it is assumed that the mobile device's account system is highly secure, preventing other users from accessing the vehicle owner's terminal data and private keys.
[0064] (4) Public key and private key: a pair of keys for asymmetric encryption, where the private key is kept by the user.
[0065] (5) Device identity (TID): The unique identification (ID) of the device. Usually, both the vehicle-mounted terminal and the mobile terminal have their own TID.
[0066] (6) Mobile ID (MID): This indicates the ID of the vehicle terminal. This part can also be provided by the vehicle owner’s account.
[0067] (7) Car ID (CID): indicates the TID of the car terminal.
[0068] (8) Car owner account: the login account of the car manufacturer’s APP.
[0069] (9) Certificate: This is a certificate file indicating that a public key belongs to a certain TID. The certificate is signed by an authority and can therefore be verified.
[0070] (10) Root certificate: the public key file of an authoritative organization, a self-signed certificate.
[0071] (11) Authorities: This refers to the certificate issuing authority (CA), which is the core of the Public Key Infrastructure (PKI). It is mainly responsible for storing private keys, providing root certificates, issuing certificates, authenticating certificates, and managing issued certificates. Generally, traffic scheduling, session maintenance, and load balancing are completed by the CA.
[0072] In combination with the above introduction, the data transmission method in the present application will be introduced below. Please refer to Figure 3. In the embodiment of the present application, the data transmission method can be executed by a terminal. For example, the terminal can be a vehicle-mounted terminal, including:
[0073] 110. The second device receives the first certificate sent by the first device, and sends a second certificate to the first device;
[0074] In one or more embodiments, after a first device establishes a communication connection with a second device, the first device sends a first certificate to the second device, and the second device sends a second certificate to the first device. The first device may be a mobile terminal (e.g., a mobile phone, tablet computer, or computer), and the second device may be a vehicle-mounted terminal.
[0075] Specifically, after the mobile terminal establishes a communication connection with the vehicle terminal, the mobile terminal sends a first certificate to the vehicle terminal, thereby the vehicle terminal receives the first certificate. Similarly, the vehicle terminal sends a second certificate to the mobile terminal, thereby the mobile terminal receives the second certificate.
[0076] 120. If both the first certificate and the second certificate are valid certificates, the second device determines the first public key and the first device identifier based on the first certificate, where the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0077] In one or more embodiments, the second device verifies the validity of the first certificate, and the first device verifies the validity of the second certificate. If both the first certificate and the second certificate are valid certificates, the second device may determine the public key in the first certificate as the first public key, and determine the device identifier in the first certificate as the first device identifier. Similarly, the first device may determine the public key in the second certificate as the second public key, and determine the device identifier in the second certificate as the second device identifier. The first public key and the first private key are a key pair generated for the first device, and the first device identifier is an identifier corresponding to the first device. The second public key and the second private key are a key pair generated for the second device, and the second device identifier is an identifier corresponding to the second device.
[0078] Specifically, the vehicle-mounted terminal obtains a first public key and a first device identifier based on the first certificate, wherein the first public key and the first private key are a key pair generated by the mobile terminal, that is, the first public key can be the mobile terminal public key, and the first private key can be the mobile terminal private key. The first device identifier is the TID of the mobile terminal, that is, the MID. Similarly, the mobile terminal obtains a second public key and a second device identifier based on the second certificate, wherein the second public key and the second private key are a key pair generated by the vehicle-mounted terminal, that is, the second public key can be the vehicle terminal public key, and the second private key can be the vehicle terminal private key. The second device identifier is the TID of the vehicle-mounted terminal, that is, the CID.
[0079] 130. If both the first device identifier and the second device identifier are registered identifiers, the second device receives a data access request sent by the first device, where the data access request is encrypted by the first device using the second public key or the first private key, the second public key is obtained by the first device based on the second certificate, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0080] In one or more embodiments, the second device detects the registration status of the first device identifier, and the first device detects the registration status of the second device identifier. If both the first device identifier and the second device identifier are registered identifiers, the first device may encrypt the data access request using the second public key or the first private key. Based on this, the first device sends the data access request to the second device.
[0081] Specifically, the mobile terminal encrypts the data access request using the public key of the vehicle-mounted terminal or the private key of the mobile terminal, and based on this, the mobile terminal sends the data access request to the vehicle-mounted terminal.
[0082] 140. The second device sends target data to the first device in response to the data access request sent by the first device, where the target data is encrypted by the second device using the first public key or the second private key.
[0083] In one or more embodiments, the second device encrypts the original data using the first public key or the second private key based on the data access request sent by the first device to obtain the target data. Then, the second device sends the target data to the first device.
[0084] Specifically, in response to the data access request, the vehicle terminal encrypts the original data using the mobile terminal's public key or the vehicle terminal's private key to obtain the target data. The vehicle terminal then sends the target data to the mobile terminal. The original data can be driving data collected by a dashcam, including but not limited to voice, photos, and video recordings collected during driving.
[0085] The present application provides a method for data transmission. By extending the key and certificate system to a decentralized P2P network, terminals in the P2P network (e.g., vehicle-mounted terminals and mobile terminals) can authenticate each other using locally stored keys and certificates, thereby improving the security, privacy, and reliability of data transmission between terminals.
[0086] Optionally, based on the embodiments corresponding to FIG. 3 above, in another optional embodiment provided in the embodiment of the present application, before the second device sends the second certificate to the first device, the following steps may be further included:
[0087] The second device obtains the second public key and the second private key;
[0088] The second device stores a second private key;
[0089] The second device sends the second public key and the second device identification to the authentication server, so that the authentication server signs the second public key and the second device identification using the target private key to obtain a second certificate;
[0090] The second device receives the second certificate sent by the authentication server.
[0091] In one or more embodiments, a method for a second device to apply for a certificate from an authority is described. As can be seen from the aforementioned embodiments, before the second device sends the second certificate to the first device, it is necessary to first apply for the second certificate from the authority. First, the second device generates a key pair, namely a second public key and a second private key. On the one hand, the second device needs to store the second private key locally. On the other hand, the second device needs to send the second public key and the second device identification to the authentication server of the authority, and the authentication server uses its own target private key to sign the second public key and the second device identification to obtain the second certificate. Finally, the authentication server feeds back the second certificate to the second device.
[0092] Taking the second device as an in-vehicle terminal as an example, for ease of understanding, please refer to FIG4 , which is a schematic diagram of a workflow of an in-vehicle terminal based on the Internet of Vehicles system in an embodiment of the present application. As shown in the figure, specifically:
[0093] In step A1, the vehicle terminal is pre-installed with an authoritative root certificate before leaving the factory. During factory initialization, the vehicle terminal generates a key pair (i.e., a public key and a private key). The private key is stored within the vehicle terminal itself and is not disclosed. Therefore, no device other than the vehicle terminal can access the private key.
[0094] It should be noted that the key pair may be generated by an algorithm, or by an encryption chip, which is not limited here.
[0095] In step A2, the vehicle terminal obtains its own CID and binds it to the vehicle terminal public key. Based on this, the vehicle terminal initiates a Hypertext Transfer Protocol over Secure Socket Layer (HTTPS) request or a Transport Layer Security (TLS) request to the authentication server of the authority to apply for a certificate.
[0096] In step A3, after receiving the request sent by the vehicle terminal, the authentication server of the authority can use the target private key (ie, the root certificate private key) to digitally sign the CID and the vehicle terminal public key to form a certificate (ie, the second certificate).
[0097] In step A4, the authentication server of the authority feeds back the certificate (i.e., the second certificate) to the vehicle terminal through the HTTPS channel or the TLS channel, thereby minimizing the risk of the vehicle terminal being hijacked and obtaining the wrong certificate. Based on this, the vehicle terminal saves the certificate (i.e., the second certificate).
[0098] In step A5, after receiving the certificate (ie, the second certificate), the vehicle terminal verifies whether the signature of the certificate (ie, the second certificate) is correct through the root certificate pre-installed in step A1 to ensure the legitimacy of the certificate.
[0099] Based on the above process, the vehicle terminal has a key pair bound to its own CID (ie, the vehicle terminal public key and the vehicle terminal private key) and a certificate system, so other visitors can communicate with it securely.
[0100] Secondly, the embodiments of this application provide a method for a second device to apply for a certificate from an authority. This method allows node devices to possess corresponding certificates, which provide authentication and can confirm the identity of the sender. Therefore, by combining this method with the exchange of certificates between node devices, communication between devices can be secure and reliable.
[0101] Optionally, based on the embodiments corresponding to FIG. 3 above, in another optional embodiment provided in the embodiment of the present application, after the second device receives the second certificate sent by the authentication server, the following steps may be further included:
[0102] The second device decrypts the second certificate using the target public key to obtain a second target signature, where the target public key and the target private key are a key pair generated by the authentication server;
[0103] The second device performs a hash calculation on the second public key and the second device identifier to obtain a second target digest;
[0104] If the second target signature is consistent with the second target digest, the second device stores the second certificate.
[0105] In one or more embodiments, a method for a second device to verify a second certificate is introduced. As can be seen from the aforementioned embodiments, the second device pre-installs the root certificate of an authority before leaving the factory, wherein the root certificate includes a target public key, and the target public key and the target private key are key pairs generated by the authority (i.e., the authentication server). Based on this, the target public key can be used to decrypt the second certificate to obtain a second target signature. In addition, the second device needs to perform a hash calculation on the plaintext second public key and the second device identifier to obtain a second target digest. If the second target signature is consistent with the second target digest, it means that the second certificate received by the second device is a valid certificate, and therefore, the second device stores the second certificate locally.
[0106] Specifically, taking the second device as a vehicle-mounted terminal as an example, the target public key is used to decrypt the second certificate to obtain the second target signature, namely:
[0107] signature_2=publickey_CA(DC_2);
[0108] Where signature_2 represents the second target signature, publickey_CA represents the target public key generated by the authority, and DC_2 represents the second certificate.
[0109] Perform hash calculation on the second public key and the second device identifier to obtain the second target digest, namely:
[0110] digest_2=hash(publickey_2+CID);
[0111] Where digest_2 represents the second target digest. hash() represents hash calculation. publickey_2 represents the second public key. CID represents the second device identifier.
[0112] Based on this, if the second target signature (ie, signature_2) is consistent with the second target digest (ie, digest_2), it means that the second certificate is a valid certificate. Otherwise, if they are inconsistent, the second device can re-apply to the authority for a certificate.
[0113] Again, this embodiment of the present application provides a method for a second device to verify a second certificate. Through this method, after obtaining the second certificate, the second device can verify the legitimacy of the second certificate. This ensures the legitimacy of its own local certificate and improves the security and reliability of communications.
[0114] Optionally, based on the embodiments corresponding to FIG. 3 above, in another optional embodiment provided in the embodiment of the present application, after the second device receives the first certificate sent by the first device, the following steps may be further included:
[0115] The second device decrypts the first certificate using the target public key to obtain a first digital signature, wherein the target public key is a public key generated by the authentication server;
[0116] The second device obtains the first public key to be verified and the first identifier to be verified from the first certificate;
[0117] The second device performs a hash calculation on the first public key to be verified and the first identifier to be verified to obtain a first message digest;
[0118] If the first message digest is consistent with the first digital signature, the second device determines that the first certificate is a valid certificate;
[0119] The second device may determine the first public key and the first device identifier according to the first certificate, which may specifically include:
[0120] The second device uses the first public key to be verified in the first certificate as the first public key, and uses the first identifier to be verified in the first certificate as the first device identifier.
[0121] In one or more embodiments, a method for a second device to verify a first certificate is introduced. As can be seen from the aforementioned embodiments, the second device pre-installs the root certificate of an authoritative organization before leaving the factory, wherein the root certificate includes a target public key. Based on this, the second device can use the target public key to decrypt the first certificate to obtain a first digital signature. In addition, the second device can obtain the plaintext first public key to be verified and the first identifier to be verified from the first certificate, and then perform a hash calculation on the first public key to be verified and the first identifier to be verified to obtain a first message digest. If the first message digest is consistent with the first digital signature, it means that the first certificate received by the second device is a valid certificate. Therefore, the second device can use the first public key to be verified in the first certificate as the first public key, and the first identifier to be verified in the first certificate as the first device identifier.
[0122] Specifically, taking the second device as a vehicle-mounted terminal as an example, the target public key is used to decrypt the first certificate to obtain the first digital signature, namely:
[0123] signature_A=publickey_CA(DC_A);
[0124] Where signature_A represents the first digital signature, publickey_CA represents the target public key generated by the authority, and DC_A represents the first certificate.
[0125] Perform hash calculation on the first public key to be verified and the first identifier to be verified to obtain a first message digest, namely:
[0126] digest_A=hash(publickey_A+MID_A);
[0127] Where digest_A represents the first message digest. hash() represents hash calculation. publickey_A represents the first public key to be verified. MID_A represents the first identifier to be verified.
[0128] Based on this, if the first digital signature (ie, signature_A) is consistent with the first message digest (ie, digest_A), it means that the first certificate is a valid certificate. Conversely, if they are inconsistent, the second device will not transmit data to the first device.
[0129] Secondly, the embodiment of the present application provides a method for a second device to verify a first certificate. Through the above method, after obtaining the first certificate, the second device can also verify the validity of the first certificate, preventing other devices from using forged certificate request data, thereby improving the security and reliability of communication.
[0130] Optionally, based on the embodiments corresponding to FIG. 3 above, in another optional embodiment provided by the embodiment of the present application, the second device responds to the data access request sent by the first device and sends the target data to the first device, which may specifically include:
[0131] If the data access request is encrypted by the first device using the second public key, the second device decrypts the data access request using the second private key to obtain the requested data;
[0132] The second device obtains the original data according to the request data;
[0133] The second device encrypts the original data using the second private key to obtain the target data;
[0134] The second device sends the target data to the first device, so that the first device decrypts the target data using the second public key to obtain the original data;
[0135] or,
[0136] If the data access request is encrypted by the first device using the second public key, the second device decrypts the data access request using the second private key to obtain the requested data;
[0137] The second device obtains the original data according to the request data;
[0138] The second device encrypts the original data using the first public key to obtain the target data;
[0139] The second device sends the target data to the first device, so that the first device decrypts the target data using the first private key to obtain the original data;
[0140] or,
[0141] If the data access request is encrypted by the first device using the first private key, the second device decrypts the data access request using the first public key to obtain the requested data;
[0142] The second device obtains the original data according to the request data;
[0143] The second device encrypts the original data using the second private key to obtain the target data;
[0144] The second device sends the target data to the first device, so that the first device decrypts the target data using the second public key to obtain the original data;
[0145] or,
[0146] If the data access request is encrypted by the first device using the first private key, the second device decrypts the data access request using the first public key to obtain the requested data;
[0147] The second device obtains the original data according to the request data;
[0148] The second device encrypts the original data using the first public key to obtain the target data;
[0149] The second device sends the target data to the first device, so that the first device decrypts the target data using the first private key to obtain the original data.
[0150] In one or more embodiments, various methods for secure communication based on different keys are described. As can be seen from the aforementioned embodiments, the second device locally stores the second private key and is able to obtain the first public key. The first device locally stores the first private key and is able to obtain the second public key.
[0151] The following example uses a mobile device as the first device and an in-vehicle device as the second device. The first public key is the mobile device's public key, the first private key is the mobile device's private key, the second public key is the in-vehicle device's public key, and the second private key is the in-vehicle device's private key. Assume that a user uses their mobile device to view driving data from 3:00 PM to 5:00 PM on May 3, 2022. The requested data is obtained.
[0152] Method 1:
[0153] The mobile terminal uses the vehicle terminal's public key to encrypt the requested data, generating a data access request. The mobile terminal then sends the data access request to the vehicle terminal, which decrypts the request using its private key to retrieve the requested data. Based on the request data, the vehicle terminal retrieves the corresponding driving data as the original data. The vehicle terminal then encrypts the original data using its private key to retrieve the target data. The vehicle terminal then sends the target data to the mobile terminal, which decrypts it using its public key to retrieve the original data.
[0154] Method 2:
[0155] The mobile terminal uses the vehicle terminal's public key to encrypt the requested data, generating a data access request. The mobile terminal then sends the data access request to the vehicle terminal, which decrypts the request using its private key to retrieve the requested data. Based on the request data, the vehicle terminal retrieves the corresponding driving data as the original data. The vehicle terminal then encrypts the original data using the mobile terminal's public key to retrieve the target data. The vehicle terminal then sends the target data to the mobile terminal, which decrypts it using its private key to retrieve the original data.
[0156] Method three;
[0157] The mobile terminal uses its private key to encrypt the requested data, generating a data access request. The mobile terminal then sends the data access request to the vehicle terminal, which decrypts the request using its public key to retrieve the requested data. Based on the request data, the vehicle terminal retrieves the corresponding driving data as the original data. The vehicle terminal then encrypts the original data using its private key to retrieve the target data. The vehicle terminal then sends the target data to the mobile terminal, which decrypts it using its public key to retrieve the original data.
[0158] Method 4:
[0159] The mobile terminal uses its private key to encrypt the requested data, generating a data access request. The mobile terminal then sends the data access request to the vehicle terminal, which decrypts the request using its public key to retrieve the requested data. Based on the request data, the vehicle terminal retrieves the corresponding driving data as the original data. The vehicle terminal then encrypts the original data using the mobile terminal's public key to retrieve the target data. The vehicle terminal then sends the target data to the mobile terminal, which decrypts it using its private key to retrieve the original data.
[0160] Secondly, the embodiments of the present application provide multiple ways of secure communication based on different keys. Through the above methods, the second device can select the corresponding key for encryption or decryption according to the actual situation, thereby increasing the feasibility and flexibility of the solution.
[0161] Optionally, based on the embodiments corresponding to FIG. 3 above, in another optional embodiment provided by the embodiment of the present application, after the second device determines the first public key and the first device identifier according to the first certificate, the following steps may be further included:
[0162] The second device obtains a first device identification set stored in the second device, where the first device identification set includes M first registered device identifications registered for the second device, where M is an integer greater than or equal to 1;
[0163] If the first device identifier successfully matches a first registered device identifier in the first device identifier set, the second device determines that the first device identifier is a registered identifier.
[0164] In one or more embodiments, a method for determining whether a first device identifier is a registered identifier is described. As can be seen from the aforementioned embodiments, a first device can register the first device identifier with a second device via the Bluetooth protocol or other secure channel. Based on this, the second device needs to match the received first device identifier. If a match is successful, it indicates that the first device has been registered, i.e., the first device identifier is determined to be a registered identifier.
[0165] Specifically, the following description uses the example of a mobile terminal as the first device and an in-vehicle terminal as the second device. A user can bind M MIDs to an in-vehicle terminal, allowing M mobile terminals to communicate with one in-vehicle terminal. For easier understanding, please refer to Table 1, which shows an example of M MIDs registered with an in-vehicle terminal.
[0166] Table 1
[0167] It can be seen that the same vehicle terminal (i.e., the same CID) can be bound to at least one MID. Taking Table 1 as an example, the vehicle terminal with CID "CID_0001" has three registered first registered device identifiers, namely MID_0235659, MID_0254981, and MID_0264154.
[0168] Secondly, embodiments of the present application provide a method for determining whether a first device identifier is a registered identifier. Using this method, a first device can register its own first device identifier with a second device, which will then store it. By verifying the device identifier, it can be determined whether it is the same as a previously registered identity, thereby improving the security and reliability of device communications.
[0169] Optionally, based on the embodiments corresponding to FIG. 3 above, another optional embodiment provided in the embodiment of the present application may further include:
[0170] The second device displays the first device identification set;
[0171] The second device responds to the deletion operation on the K first registered device identifiers in the first device identifier set by removing the K first registered device identifiers from the first device identifier set to obtain an updated first device identifier set, where K is an integer greater than or equal to 1 and less than or equal to M;
[0172] It may also include:
[0173] The second device displays an identification adding control;
[0174] The second device displays a logo adding area in response to a selection operation on the logo adding control;
[0175] In response to the input operation on the identifier adding area, the second device adds T first registered device identifiers to the first device identifier set to obtain an updated first device identifier set, where T is an integer greater than or equal to 1.
[0176] In one or more embodiments, methods for binding and unbinding device identifiers are described. As can be seen from the aforementioned embodiments, the second device also supports the function of displaying the first device identifier set, based on which the CID and MID can be bound or unbound. The following uses a vehicle-mounted terminal as an example to illustrate the process of binding and unbinding identifiers.
[0177] 1. Unbind the terminal ID binding relationship;
[0178] Specifically, for ease of understanding, please refer to Figure 5, which is a schematic diagram of an interface for releasing the terminal identification binding relationship in an embodiment of the present application. As shown in Figure 5 (A), B1 is used to indicate a list of MIDs that have been bound to "CID_0001", where there are currently 2 MIDs bound to "CID_0001". B2 is used to indicate the selected MID. Since only one MID is selected here, K is equal to 1. It can be understood that the method of selecting a MID includes but is not limited to long pressing, double-clicking, clicking on the control, etc., which are not limited here. B3 is used to indicate the delete control. After the user selects K MIDs, click the delete control indicated by B3 to display the interface shown in Figure 5 (B). At this time, the selected "MID_0235659" has been released from the binding relationship with "CID_0001".
[0179] 2. Add terminal identification binding relationship;
[0180] Specifically, for ease of understanding, please refer to Figure 6, which is a schematic diagram of an interface for adding a terminal identification binding relationship in an embodiment of the present application. As shown in Figure 6 (A), C1 is used to indicate a list of MIDs that have been bound to "CID_0001", where there are currently 2 MIDs bound to "CID_0001". C2 is used to indicate an identification addition control. After the user clicks the identification addition control indicated by C2, the identification addition area indicated by C3 is displayed. Based on this, the user can enter the corresponding MID in the identification addition area, for example, "MID_0264154". Since only one MID is added here, T is equal to 1. After the input is completed, the interface shown in Figure 6 (B) is displayed. At this time, the selected "MID_0264154" has been successfully bound to "CID_0001".
[0181] Thirdly, the embodiments of the present application provide a method for binding and unbinding device identifiers. Through this method, if the user's mobile terminal is no longer in use, the previously bound MID can be deleted from the vehicle terminal, thereby preventing it from being exploited by criminals. At the same time, the results are visualized on the vehicle terminal, allowing even malicious intrusions to be detected and removed in a timely manner.
[0182] Optionally, based on the embodiments corresponding to FIG. 3 above, in another optional embodiment provided in the embodiment of the present application, before the second device receives the first certificate sent by the first device and sends the second certificate to the first device, the following steps may be further included:
[0183] When the second device and the first device activate the Bluetooth function, the second device establishes a Bluetooth connection with the first device, so that a communication connection is established between the second device and the first device;
[0184] or,
[0185] When the second device and the first device are connected to the same wireless hotspot, the second device establishes a communication connection with the first device;
[0186] or,
[0187] The second device displays a QR code, wherein the QR code includes an identifier of the second device;
[0188] When the first device scans the QR code, the second device establishes a communication connection with the first device;
[0189] or,
[0190] The second device displays an information input area;
[0191] The second device establishes a communication connection with the first device in response to the first device identifier input into the information input area.
[0192] In one or more embodiments, various methods for establishing a communication connection are described. As can be seen from the aforementioned embodiments, data transmission can begin after a communication connection is established between a first device and a second device. Therefore, the following describes methods for establishing a communication connection using an example in which the first device is a mobile terminal and the second device is a vehicle-mounted terminal.
[0193] It is understandable that the vehicle-mounted terminal is deployed in an intelligent connected vehicle. For ease of understanding, please refer to Figure 7, which is a communication diagram of an intelligent connected vehicle in an embodiment of the present application. As shown in the figure, an intelligent connected vehicle typically has a mobile hotspot (Wireless Fidelity, Wi-Fi) function, Bluetooth function, camera function, Global Positioning System (GPS) function, radar function, communication function, etc. Based on this, the vehicle-mounted terminal can have built-in Wi-Fi function, Bluetooth function, GPS function, communication function, etc.
[0194] Association method 1;
[0195] The vehicle terminal and the mobile terminal can establish a connection using near field communication. For example, both the vehicle terminal and the mobile terminal have Bluetooth functions enabled and establish a communication connection based on the Bluetooth protocol.
[0196] The second method of association;
[0197] The vehicle terminal activates the hotspot function, and the mobile terminal accesses the hotspot corresponding to the vehicle terminal. Thus, the vehicle terminal and the mobile terminal access the same wireless hotspot, that is, the two establish a communication connection through the same Wi-Fi network.
[0198] Association method three;
[0199] The vehicle-mounted terminal displays a QR code for scanning by the mobile terminal. For ease of understanding, please refer to Figure 8, which is a schematic diagram of terminal communication based on QR codes in an embodiment of the present application. As shown in the figure, the vehicle-mounted terminal displays a QR code indicated by D1, where the QR code contains the CID of the vehicle-mounted terminal, which can be scanned by the mobile terminal through the car owner's app. Based on this, the mobile terminal can scan the QR code, and upon successful scanning, a communication connection is established between the two devices.
[0200] Association method four;
[0201] The vehicle terminal displays an information input area for the user to manually enter the MID (for example, the owner's account number, the system-assigned identification number, or the mobile phone number, etc.). For ease of understanding, please refer to Figure 9, which is a schematic diagram of an embodiment of the present application for implementing terminal communication based on manually input information. As shown in the figure, E1 is used to indicate the information input area. The user can enter the MID (i.e., the first device identifier) in the information input area indicated by E1. After the input is completed, click the confirmation control indicated by E2 to establish the communication connection between the two devices.
[0202] Secondly, the embodiments of the present application provide a variety of ways to establish a communication connection. Through the above-mentioned method, the trusted party is added as the designated access party using near-field communication, which can avoid tampering and intrusion in the case of public network communication. In addition, asymmetric encryption and certificate systems provide great protection for the security and reliability of data communication, and the present application can also adopt a lighter approach. That is, the agreed key can be simply exchanged during the near-field communication process. After that, the mobile terminal and the vehicle-mounted terminal directly use the key for encrypted communication, and the key is no longer transmitted in the communication link, which also has a good security effect. In order to further enhance the security of the key, the randomness and complexity of the key can also be checked, and the owner can be reminded to change it regularly.
[0203] In combination with the above introduction, the data transmission method in the present application will be introduced below. Referring to FIG. 10 , the data transmission method in the embodiment of the present application can be performed by a terminal. Exemplarily, the terminal can be a mobile terminal, including:
[0204] 210. The first device sends a first certificate to the second device, and receives a second certificate sent by the second device;
[0205] In one or more embodiments, after a first device establishes a communication connection with a second device, the first device sends a first certificate to the second device, and the second device sends a second certificate to the first device. The first device may be a mobile terminal (e.g., a mobile phone, tablet computer, or computer), and the second device may be a vehicle-mounted terminal.
[0206] It should be noted that the execution process of step 210 is similar to that of step 110 and will not be described in detail here.
[0207] 220. If both the first certificate and the second certificate are valid certificates, the first device determines a second public key and a second device identifier based on the second certificate, where the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0208] In one or more embodiments, the second device verifies the validity of the first certificate, and the first device verifies the validity of the second certificate. If both the first certificate and the second certificate are valid certificates, the second device may determine the public key in the first certificate as the first public key, and determine the device identifier in the first certificate as the first device identifier. Similarly, the first device may determine the public key in the second certificate as the second public key, and determine the device identifier in the second certificate as the second device identifier. The first public key and the first private key are a key pair generated for the first device, and the first device identifier is an identifier corresponding to the first device. The second public key and the second private key are a key pair generated for the second device, and the second device identifier is an identifier corresponding to the second device.
[0209] It should be noted that the execution process of step 220 is similar to that of step 120 and will not be described in detail here.
[0210] 230. If both the first device identifier and the second device identifier are registered identifiers, the first device sends a data access request to the second device, where the data access request is encrypted by the first device using the second public key or the first private key, the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0211] In one or more embodiments, the second device detects the registration status of the first device identifier, and the first device detects the registration status of the second device identifier. If both the first device identifier and the second device identifier are registered identifiers, the first device may encrypt the data access request using the second public key or the first private key. Based on this, the first device sends the data access request to the second device.
[0212] It should be noted that the execution process of step 230 is similar to that of step 130 and will not be described in detail here.
[0213] 240. The first device receives target data sent by the second device, where the target data is encrypted by the second device using the first public key or the second private key.
[0214] In one or more embodiments, the second device responds to the data access request sent by the first device and encrypts the original data using the first public key or the second private key to obtain the target data. Then, the second device sends the target data to the first device.
[0215] It should be noted that the execution process of step 240 is similar to that of step 140 and will not be described in detail here.
[0216] The present invention provides a data transmission method. By extending the key and certificate system to a decentralized P2P network, terminals in the P2P network (e.g., vehicle-mounted terminals and mobile terminals) can authenticate each other using locally stored keys and certificates, thereby improving the security, privacy, and reliability of data transmission between terminals.
[0217] Optionally, based on the embodiments corresponding to FIG. 10 , in another optional embodiment provided in the embodiment of the present application, before the first device sends the first certificate to the second device, the following steps may be further included:
[0218] The first device obtains a first public key and a first private key;
[0219] The first device stores the first private key;
[0220] The first device sends the first public key and the first device identification to the authentication server, so that the authentication server signs the first public key and the first device identification with the target private key to obtain a first certificate;
[0221] The first device receives a first certificate sent by the authentication server.
[0222] In one or more embodiments, a method for a first device to apply for a certificate from an authority is introduced. As can be seen from the aforementioned embodiments, before the first device sends the first certificate to the second device, it is necessary to first apply for the first certificate from the authority. First, the first device generates a key pair, namely a first public key and a first private key. On the one hand, the first device needs to store the first private key locally. On the other hand, the first device needs to send the first public key and the first device identification to the authentication server of the authority, and the authentication server uses its own target private key to sign the first public key and the first device identification to obtain the first certificate. Finally, the authentication server feeds back the first certificate to the first device.
[0223] Taking the first device as a mobile terminal as an example, for ease of understanding, please refer to Figure 11, which is a schematic diagram of a mobile terminal workflow based on the Internet of Vehicles system in an embodiment of the present application. As shown in the figure, specifically:
[0224] In step F1, the user downloads the app to the mobile terminal. The app has a root certificate from an authoritative organization built into it. This process can be provided by the app's software development kit (SDK). After the user logs in to the app, a corresponding key pair (i.e., a mobile terminal public key and a mobile terminal private key) is generated based on the different MIDs (e.g., the owner's account, a system-assigned identification number, or a mobile phone number). The mobile terminal private key is stored by the mobile terminal itself and is not leaked. Therefore, no one other than the mobile terminal can access the mobile terminal private key.
[0225] In step F2, the mobile terminal binds the MID to the mobile terminal public key. Based on this, the mobile terminal initiates an HTTPS request or a TLS request to the authentication server of the authority to apply for a certificate.
[0226] In step F3, after receiving the request from the mobile terminal, the authentication server of the authority may use the target private key (ie, the root certificate private key) to digitally sign the MID and the mobile terminal public key to form a certificate (ie, the first certificate).
[0227] In step F4, the authentication server of the authority feeds back the certificate (i.e., the first certificate) to the mobile terminal via the HTTPS channel or the TLS channel, thereby preventing the mobile terminal from being hijacked and obtaining the wrong certificate to the greatest extent possible. Based on this, the mobile terminal saves the certificate (i.e., the first certificate).
[0228] In step F5, after receiving the certificate (ie, the first certificate), the mobile terminal verifies whether the signature of the certificate (ie, the first certificate) is correct through the root certificate pre-installed in step F1 to ensure the legitimacy of the certificate.
[0229] Based on the above process, the mobile terminal has a key pair (ie, a mobile terminal public key and a mobile terminal private key) and a certificate system bound to its own MID, and other visitors can communicate with it securely.
[0230] It should be noted that mobile terminal apps may clear data. Therefore, when logging in again, you need to re-verify the existence and validity of the key pair (i.e., mobile terminal public key and mobile terminal private key) and certificate. If they do not exist or are illegal, they need to be regenerated. The security of the app is mainly guaranteed by the app, that is, to ensure that its private key cannot be obtained, and to use the encryption chip built into the app system whenever possible.
[0231] Secondly, the embodiments of the present application provide a method for a first device to apply for a certificate from an authority. This method enables the node device to possess the corresponding certificate, which provides authentication and can confirm the identity of the sender. Therefore, by coordinating the exchange of certificates between node devices, communication between devices can be secure and reliable.
[0232] Optionally, based on the embodiments corresponding to FIG. 10 above, in another optional embodiment provided in the embodiment of the present application, after the first device receives the first certificate sent by the authentication server, the following steps may be further included:
[0233] The first device decrypts the first certificate using the target public key to obtain a first target signature, wherein the target public key and the target private key are a key pair generated by the authentication server;
[0234] The first device performs a hash calculation on the first public key and the first device identifier to obtain a first target digest;
[0235] If the first target signature is consistent with the first target digest, the first device stores the first certificate.
[0236] In one or more embodiments, a method for a first device to verify a first certificate is introduced. It can be seen from the aforementioned embodiments that the first device has a root certificate of an authority built into the downloaded APP, wherein the root certificate includes a target public key, and the target public key and the target private key are key pairs generated by the authority (i.e., the authentication server). Based on this, the target public key can be used to decrypt the first certificate to obtain a first target signature. In addition, the first device needs to perform a hash calculation on the plaintext first public key and the first device identifier to obtain a first target summary. If the first target signature is consistent with the first target summary, it means that the first certificate received by the first device is a valid certificate, and therefore, the first device stores the first certificate locally.
[0237] Specifically, taking the first device as a mobile terminal as an example, the target public key is used to decrypt the first certificate to obtain the first target signature, that is:
[0238] signature_1=publickey_CA(DC_1);
[0239] Where signature_1 represents the first target signature, publickey_CA represents the target public key generated by the authority, and DC_1 represents the first certificate.
[0240] Perform hash calculation on the first public key and the first device identifier to obtain a first target digest, namely:
[0241] digest_1=hash(publickey_1+MID);
[0242] Where digest_1 represents the first target digest. hash() represents hash calculation. publickey_1 represents the first public key. MID represents the first device identifier.
[0243] Based on this, if the first target signature (ie, signature_1) is consistent with the first target digest (ie, digest_1), it means that the first certificate is a valid certificate. Otherwise, if they are inconsistent, the first device can re-apply to the authority for a certificate.
[0244] Furthermore, embodiments of the present application provide a method for a first device to verify a first certificate. Through this method, after obtaining the first certificate, the first device can also verify the legitimacy of the first certificate. This ensures the legitimacy of its own local certificate, thereby improving the security and reliability of communications.
[0245] Optionally, based on the embodiments corresponding to FIG. 10 , in another optional embodiment provided in the embodiment of the present application, after the first device receives the second certificate sent by the second device, the following steps may be further included:
[0246] The first device decrypts the second certificate using the target public key to obtain a second digital signature, where the target public key is a public key generated by the authentication server;
[0247] The first device obtains a second public key to be verified and a second identifier to be verified from the second certificate;
[0248] The first device performs a hash calculation on the second public key to be verified and the second identifier to be verified to obtain a second message digest;
[0249] If the second message digest is consistent with the second digital signature, the first device determines that the second certificate is a valid certificate;
[0250] The first device may determine the second public key and the second device identifier according to the second certificate, which may specifically include:
[0251] The first device uses the second public key to be verified in the second certificate as the second public key, and uses the second identifier to be verified in the second certificate as the second device identifier.
[0252] In one or more embodiments, a method for a first device to verify a second certificate is introduced. As can be seen from the aforementioned embodiments, the first device has a root certificate of an authoritative organization built into the downloaded APP, wherein the root certificate includes a target public key. Based on this, the target public key can be used to decrypt the second certificate to obtain a second digital signature. In addition, the first device can obtain the second public key to be verified and the second identifier to be verified in plain text from the second certificate, and then perform a hash calculation on the second public key to be verified and the second identifier to be verified to obtain a second message digest. If the second message digest is consistent with the second digital signature, it means that the second certificate received by the first device is a valid certificate. Therefore, the first device can use the second public key to be verified in the second certificate as the first public key, and the second identifier to be verified in the second certificate as the second device identifier.
[0253] Specifically, taking the first device as a mobile terminal as an example, the target public key is used to decrypt the second certificate to obtain the second digital signature, namely:
[0254] signature_B=publickey_CA(DC_B);
[0255] Where signature_B represents the second digital signature, publickey_CA represents the target public key generated by the authority, and DC_B represents the second certificate.
[0256] Perform hash calculation on the second public key to be verified and the second identifier to be verified to obtain a second message digest, namely:
[0257] digest_B=hash(publickey_B+CID_B);
[0258] Where digest_B represents the second message digest. hash() represents hash calculation. publickey_B represents the second public key to be verified. CID_B represents the second identifier to be verified.
[0259] Based on this, if the second digital signature (ie, signature_B) is consistent with the second message digest (ie, digest_B), it means that the second certificate is a valid certificate. Otherwise, if they are inconsistent, the first device will not send a request to the second device.
[0260] Secondly, the embodiment of the present application provides a method for a first device to verify a second certificate. Through the above method, after obtaining the second certificate, the first device can also verify the validity of the second certificate, preventing other devices from using forged certificate request data, thereby improving the security and reliability of communication.
[0261] Optionally, based on the embodiments corresponding to FIG. 10 , in another optional embodiment provided in the embodiment of the present application, before the first device sends the data access request to the second device, the following steps may be further included:
[0262] The first device encrypts the request data using the second public key to obtain a data access request;
[0263] After the first device sends the data access request to the second device, the method may further include:
[0264] The first device sends a data access request to the second device, so that the second device decrypts the data access request using the second private key to obtain the requested data;
[0265] or,
[0266] Before the first device sends the data access request to the second device, the method may further include:
[0267] The first device encrypts the request data using the first private key to obtain a data access request;
[0268] After the first device sends the data access request to the second device, the method may further include:
[0269] The first device sends a data access request to the second device, so that the second device decrypts the data access request using the first public key to obtain the requested data;
[0270] or,
[0271] After the first device receives the target data sent by the second device, the method may further include:
[0272] If the target data is obtained by encrypting the original data using the second private key, the first device decrypts the target data using the second public key to obtain the original data;
[0273] or,
[0274] After the first device receives the target data sent by the second device, the method may further include:
[0275] If the target data is obtained by encrypting original data by the second device using the first public key, the first device decrypts the target data using the first private key to obtain the original data.
[0276] In one or more embodiments, various methods for secure communication based on different keys are described. As can be seen from the aforementioned embodiments, a first device locally stores a first private key and is able to obtain a second public key. A second device locally stores a second private key and is able to obtain the first public key.
[0277] It should be noted that the content described in this embodiment can refer to the method 1, method 2, method 3 and method 4 in the above embodiments, and will not be repeated here.
[0278] Secondly, the embodiments of the present application provide multiple ways of secure communication based on different keys. Through the above methods, the first device can select the corresponding key for encryption or decryption according to the actual situation, thereby increasing the feasibility and flexibility of the solution.
[0279] Optionally, based on the embodiments corresponding to FIG. 10 above, in another optional embodiment provided by the embodiment of the present application, after the first device determines the second public key and the second device identifier according to the second certificate, the following steps may be further included:
[0280] The first device obtains a second device identification set stored in the first device, where the second device identification set includes N second registered device identifications registered for the first device, where N is an integer greater than or equal to 1;
[0281] If the second device identifier successfully matches a second registered device identifier in the second device identifier set, the first device determines that the second device identifier is a registered identifier.
[0282] In one or more embodiments, a method for determining whether a device identifier is a registered identifier is described. As can be seen from the aforementioned embodiments, a second device can register the second device identifier with a first device via the Bluetooth protocol or other secure channel. Based on this, the first device needs to match the received second device identifier. If a match is successful, it indicates that the second device has been previously registered, i.e., the second device identifier is determined to be a registered identifier.
[0283] Specifically, the following description uses the example of a mobile terminal as the first device and an in-vehicle terminal as the second device. A user can bind N CIDs to a mobile terminal, allowing N in-vehicle terminals to communicate with a single mobile terminal. For easier understanding, please refer to Table 2, which shows an example of N CIDs registered with a mobile terminal.
[0284] Table 2
[0285] It can be seen that the same mobile terminal (ie, the same MID) can be bound to at least one CID. Taking Table 2 as an example, the mobile terminal with MID "MID_0235659" has two registered second registered device identifiers, namely CID_0001 and CID_0006.
[0286] Secondly, the embodiments of the present application provide a method for determining whether a device identifier is a registered identifier. Through the above method, the second device can register its own second device identifier with the first device, and the app in the first device will save it. By verifying the device identifier, it can be determined whether it is the same as the previously registered identity, thereby improving the security and reliability of device communication.
[0287] Optionally, based on the embodiments corresponding to FIG. 10 above, in another optional embodiment provided in the embodiment of the present application, before the first device sends the first certificate to the second device and receives the second certificate sent by the second device, the following steps may be further included:
[0288] When the second device and the first device activate the Bluetooth function, the first device establishes a Bluetooth connection with the second device, so that a communication connection is established between the second device and the first device;
[0289] or,
[0290] When the second device and the first device are connected to the same wireless hotspot, the first device establishes a communication connection with the second device;
[0291] or,
[0292] The first device scans the QR code displayed on the second device and establishes a communication connection with the first device, wherein the QR code includes the second device identification.
[0293] In one or more embodiments, various methods for establishing a communication connection are described. As can be seen from the aforementioned embodiments, data transmission can begin after a communication connection is established between a first device and a second device. It should be noted that the content described in this embodiment can be referenced to Association Methods 1, 2, and 3 in the aforementioned embodiments, and will not be further elaborated here.
[0294] Secondly, the embodiments of the present application provide a variety of ways to establish a communication connection. Through the above-mentioned method, the trusted party is added as the designated access party using near-field communication, which can avoid tampering and intrusion in the case of public network communication. In addition, asymmetric encryption and certificate systems provide great protection for the security and reliability of data communication, and the present application can also adopt a lighter approach. That is, the agreed key can be simply exchanged during the near-field communication process. After that, the mobile terminal and the vehicle-mounted terminal will directly use the key to encrypt the communication, and the key will no longer be transmitted in the communication link, which also has a good security effect. In order to further enhance the security of the key, the randomness and complexity of the key can also be checked, and the owner can be reminded to change it regularly.
[0295] In conjunction with the above introduction, for ease of understanding, please refer to FIG12 , which is a schematic diagram of an interaction process based on the Internet of Vehicles system in an embodiment of the present application. As shown in the figure, specifically:
[0296] In step G1, the vehicle terminal is pre-installed with an authoritative root certificate before leaving the factory. During the initialization process after leaving the factory, the vehicle terminal generates a vehicle terminal public key and a vehicle terminal private key. The vehicle terminal private key is stored by the vehicle terminal itself and is not disclosed.
[0297] In step G2, the vehicle terminal obtains its own CID and binds the vehicle terminal public key. Based on this, the vehicle terminal initiates an HTTPS request or TLS request to the authentication server of the authority to apply for a certificate.
[0298] In step G3, after receiving the request sent by the vehicle terminal, the authentication server of the authority may use the target private key (ie, the root certificate private key) to digitally sign the CID and the vehicle terminal public key to form a second certificate.
[0299] In step G4, the authentication server of the authority feeds back the second certificate to the vehicle-mounted terminal through the HTTPS channel or the TLS channel, and the vehicle-mounted terminal saves the second certificate.
[0300] In step G5, after receiving the second certificate, the vehicle-mounted terminal verifies whether the signature of the second certificate is correct through the root certificate pre-installed in step G1, thereby ensuring the legitimacy of the second certificate.
[0301] In step G6, the user downloads the app to the mobile terminal. The app has a built-in root certificate from an authorized organization. This process can be provided by the app's SDK. After the user logs in to the app, a corresponding mobile terminal public key and mobile terminal private key are generated based on the MID (e.g., the vehicle owner's account or mobile phone number). The mobile terminal private key is stored in the mobile terminal itself and is not disclosed.
[0302] In step G7, the mobile terminal binds the MID to the mobile terminal public key. Based on this, the mobile terminal initiates an HTTPS request or a TLS request to the authentication server of the authority to apply for a certificate.
[0303] In step G8, after receiving the request sent by the mobile terminal, the authentication server of the authority may use the target private key (ie, the root certificate private key) to digitally sign the MID and the mobile terminal public key to form a first certificate.
[0304] In step G9, the authentication server of the authority feeds back the first certificate to the mobile terminal through the HTTPS channel or the TLS channel, and the mobile terminal saves the first certificate.
[0305] In step G10, after receiving the first certificate, the mobile terminal verifies whether the signature of the first certificate is correct through the root certificate pre-installed in step G6, so as to ensure the legitimacy of the first certificate.
[0306] After both the vehicle terminal and the mobile terminal have established a trusted and equivalent security environment, the vehicle terminal and the mobile terminal (i.e., the owner's app) need to be bound. This step is usually performed offline by the owner after the first purchase and delivery of the vehicle. Data is transmitted via Bluetooth protocols, which relatively reduces security risks.
[0307] In step G11, the vehicle terminal exchanges the CID to the car owner APP of the mobile terminal through the Bluetooth protocol or other secure channels, and the car owner APP saves it.
[0308] In step G12, the car owner APP of the mobile terminal exchanges the MID to the vehicle terminal through the Bluetooth protocol or other secure channels, and the vehicle terminal saves it.
[0309] When communicating with the vehicle terminal, the mobile terminal and the vehicle terminal exchange certificates. Each party verifies the other's identity to determine whether it is the same as the previously registered identity. The identity is verified by the root certificate and cannot be forged. After the two parties have verified their identities, they exchange keys and can communicate securely.
[0310] This application addresses the security and trust requirements for direct connections between car owners and their cars via a peer-to-peer (P2P) network in the connected vehicle (IoV). It expands the key and certificate system, ensuring that both in-vehicle and mobile terminals have the same level of security and trust as servers deployed in the computer room. Furthermore, by leveraging the mutual trust between car owners and in-vehicle terminals, car owners generally avoid actively damaging their cars. Finally, the communication spaces between car owners are isolated, preventing mutual intrusion. This ensures secure communication between in-vehicle and mobile terminals, meeting the high privacy protection standards required by regulators.
[0311] The data transmission device in the present application is described in detail below. Please refer to FIG13 , which is a schematic diagram of an embodiment of the data transmission device in the present application. The data transmission device 30 includes:
[0312] The transceiver module 310 is configured to receive a first certificate sent by the first device and send a second certificate to the first device;
[0313] a determination module 320 configured to determine, if both the first certificate and the second certificate are valid certificates, a first public key and a first device identifier based on the first certificate, wherein the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0314] The transceiver module 310 is further configured to, if both the first device identifier and the second device identifier are registered identifiers, receive a data access request sent by the first device, where the data access request is encrypted by the first device using the second public key or the first private key, the second public key is obtained by the first device based on the second certificate, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0315] The transceiver module 310 is further configured to respond to a data access request sent by the first device and send target data to the first device, wherein the target data is encrypted by the second device using the first public key or the second private key.
[0316] Optionally, based on the embodiment corresponding to FIG. 13 , in another embodiment of the data transmission device 30 provided in the embodiment of the present application, the data transmission device 30 further includes an acquisition module 330 and a storage module 340 ;
[0317] An acquisition module 330 is configured to acquire a second public key and a second private key before sending the second certificate to the first device;
[0318] The storage module 340 is configured to store a second private key;
[0319] The transceiver module 310 is further configured to send the second public key and the second device identification to the authentication server, so that the authentication server signs the second public key and the second device identification using the target private key to obtain a second certificate;
[0320] The transceiver module 310 is further configured to receive a second certificate sent by the authentication server.
[0321] Optionally, based on the embodiment corresponding to FIG. 13 , in another embodiment of the data transmission device 30 provided in the embodiment of the present application, the data transmission device 30 further includes a decryption module 350 and a generation module 360 ;
[0322] a decryption module 350 configured to, after receiving the second certificate sent by the authentication server, decrypt the second certificate using the target public key to obtain a second target signature, wherein the target public key and the target private key are a key pair generated by the authentication server;
[0323] A generation module 360 is configured to perform a hash calculation on the second public key and the second device identifier to obtain a second target digest;
[0324] The storage module 340 is further configured to store the second certificate if the second target signature is consistent with the second target digest.
[0325] Optionally, based on the embodiment corresponding to FIG. 13 above, in another embodiment of the data transmission device 30 provided in the embodiment of the present application,
[0326] The decryption module 350 is further configured to, after receiving the first certificate sent by the first device, decrypt the first certificate using the target public key to obtain a first digital signature, wherein the target public key is a public key generated by the authentication server;
[0327] The acquisition module 330 is further configured to acquire a first public key to be verified and a first identifier to be verified from the first certificate;
[0328] The generating module 360 is further configured to perform a hash calculation on the first public key to be verified and the first identifier to be verified to obtain a first message digest;
[0329] The determination module 320 is further configured to determine that the first certificate is a valid certificate if the first message digest is consistent with the first digital signature;
[0330] The determination module 320 is specifically configured to use the first public key to be verified in the first certificate as the first public key, and use the first identifier to be verified in the first certificate as the first device identifier.
[0331] Optionally, based on the embodiment corresponding to FIG. 13 above, in another embodiment of the data transmission device 30 provided in the embodiment of the present application,
[0332] The transceiver module 310 is specifically configured to decrypt the data access request using the second private key to obtain the requested data if the data access request is encrypted by the first device using the second public key; and decrypt the data access request using the first public key to obtain the requested data if the data access request is encrypted by the first device using the first private key.
[0333] Get the original data according to the request data;
[0334] Encrypting the original data using the second private key to obtain target data; or encrypting the original data using the first public key to obtain the target data;
[0335] Send target data to the first device so that the first device decrypts the target data to obtain original data. If the target data is encrypted using the second private key, the first device decrypts the target data using the second public key. If the target data is encrypted using the first public key, the first device decrypts the target data using the first private key.
[0336] Optionally, based on the embodiment corresponding to FIG. 13 above, in another embodiment of the data transmission device 30 provided in the embodiment of the present application,
[0337] The acquisition module 330 is further configured to, after determining the first public key and the first device identifier based on the first certificate, obtain a set of first device identifiers stored on the second device, wherein the set of first device identifiers includes M first registered device identifiers registered for the second device, where M is an integer greater than or equal to 1;
[0338] The determination module 320 is further configured to determine that the first device identifier is a registered identifier if the first device identifier successfully matches a first registered device identifier in the first device identifier set.
[0339] Optionally, based on the embodiment corresponding to FIG. 13 , in another embodiment of the data transmission device 30 provided in the embodiment of the present application, the data transmission device 30 further includes a display module 370 and a processing module 380 ;
[0340] Display module 370, configured to display a first device identification set;
[0341] a processing module 380 configured to, in response to a deletion operation on K first registered device identifiers in the first device identifier set, remove the K first registered device identifiers from the first device identifier set to obtain an updated first device identifier set, where K is an integer greater than or equal to 1 and less than or equal to M;
[0342] The display module 370 is further used to display a logo adding control;
[0343] The display module 370 is further configured to display a logo adding area in response to a selection operation on the logo adding control;
[0344] The processing module 380 is further configured to respond to an input operation on the identifier adding area and add T first registered device identifiers to the first device identifier set to obtain an updated first device identifier set, where T is an integer greater than or equal to 1.
[0345] Optionally, based on the embodiment corresponding to FIG. 13 , in another embodiment of the data transmission device 30 provided in the embodiment of the present application, the data transmission device 20 further includes a communication module 390 ;
[0346] The communication module 390 is configured to receive the first certificate sent by the first device and, before sending the second certificate to the first device, establish a Bluetooth connection with the first device when the second device and the first device activate the Bluetooth function, so as to establish a communication connection between the second device and the first device;
[0347] or,
[0348] The communication module 390 is further configured to receive the first certificate sent by the first device, and before sending the second certificate to the first device, establish a communication connection with the first device when the second device and the first device are connected to the same wireless hotspot;
[0349] or,
[0350] The display module 370 is further configured to receive the first certificate sent by the first device and display a QR code before sending the second certificate to the first device, wherein the QR code includes the second device identifier;
[0351] The communication module 390 is further configured to establish a communication connection with the first device when the first device scans the QR code;
[0352] or,
[0353] The display module 370 is further configured to receive the first certificate sent by the first device and display an information input area before sending the second certificate to the first device;
[0354] The communication module 390 is further configured to establish a communication connection with the first device in response to the first device identifier input into the information input area.
[0355] The data transmission device in the present application is described in detail below. Please refer to FIG14 , which is a schematic diagram of another embodiment of the data transmission device in the embodiment of the present application. The data transmission device 40 includes:
[0356] The transceiver module 410 is configured to send a first certificate to a second device and receive a second certificate sent by the second device;
[0357] a determination module 420 configured to determine, if both the first certificate and the second certificate are valid certificates, a second public key and a second device identifier based on the second certificate, wherein the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device;
[0358] The transceiver module 410 is configured to send a data access request to the second device if both the first device identifier and the second device identifier are registered identifiers, wherein the data access request is encrypted by the first device using the second public key or the first private key, the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device;
[0359] The transceiver module 410 is configured to receive target data sent by the second device, wherein the target data is encrypted by the second device using the first public key or the second private key.
[0360] Optionally, based on the embodiment corresponding to FIG. 14 , in another embodiment of the data transmission device 40 provided in the embodiment of the present application, the data transmission device 40 further includes an acquisition module 430 and a storage module 440 ;
[0361] An acquisition module 430 is configured to acquire a first public key and a first private key before sending the first certificate to the second device;
[0362] The storage module 440 is configured to store the first private key;
[0363] The transceiver module 410 is further configured to send the first public key and the first device identification to the authentication server, so that the authentication server signs the first public key and the first device identification using the target private key to obtain a first certificate;
[0364] The transceiver module 410 is further configured to receive a first certificate sent by the authentication server.
[0365] Optionally, based on the embodiment corresponding to FIG. 14 , in another embodiment of the data transmission device 40 provided in the embodiment of the present application, the data transmission device 40 further includes a decryption module 450 and a generation module 460 ;
[0366] A decryption module 450 is configured to, after receiving a first certificate sent by the authentication server, decrypt the first certificate using a target public key to obtain a first target signature, wherein the target public key and the target private key are a key pair generated by the authentication server;
[0367] A generation module 460 is configured to perform a hash calculation on the first public key and the first device identifier to obtain a first target digest;
[0368] The storage module 440 is further configured to store the first certificate if the first target signature is consistent with the first target digest.
[0369] Optionally, based on the embodiment corresponding to FIG. 14 above, in another embodiment of the data transmission device 40 provided in the embodiment of the present application,
[0370] The decryption module 450 is further configured to, after receiving the second certificate sent by the second device, decrypt the second certificate using the target public key to obtain a second digital signature, wherein the target public key is a public key generated by the authentication server;
[0371] The acquisition module 430 is further configured to acquire a second public key to be verified and a second identifier to be verified from the second certificate;
[0372] The generating module 460 is further configured to perform a hash calculation on the second public key to be verified and the second identifier to be verified to obtain a second message digest;
[0373] The determination module 420 is further configured to determine that the second certificate is a valid certificate if the second message digest is consistent with the second digital signature;
[0374] The determination module 420 is specifically configured to use the second public key to be verified in the second certificate as the second public key, and use the second identifier to be verified in the second certificate as the second device identifier.
[0375] Optionally, based on the embodiment corresponding to FIG. 14 , in another embodiment of the data transmission device 40 provided in the embodiment of the present application, the data transmission device 40 further includes an encryption module 470 ;
[0376] The encryption module 470 is configured to encrypt the request data using the second public key to obtain the data access request before sending the data access request to the second device; or to encrypt the request data using the first private key to obtain the data access request;
[0377] The transceiver module 410 is further configured to, after sending the data access request to the second device, send the data access request to the second device, so that the second device decrypts the data access request to obtain the request data; if the data access request is encrypted using the second public key, the second device decrypts the data access request using the second private key; if the data access request is encrypted using the first private key, the second device decrypts the data access request using the first public key;
[0378] or,
[0379] The decryption module 450 is also used to, after receiving the target data sent by the second device, if the target data is obtained by the second device encrypting the original data using the second private key, decrypt the target data using the second public key to obtain the original data; if the target data is obtained by the second device encrypting the original data using the first public key, decrypt the target data using the first private key to obtain the original data.
[0380] Optionally, based on the embodiment corresponding to FIG. 14 above, in another embodiment of the data transmission device 40 provided in the embodiment of the present application,
[0381] The acquisition module 430 is further configured to, after determining the second public key and the second device identifier based on the second certificate, obtain a set of second device identifiers stored on the first device, wherein the set of second device identifiers includes N second registered device identifiers registered for the first device, where N is an integer greater than or equal to 1;
[0382] The determination module 420 is further configured to determine that the second device identifier is a registered identifier if the second device identifier successfully matches a second registered device identifier in the second device identifier set.
[0383] Optionally, based on the embodiment corresponding to FIG. 14 , in another embodiment of the data transmission device 40 provided in the embodiment of the present application, the data transmission device 40 further includes a communication module 480 ;
[0384] The communication module 480 is configured to send the first certificate to the second device and, before receiving the second certificate sent by the second device, establish a Bluetooth connection with the second device when the second device and the first device activate Bluetooth functions, so as to establish a communication connection between the second device and the first device;
[0385] or,
[0386] The communication module 480 is further configured to send the first certificate to the second device and, before receiving the second certificate sent by the second device, establish a communication connection with the second device when the second device and the first device are connected to the same wireless hotspot;
[0387] or,
[0388] The communication module 480 is further configured to send the first certificate to the second device, and before receiving the second certificate sent by the second device, scan the QR code displayed on the second device to establish a communication connection with the first device, wherein the QR code includes the second device identifier.
[0389] The present application also provides a data transmission device that can be deployed on a terminal, as shown in FIG15. For ease of explanation, only the parts related to the present application are shown. For specific technical details not disclosed, please refer to the method part of the present application embodiment. In the present application embodiment, the terminal is a mobile phone as an example for explanation:
[0390] FIG15 is a block diagram showing a partial structure of a mobile phone related to a terminal provided in an embodiment of the present application. Referring to FIG15 , the mobile phone includes: a radio frequency (RF) circuit 510, a memory 520, an input unit 530 (including a touch panel 531 and other input devices 532), a display unit 540 (including a display panel 541), a sensor 550, an audio circuit 560 (connecting a speaker 561 and a microphone 562), a wireless fidelity (WiFi) module 570, a processor 580, and a power supply 590. It will be understood by those skilled in the art that the mobile phone structure shown in FIG15 does not constitute a limitation on the mobile phone, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0391] The following is an introduction to the components of the mobile phone with reference to FIG15:
[0392] The memory 520 can be used to store software programs and modules. The processor 580 executes the various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 520. The memory 520 may mainly include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 520 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0393] The processor 580 is the control center of the mobile phone. It connects all parts of the mobile phone using various interfaces and circuits. It executes the software programs and / or modules stored in the memory 520 and accesses data stored in the memory 520 to perform various functions of the mobile phone and process data. Optionally, the processor 580 may include one or more processing units. Alternatively, the processor 580 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor does not need to be integrated into the processor 580.
[0394] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0395] The steps executed by the terminal in the above embodiment may be based on the terminal structure shown in FIG15 .
[0396] A computer device is also provided in an embodiment of the present application, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the methods described in the above embodiments are implemented.
[0397] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.
[0398] A computer program product is also provided in an embodiment of the present application, including a computer program. When the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.
[0399] It is understandable that in the specific implementation of this application, related data such as user information, vehicle information, driving data, etc. are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0400] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data transmission method, performed by a second device, comprising: receiving a first certificate sent by a first device, and sending a second certificate to the first device; If both the first certificate and the second certificate are valid certificates, determining a first public key and a first device identifier according to the first certificate, wherein the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device; If both the first device identifier and the second device identifier are registered identifiers, receiving a data access request sent by the first device, wherein the data access request is encrypted by the first device using the second public key or the first private key, the second public key is obtained by the first device according to the second certificate, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device; In response to the data access request sent by the first device, target data is sent to the first device, wherein the target data is encrypted by the second device using the first public key or the second private key.
2. The method according to claim 1, before sending the second certificate to the first device, the method further comprises: Obtaining the second public key and the second private key; storing the second private key; Sending the second public key and the second device identification to an authentication server, so that the authentication server signs the second public key and the second device identification with a target private key to obtain the second certificate; Receive the second certificate sent by the authentication server.
3. The method according to claim 2, after receiving the second certificate sent by the authentication server, the method further comprises: Decrypting the second certificate using the target public key to obtain a second target signature, wherein the target public key and the target private key are a key pair generated by the authentication server; Performing hash calculation on the second public key and the second device identifier to obtain a second target digest; If the second target signature is consistent with the second target digest, the second certificate is stored.
4. The method according to claim 1, after receiving the first certificate sent by the first device, the method further comprises: Decrypting the first certificate using a target public key to obtain a first digital signature, wherein the target public key is a public key generated by an authentication server; Obtaining a first public key to be verified and a first identifier to be verified from the first certificate; Performing hash calculation on the first public key to be verified and the first identifier to be verified to obtain a first message digest; If the first message digest is consistent with the first digital signature, determining that the first certificate is a valid certificate; The determining the first public key and the first device identification according to the first certificate includes: The first public key to be verified in the first certificate is used as the first public key, and the first identifier to be verified in the first certificate is used as the first device identifier.
5. The method according to claim 1, wherein the step of sending target data to the first device in response to the data access request sent by the first device comprises: If the data access request is encrypted by the first device using the second public key, decrypting the data access request using the second private key to obtain the requested data; If the data access request is encrypted by the first device using the first private key, decrypting the data access request using the first public key to obtain the requested data; Acquire original data according to the request data; Encrypting the original data using the second private key to obtain the target data; Alternatively, the original data is encrypted using the first public key to obtain the target data; The target data is sent to the first device so that the first device decrypts the target data to obtain the original data. If the target data is encrypted using the second private key, the first device decrypts the target data using the second public key. If the target data is encrypted using the first public key, the first device decrypts the target data using the first private key.
6. The method according to claim 1, after determining the first public key and the first device identification according to the first certificate, the method further comprises: Acquire a first device identification set stored in the second device, wherein the first device identification set includes M first registered device identifications registered for the second device, where M is an integer greater than or equal to 1; If the first device identifier successfully matches a first registered device identifier in the first device identifier set, the first device identifier is determined to be a registered identifier.
7. The method according to claim 6, further comprising: Displaying the first device identification set; In response to a deletion operation on K first registered device identifiers in the first device identifier set, remove the K first registered device identifiers from the first device identifier set to obtain an updated first device identifier set, wherein K is an integer greater than or equal to 1 and less than or equal to M; The method further comprises: Display logo add controls; In response to a selection operation on the logo adding control, displaying a logo adding area; In response to an input operation on the identifier adding area, T first registered device identifiers are added to the first device identifier set to obtain an updated first device identifier set, wherein T is an integer greater than or equal to 1.
8. The method according to any one of claims 1 to 7, before receiving the first certificate sent by the first device and sending the second certificate to the first device, the method further comprises: When the second device and the first device start the Bluetooth function, establish a Bluetooth connection with the first device, so that a communication connection is established between the second device and the first device; or, When the second device and the first device are connected to the same wireless hotspot, establishing a communication connection with the first device; or, Displaying a QR code, wherein the QR code includes the second device identifier; When the first device scans the QR code, a communication connection is established with the first device; or, Display information input area; In response to the first device identification input into the information input area, a communication connection is established with the first device.
9. A data transmission method, performed by a first device, comprising: Sending a first certificate to a second device, and receiving a second certificate sent by the second device; If both the first certificate and the second certificate are valid certificates, determining a second public key and a second device identifier according to the second certificate, wherein the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device; If the first device identifier and the second device identifier are both registered identifiers, sending a data access request to the second device, wherein the data access request is encrypted by the first device using the second public key or the first private key, the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device; Receive target data sent by the second device, wherein the target data is encrypted by the second device using the first public key or the second private key.
10. The method according to claim 9, before sending the first certificate to the second device, the method further comprises: Obtaining the first public key and the first private key; storing the first private key; Sending the first public key and the first device identification to an authentication server, so that the authentication server signs the first public key and the first device identification with a target private key to obtain the first certificate; Receive the first certificate sent by the authentication server.
11. The method according to claim 10, after receiving the first certificate sent by the authentication server, the method further comprises: Decrypting the first certificate using a target public key to obtain a first target signature, wherein the target public key and the target private key are a key pair generated by the authentication server; Performing hash calculation on the first public key and the first device identifier to obtain a first target digest; If the first target signature is consistent with the first target digest, the first certificate is stored.
12. The method according to claim 9, after receiving the second certificate sent by the second device, the method further comprises: Decrypting the second certificate using a target public key to obtain a second digital signature, wherein the target public key is a public key generated by the authentication server; Obtaining a second public key to be verified and a second identifier to be verified from the second certificate; Performing hash calculation on the second public key to be verified and the second identifier to be verified to obtain a second message digest; If the second message digest is consistent with the second digital signature, determining that the second certificate is a valid certificate; The determining the second public key and the second device identification according to the second certificate includes: The second public key to be verified in the second certificate is used as the second public key, and the second identifier to be verified in the second certificate is used as the second device identifier.
13. The method according to claim 9, before sending the data access request to the second device, the method further comprises: Encrypting the request data using the second public key to obtain the data access request; Alternatively, the request data is encrypted using the first private key to obtain the data access request; After sending the data access request to the second device, the method further includes: Sending a data access request to the second device so that the second device decrypts the data access request to obtain the request data, if the data access request is encrypted using the second public key, the second device decrypts the data access request using the second private key, if the data access request is encrypted using the first private key, the second device decrypts the data access request using the first public key; After receiving the target data sent by the second device, the method further includes: If the target data is obtained by encrypting original data by the second device using the second private key, decrypting the target data using the second public key to obtain the original data; If the target data is obtained by encrypting original data by the second device using the first public key, the target data is decrypted using the first private key to obtain the original data.
14. The method according to claim 9, after determining the second public key and the second device identification according to the second certificate, the method further comprises: Acquire a second device identification set stored in the first device, wherein the second device identification set includes N second registered device identifications registered for the first device, where N is an integer greater than or equal to 1; If the second device identifier successfully matches a second registered device identifier in the second device identifier set, the second device identifier is determined to be a registered identifier.
15. The method according to any one of claims 9 to 14, before sending the first certificate to the second device and receiving the second certificate sent by the second device, the method further comprises: When the second device and the first device start the Bluetooth function, establish a Bluetooth connection with the second device, so that a communication connection is established between the second device and the first device; or, When the second device and the first device are connected to the same wireless hotspot, establishing a communication connection with the second device; or, Scan the QR code displayed on the second device to establish a communication connection with the first device, wherein the QR code includes the second device identification.
16. A data transmission device, comprising: a transceiver module, configured to receive a first certificate sent by a first device, and send a second certificate to the first device; a determination module, configured to determine a first public key and a first device identifier according to the first certificate if both the first certificate and the second certificate are valid certificates, wherein the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device; The transceiver module is further configured to receive a data access request sent by the first device if both the first device identifier and the second device identifier are registered identifiers, wherein the data access request is encrypted by the first device using the second public key or the first private key, the second public key is obtained by the first device according to the second certificate, the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device; The transceiver module is further used to respond to a data access request sent by the first device and send target data to the first device, wherein the target data is encrypted by the second device using the first public key or the second private key.
17. A data transmission device, comprising: a transceiver module, configured to send a first certificate to a second device, and receive a second certificate sent by the second device; a determination module, configured to determine a second public key and a second device identifier according to the second certificate if both the first certificate and the second certificate are valid certificates, wherein the second public key and the second private key are a key pair generated by the second device, and the second device identifier is an identifier corresponding to the second device; The transceiver module is further configured to send a data access request to the second device if both the first device identifier and the second device identifier are registered identifiers, wherein the data access request is encrypted by the first device using the second public key or the first private key, the first public key and the first private key are a key pair generated by the first device, and the first device identifier is an identifier corresponding to the first device; The transceiver module is further used to receive target data sent by the second device, wherein the target data is encrypted by the second device using the first public key or the second private key.
18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 8, or the steps of the method according to any one of claims 9 to 15 when executing the computer program.
19. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 or the steps of the method according to any one of claims 9 to 15 are implemented.
20. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method of any one of claims 1 to 8, or the steps of the method of any one of claims 9 to 15.
