A data transmission method, related device, equipment and storage medium
By extending the key and certificate system to a decentralized peer-to-peer network and using local keys and certificates for identity authentication, the problem of security risks in driving recorder data transmission is solved and high-security and privacy data transmission is achieved. .
Patent Information
- Application Number
- CN202210530907.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-05-16
AI Technical Summary
In the existing driving recorder data transmission solution, keys and certificates are stored in third-party servers, which poses security risks and makes it difficult to meet regulatory needs, especially in terms of data privacy and reliability.
Expand the key and certificate system into a decentralized peer-to-peer network, allowing terminals to use locally stored keys and certificates for identity authentication, thereby improving the security and privacy of data transmission. Specific implementation includes certificate exchange and key usage between devices to ensure the encryption and decryption process of data access requests and responses.
Through the use of local keys and certificates, the security and privacy of driving recorder data transmission are improved, meeting regulatory requirements and ensuring reliable data transmission.
Smart Images

Figure CN115150091B
Abstract
Description
Technical Field
[0001] The present application relates to the fields of security technology and vehicle networking technology, and in particular to a data transmission method, related devices, equipment and storage medium. Background Art
[0002] In recent years, with the popularization of the Internet of Things and mobile networks, driving recorders have developed rapidly. Driving recorders are one of the items installed in the car, and their functions have gradually evolved from pure positioning records to multi-faceted records. This enables remote capture of pictures and videos, analysis of driver driving behavior, real-time remote live broadcast, and location trajectory.
[0003] At present, driving data can be stored in the cloud by cloud transfer or cloud storage. The keys and certificates are stored on third-party servers, and the risks are relatively controllable. When the car owner wants to access the driving recorder on the vehicle system, he directly initiates an access request to the cloud, and the cloud feeds back the driving data on the vehicle system to the user.
[0004] However, the inventors have found that the existing solutions have at least the following problems: considering that driving data is highly private, storing both the key and the certificate on a third-party server still poses certain security risks. That is, driving data may be stolen or tampered with, making it difficult for the existing solutions to meet regulatory requirements. Summary of the invention
[0005] The embodiments of the present application provide a method, related apparatus, device and storage medium for data transmission. The present application extends the key and certificate system to a decentralized peer-to-peer network, so that terminals in the peer-to-peer network can use keys and certificates stored locally to achieve identity authentication, thereby facilitating the improvement of the security, privacy and reliability of data transmission.
[0006] In view of this, the present application provides, on one hand, a method for data transmission, comprising:
[0007] receiving a first certificate sent by the first device, and sending a second certificate to the first device;
[0008] If both the first certificate and the second certificate are valid certificates, determining the first public key and the 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;
[0009] 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 second device identifier and the second public key are obtained by the first device according to the second certificate, the data access request is encrypted by the first device using the second public key or the first private key, 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;
[0010] In response to a 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.
[0011] Another aspect of the present application provides a method for data transmission, comprising:
[0012] Sending a first certificate to a second device, and receiving a second certificate sent by the second device;
[0013] If both the first certificate and the second certificate are valid certificates, determining the second public key and the 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;
[0014] If the first device identifier and the second device identifier are both registered identifiers, a data access request is sent to the second device, wherein the first device identifier and the first public key are obtained by the second device according to the first certificate, 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;
[0015] Receive 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.
[0016] Another aspect of the present application provides a data transmission device, comprising:
[0017] A transceiver module, configured to receive a first certificate sent by a first device, and send a second certificate to the first device;
[0018] 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;
[0019] 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 second device identifier and the second public key are obtained by the first device according to the second certificate, the data access request is encrypted by the first device using the second public key or the first private key, 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;
[0020] The transceiver module is also used to respond to the 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.
[0021] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes an acquisition module and a storage module;
[0022] An acquisition module, used for acquiring a second public key and a second private key before sending the second certificate to the first device;
[0023] A storage module, used for storing a second private key;
[0024] The transceiver module is further used to send the second public key and the second device identification to the authentication server, so that the authentication server uses the target private key to sign the second public key and the second device identification to obtain a second certificate;
[0025] The transceiver module is also used to receive the second certificate sent by the authentication server.
[0026] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes a decryption module and a generation module;
[0027] A decryption module is used 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;
[0028] A generation module, configured to perform a hash calculation on the second public key and the second device identifier to obtain a second target digest;
[0029] The storage module is further configured to store the second certificate if the second target signature is consistent with the second target digest.
[0030] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0031] The decryption module is further configured to, after receiving the first certificate sent by the first device, use the target public key to decrypt the first certificate to obtain a first digital signature, wherein the target public key is a public key generated by the authentication server;
[0032] The acquisition module is further used to acquire the first public key to be verified and the first identifier to be verified from the first certificate;
[0033] The generating module is further used to perform hash calculation on the first public key to be verified and the first identifier to be verified to obtain a first message digest;
[0034] The determination module 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;
[0035] The determination module 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.
[0036] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0037] The transceiver module 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;
[0038] Get the original data according to the request data;
[0039] The original data is encrypted using the second private key to obtain the target data;
[0040] Sending target data to the first device, so that the first device decrypts the target data using the second public key to obtain original data;
[0041] or,
[0042] The transceiver module 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;
[0043] Get the original data according to the request data;
[0044] The original data is encrypted using the first public key to obtain the target data;
[0045] Sending target data to the first device, so that the first device decrypts the target data using the first private key to obtain original data;
[0046] or,
[0047] The transceiver module is specifically configured to 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;
[0048] Get the original data according to the request data;
[0049] The original data is encrypted using the second private key to obtain the target data;
[0050] Sending target data to the first device, so that the first device decrypts the target data using the second public key to obtain original data;
[0051] or,
[0052] The transceiver module is specifically configured to 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;
[0053] Get the original data according to the request data;
[0054] The original data is encrypted using the first public key to obtain the target data;
[0055] The target data is sent to the first device, so that the first device decrypts the target data using the first private key to obtain the original data.
[0056] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0057] The acquisition module is further used to obtain a set of first device identifiers stored in the second device after determining the first public key and the first device identifier according to the first certificate, wherein the set of first device identifiers includes M first device identifiers registered for the second device, where M is an integer greater than or equal to 1;
[0058] The determination module is further configured to determine that the first device identifier is a registered identifier if the first device identifier successfully matches one of the first device identifiers in the first device identifier set.
[0059] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes a display module and a processing module;
[0060] A display module, configured to display a first device identification set;
[0061] a processing module, configured to respond to a deletion operation on K first device identifiers in the first device identifier set, remove K first device identifiers from the first device identifier set, and obtain an updated first device identifier set, wherein K is an integer greater than or equal to 1 and less than M;
[0062] The display module is also used to display the logo adding controls;
[0063] The display module is further used to respond to a selection operation on the logo adding control and display the logo adding area;
[0064] The processing module is further used to respond to an input operation on the identification adding area, add T first device identifications to the first device identification set, and obtain an updated first device identification set, wherein T is an integer greater than or equal to 1.
[0065] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes a communication module;
[0066] A communication module, configured to receive a first certificate sent by a first device, and before sending a second certificate to the first device, when the second device and the first device start a 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;
[0067] or,
[0068] The communication module is further used to receive the first certificate sent by the first device, and before sending the second certificate to the first device, when the second device and the first device are connected to the same wireless hotspot, establish a communication connection with the first device;
[0069] or,
[0070] The display module is further used 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 identification;
[0071] The communication module is further used to establish a communication connection with the first device when the first device scans the QR code;
[0072] or,
[0073] The display module is further used to receive the first certificate sent by the first device, and display the information input area before sending the second certificate to the first device;
[0074] The communication module is further used to establish a communication connection with the first device in response to the first device identifier input into the information input area.
[0075] Another aspect of the present application provides a data transmission device, comprising:
[0076] A transceiver module, used to send a first certificate to a second device, and receive a second certificate sent by the second device;
[0077] 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;
[0078] 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 first device identifier and the first public key are obtained by the second device according to the first certificate, 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;
[0079] 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.
[0080] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes an acquisition module and a storage module;
[0081] An acquisition module, used to acquire a first public key and a first private key before sending the first certificate to the second device;
[0082] A storage module, used for storing a first private key;
[0083] The transceiver module is further used to send the first public key and the first device identification to the authentication server, so that the authentication server uses the target private key to sign the first public key and the first device identification to obtain a first certificate;
[0084] The transceiver module is also used to receive the first certificate sent by the authentication server.
[0085] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes a decryption module and a generation module;
[0086] A decryption module, 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;
[0087] A generation module, configured to perform a hash calculation on the first public key and the first device identifier to obtain a first target digest;
[0088] The storage module is further configured to store the first certificate if the first target signature is consistent with the first target digest.
[0089] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0090] The decryption module is further used to, after receiving the second certificate sent by the second device, use the target public key to decrypt the second certificate to obtain a second digital signature, wherein the target public key is a public key generated by the authentication server;
[0091] The acquisition module is further used to acquire the second public key to be verified and the second identifier to be verified from the second certificate;
[0092] The generating module is further used to perform hash calculation on the second public key to be verified and the second identifier to be verified to obtain a second message digest;
[0093] The determination module 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;
[0094] The determination module 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.
[0095] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes an encryption module;
[0096] an encryption module, configured to encrypt the request data using the second public key before sending the data access request to the second device to obtain the data access request;
[0097] The transceiver module is further used to send the data access request to the second device after sending the data access request to the second device, so that the second device uses the second private key to decrypt the data access request to obtain the requested data;
[0098] or,
[0099] The encryption module is further used to encrypt the request data using the first private key to obtain the data access request before sending the data access request to the second device;
[0100] The transceiver module is further used to send the data access request to the second device after sending the data access request to the second device, so that the second device uses the first public key to decrypt the data access request to obtain the requested data;
[0101] or,
[0102] The decryption module is further configured to, after receiving the target data sent by the second device, decrypt the target data using the second public key to obtain the original data if the target data is obtained by encrypting the original data using the second private key by the second device;
[0103] The decryption module 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 first public key, decrypt the target data using the first private key to obtain the original data.
[0104] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0105] The acquisition module is further used to obtain a set of second device identifiers stored in the first device after determining the second public key and the second device identifier according to the second certificate, wherein the set of second device identifiers includes N second device identifiers registered for the first device, where N is an integer greater than or equal to 1;
[0106] The determination module is further configured to determine that the second device identifier is a registered identifier if the second device identifier successfully matches one of the second device identifiers in the second device identifier set.
[0107] In one possible design, in another implementation of another aspect of the embodiment of the present application, the data transmission device further includes a communication module;
[0108] A communication module, configured to send the first certificate to the second device, and before receiving the second certificate sent by the second device, 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;
[0109] or,
[0110] The communication module is further used to send the first certificate to the second device, and before receiving the second certificate sent by the second device, when the second device and the first device are connected to the same wireless hotspot, establish a communication connection with the second device;
[0111] or,
[0112] The communication module is also used 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 identification.
[0113] 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:
[0114] The vehicle-mounted terminal receives the first certificate sent by the mobile terminal;
[0115] The mobile terminal receives the second certificate sent by the vehicle-mounted terminal;
[0116] If both the first certificate and the second certificate are valid certificates, the vehicle-mounted terminal determines the first public key and the first device identifier according to the first certificate, and the mobile terminal determines the second public key and the second device identifier according to the second certificate, wherein the first public key and the first private key are a public key pair generated by the mobile terminal, the second public key and the second private key are a public key pair generated by the vehicle-mounted terminal, the first device identifier is an identifier corresponding to the mobile terminal, and the second device identifier is an identifier corresponding to the vehicle-mounted terminal;
[0117] 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;
[0118] The vehicle-mounted terminal responds to the data access request sent by the mobile terminal, and sends the 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.
[0119] Another aspect of 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.
[0120] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned methods are implemented.
[0121] 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.
[0122] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0123] In an embodiment of the present application, a method for data transmission is provided. First, a second device receives a first certificate sent by a first device and sends a second certificate to the first device. At this time, 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 according to the first certificate. Based on this, if both the first device identifier and the second device identifier are registered identifiers, the second device responds to the data access request sent by the first device and sends the target data to the first device. Among them, the first public key and the first private key are key pairs generated by the first device, the first device identifier is the identifier corresponding to the first device, the second public key and the second private key are key pairs generated by the second device, and the second device identifier is the 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. In the above manner, the key and certificate system is extended to a decentralized peer-to-peer network (Peer to Peer, P2P), so that terminals in the P2P network (for example, vehicle-mounted terminals and mobile terminals) can use keys and certificates stored locally to achieve identity authentication, which is conducive to improving the security, privacy and reliability of data transmission between terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0124] Figure 1 A schematic diagram of the architecture of a data transmission system in an embodiment of the present application;
[0125] Figure 2 This is a schematic diagram of an environment of a vehicle networking system in an embodiment of the present application;
[0126] Figure 3 A schematic diagram of a flow chart of a data transmission method in an embodiment of the present application;
[0127] Figure 4 This is a schematic diagram of a vehicle terminal workflow based on the Internet of Vehicles system in an embodiment of the present application;
[0128] Figure 5 A schematic diagram of an interface for releasing a terminal identification binding relationship in an embodiment of the present application;
[0129] Figure 6 A schematic diagram of an interface for adding a terminal identification binding relationship in an embodiment of the present application;
[0130] Figure 7 A communication diagram of an intelligent connected vehicle in an embodiment of the present application;
[0131] Figure 8 A schematic diagram of implementing terminal communication based on a QR code in an embodiment of the present application;
[0132] Fig. 9A schematic diagram of implementing terminal communication based on manually input information in an embodiment of the present application;
[0133] Fig.10 Another flowchart of the data transmission method in the embodiment of the present application;
[0134] Fig.11 This is a schematic diagram of a mobile terminal workflow based on the Internet of Vehicles system in an embodiment of the present application;
[0135] Fig.12 A schematic diagram of an interaction process based on a vehicle networking system in an embodiment of the present application;
[0136] Fig.13 A schematic diagram of a data transmission device in an embodiment of the present application;
[0137] Fig.14 Another schematic diagram of the data transmission device in the embodiment of the present application;
[0138] Fig.15 It is a structural diagram of a terminal in an embodiment of the present application. DETAILED DESCRIPTION
[0139] The embodiments of the present application provide a method, related apparatus, device and storage medium for data transmission. The present application extends the key and certificate system to a decentralized peer-to-peer network, so that terminals in the peer-to-peer network can use keys and certificates stored locally to achieve identity authentication, thereby facilitating the improvement of the security, privacy and reliability of data transmission.
[0140] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0141] As new energy vehicles become increasingly popular, regulations require that, except for the car owner, no other third party can access the contents of the on-board dashcam, including third-party service providers. Therefore, this requires that even the car companies themselves and solution providers cannot store the customer's keys. However, it is also 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.
[0142] As a new type of network application, P2P has some advantages that the client-server (C / S) model does not have, mainly in the expansion of information volume and the freedom and openness of anonymous services. The biggest advantage of P2P is that it can provide reliable and convenient information query. In a P2P network, peer nodes share some of their resources. These shared resources provide services and content through the network and can be directly accessed by other peer nodes without going through an intermediate entity. It can be seen that peer nodes are both resource providers (i.e., servers) and resource acquirers (i.e., clients) in a P2P network.
[0143] In order to improve the security, privacy and reliability of data transmission in P2P networks. Figure 1 The data transmission system shown, as shown in the figure, includes several node devices, and the number of node devices is not limited. The node device can be a server or a terminal, and this application is introduced as an example of a node device as a terminal. The client is deployed on the terminal, wherein the client can be run on the terminal in the form of a browser, or can be run on the terminal in the form of an independent application (application, APP), etc. The specific presentation form of the client is not limited here. The server involved in this application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or 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 (Content Delivery Network, CDN), 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 vehicle-mounted terminal and an aircraft, etc., but is not limited thereto. The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0144] P2P promotes 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 easier understanding, please refer to Figure 2 , Figure 2 This is a schematic diagram of the environment of the Internet of Vehicles system in the embodiment of the present application. As shown in the figure, information sharing between vehicles, vehicles and equipment, vehicles and roads, and vehicles and clouds is realized through information communication technology. In the process of Internet of Vehicles communication, an identity authentication system is established to give reliable digital identities to infrastructure such as vehicles, road test equipment (Road Side Unit, RSU) and information service platforms to resist security attacks such as information forgery and tampering.
[0145] The Internet of Vehicles is the application of the Internet of Things (IOT) in the automotive industry. The Internet of Things refers to the real-time collection of any object or process that needs to be connected and interacted through various devices and technologies such as various information sensors, radio frequency identification technology, global positioning system, infrared sensor, laser scanner, etc., and the collection of various required information such as sound, light, heat, electricity, mechanics, chemistry, biology, location, etc. Through various possible network access, it realizes ubiquitous connection between objects and objects, objects and people, and realizes intelligent perception, identification and management of objects and processes. The Internet of Things is an information carrier based on the Internet, traditional telecommunications networks, etc. It allows all ordinary physical objects that can be independently addressed to form an interconnected network.
[0146] 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 massive data storage and computing through cloud computing technology. Due to the characteristics of IoT, objects 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 out useful information from the massive information to support decision-making for subsequent development have become key issues affecting the development of IoT. IoT Cloud based on cloud computing and cloud storage technology has therefore become a strong support for IoT technology and applications.
[0147] Since this application involves some terms related to professional fields, they will be explained below for ease of understanding.
[0148] (1) Car: generally refers to smart cars or smart connected cars.
[0149] (2) In-vehicle terminal: It can be equipped with an in-vehicle system (i.e., the system used by the car), usually 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 is already very secure and cannot be cracked, so the private key cannot be obtained.
[0150] (3) Car owner: the owner of the car. In this application, it refers to the car owner's mobile terminal, including but not limited to computers and mobile phones. In this application, it is assumed that the account system of the mobile terminal is already very secure and the data of the car owner's terminal and the private key therein will not be obtained by other users.
[0151] (4) Public key and private key: that is, a key pair for asymmetric encryption, in which the private key is kept by oneself.
[0152] (5) Device identity (TID): The unique identification (ID) of a device. Usually, both the vehicle-mounted terminal and the mobile terminal have their own TID.
[0153] (6) Mobile ID (MID): This refers to the ID of the vehicle terminal. This part can also be provided by the vehicle owner’s account.
[0154] (7) Car ID (CID): indicates the TID of the car terminal.
[0155] (8) Owner account: the login account of the car manufacturer’s APP.
[0156] (9) Certificate: Indicates that a public key belongs to a certain TID. The certificate is signed by an authority and can therefore be verified.
[0157] (10) Root certificate: the public key file of an authority, a self-signed certificate.
[0158] (11) Authority: that is, the issuing authority of the certificate (CA), which is the core of the public key infrastructure (PKI). It is mainly used to store private keys, provide root certificates, issue certificates, authenticate certificates, manage issued certificates, etc. Generally, traffic scheduling, session maintenance, and load balancing are completed by the authority.
[0159] Combined with the above introduction, the following will introduce the method of data transmission in this application, please refer to Figure 3 In the embodiment of the present application, the method for data transmission may be executed by a terminal. For example, the terminal may be a vehicle-mounted terminal, including:
[0160] 110. The second device receives the first certificate sent by the first device, and sends a second certificate to the first device;
[0161] In one or more embodiments, after the first device establishes a communication connection with the second device, the first device sends the first certificate to the second device, and the second device sends the second certificate to the first device. The first device may be a mobile terminal (e.g., a mobile phone, a tablet computer, or a computer), and the second device may be a vehicle-mounted terminal.
[0162] Specifically, after the mobile terminal establishes a communication connection with the vehicle terminal, the mobile terminal sends a first certificate to the vehicle terminal, whereby the vehicle terminal receives the first certificate. Similarly, the vehicle terminal sends a second certificate to the mobile terminal, whereby the mobile terminal receives the second certificate.
[0163] 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 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;
[0164] 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.
[0165] Specifically, the vehicle-mounted terminal obtains a first public key and a first device identification 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 may be a public key of the mobile terminal, and the first private key may be a private key of the mobile terminal. The first device identification is the TID of the mobile terminal, that is, the MID. Similarly, the mobile terminal obtains a second public key and a second device identification 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 may be a public key of the vehicle-mounted terminal, and the second private key may be a private key of the vehicle-mounted terminal. The second device identification is the TID of the vehicle-mounted terminal, that is, the CID.
[0166] 130. If both the first device identifier and the second device identifier are registered identifiers, the second device receives the data access request sent by the first device, wherein the second device identifier and the second public key are obtained by the first device according to the second certificate, the data access request is encrypted by the first device using the second public key or the first private key, 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;
[0167] 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 the first device identifier and the second device identifier are both registered identifiers, the first device can 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.
[0168] Specifically, the mobile terminal encrypts the data access request using the vehicle-mounted terminal public key or the mobile terminal private key, and based on this, the mobile terminal sends the data access request to the vehicle-mounted terminal.
[0169] 140. The second device responds to the data access request sent by the first device and sends 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.
[0170] In one or more embodiments, the second device uses the first public key or the second private key to encrypt the original data based on the data access request sent by the first device, thereby obtaining the target data. Then, the second device can send the target data to the first device.
[0171] Specifically, the vehicle terminal responds to the data access request and uses the mobile terminal public key or the vehicle terminal private key to encrypt the original data to obtain the target data. Then, the vehicle terminal sends the target data to the mobile terminal. The original data can be the driving data collected by the driving recorder, including but not limited to the voice, photos, video records, etc. collected during driving.
[0172] In an embodiment of the present application, a method for data transmission is provided. By the above method, the key and certificate system is extended to the decentralized P2P, so that the terminals in the P2P network (for example, vehicle-mounted terminals and mobile terminals) can use the keys and certificates stored locally to achieve identity authentication, thereby facilitating the improvement of the security, privacy and reliability of data transmission between terminals.
[0173] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, before the second device sends the second certificate to the first device, the following may also be included:
[0174] The second device obtains a second public key and a second private key;
[0175] The second device stores a second private key;
[0176] 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 with the target private key to obtain a second certificate;
[0177] The second device receives the second certificate sent by the authentication server.
[0178] In one or more embodiments, a method for a second device to apply for a certificate from an authority is introduced. It can be seen from the aforementioned embodiments that before the second device sends the second certificate to the first device, it is necessary to apply for the second certificate from the authority. First, the second device generates a key pair, that is, a second public key and a second private key. Then, on the one hand, the second device needs to store the second private key locally. On the other hand, the second device sends the second public key and the second device identification to the authentication server of the authority, and the authentication server signs the second public key and the second device identification with its own target private key to obtain the second certificate. Finally, the authentication server feeds back the second certificate to the second device.
[0179] For ease of understanding, please refer to the following example: Figure 4 , Figure 4 This is a schematic diagram of a vehicle terminal workflow based on a vehicle networking system in an embodiment of the present application, as shown in the figure, specifically:
[0180] In step A1, the vehicle terminal pre-installs the root certificate of the authority before leaving the factory. During the initialization process after leaving the factory, the vehicle terminal generates a key pair (i.e., the vehicle terminal public key and the vehicle terminal private key). Among them, the vehicle terminal private key is saved by the vehicle terminal itself and is not leaked. It can be seen that no one except the vehicle terminal can know the vehicle terminal private key.
[0181] It should be noted that the key pair may be generated by an algorithm, or by an encryption chip, which is not limited here.
[0182] In step A2, the vehicle terminal obtains its own CID and binds the vehicle terminal public key. Based on this, the vehicle terminal initiates a Hyper Text 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 the issuance of a certificate.
[0183] In step A3, after receiving the request from 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).
[0184] 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 preventing the vehicle terminal from being hijacked and obtaining the wrong certificate to the greatest extent. Based on this, the vehicle terminal saves the certificate (i.e., the second certificate).
[0185] 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.
[0186] 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, and other visitors can communicate with it securely.
[0187] Secondly, in the embodiment of the present application, a method is provided for a second device to apply for a certificate from an authority. Through the above method, the node device has the corresponding certificate, which is authentic and can confirm the identity of the sender of the information. Therefore, by cooperating with the method of exchanging certificates between node devices, the communication between devices can become safe and reliable.
[0188] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, after the second device receives the second certificate sent by the authentication server, the following may also be included:
[0189] The second device uses the target public key to decrypt the second certificate 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;
[0190] The second device performs a hash calculation on the second public key and the second device identifier to obtain a second target digest;
[0191] If the second target signature is consistent with the second target digest, the second device stores the second certificate.
[0192] In one or more embodiments, a method for a second device to verify a second certificate is introduced. It can be seen from the aforementioned embodiments that 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 an authority (i.e., an 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 summary. If the second target signature is consistent with the second target summary, 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.
[0193] 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, that is:
[0194] signature_2=publickey_CA(DC_2);
[0195] Wherein, 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.
[0196] The second public key and the second device identifier are hashed to obtain the second target digest, namely:
[0197] digest_2=hash(publickey_2+CID);
[0198] Wherein, digest_2 represents the second target digest, hash() represents hash calculation, publickey_2 represents the second public key, and CID represents the second device identifier.
[0199] 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 reapply to the authority for a certificate.
[0200] Again, in the embodiment of the present application, a method for the second device to verify the second certificate is provided. Through the above method, after obtaining the second certificate, the second device can also verify the legitimacy of the second certificate. In this way, the legitimacy of its own local certificate is ensured, thereby improving the security and reliability of communication.
[0201] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, after the second device receives the first certificate sent by the first device, the method may further include:
[0202] The second device uses the target public key to decrypt the first certificate to obtain a first digital signature, wherein the target public key is a public key generated by the authentication server;
[0203] The second device obtains the first public key to be verified and the first identifier to be verified from the first certificate;
[0204] 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;
[0205] If the first message digest is consistent with the first digital signature, the second device determines that the first certificate is a valid certificate;
[0206] The second device determines the first public key and the first device identifier according to the first certificate, which may specifically include:
[0207] 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.
[0208] In one or more embodiments, a method for a second device to verify a first certificate is introduced. It can be seen from the aforementioned embodiments that the second device pre-installs a root certificate of an authority before leaving the factory, wherein the root certificate includes a target public key. Based on this, the target public key can be used to decrypt the first certificate to obtain a first digital signature. In addition, the second device can obtain the first public key to be verified and the first identifier to be verified in plain text 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.
[0209] 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, that is:
[0210] signature_A=publickey_CA(DC_A);
[0211] Wherein, 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.
[0212] A hash calculation is performed on the first public key to be verified and the first identifier to be verified to obtain a first message digest, namely:
[0213] digest_A=hash(publickey_A+MID_A);
[0214] Wherein, 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.
[0215] 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. On the contrary, if they are inconsistent, the second device will not transmit data to the first device.
[0216] Secondly, in the embodiment of the present application, a method for a second device to verify a first certificate is provided. Through the above method, after obtaining the first certificate, the second device can also verify the validity of the first certificate to prevent other devices from using forged certificate request data, thereby improving the security and reliability of communication.
[0217] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, 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:
[0218] 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;
[0219] The second device obtains original data according to the request data;
[0220] The second device encrypts the original data using the second private key to obtain the target data;
[0221] 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;
[0222] or,
[0223] 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:
[0224] 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;
[0225] The second device obtains original data according to the request data;
[0226] The second device encrypts the original data using the first public key to obtain the target data;
[0227] 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;
[0228] or,
[0229] 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:
[0230] 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;
[0231] The second device obtains original data according to the request data;
[0232] The second device encrypts the original data using the second private key to obtain the target data;
[0233] 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;
[0234] or,
[0235] 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:
[0236] 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;
[0237] The second device obtains original data according to the request data;
[0238] The second device encrypts the original data using the first public key to obtain the target data;
[0239] 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.
[0240] In one or more embodiments, multiple ways of securely communicating based on different keys are introduced. As can be seen from the above embodiments, the second device locally stores the second private key, and the second device can obtain the first public key. The first device locally stores the first private key, and the first device can obtain the second public key.
[0241] The following will take the first device as a mobile terminal and the second device as a vehicle terminal as an example. Among them, the first public key is the public key of the mobile terminal, the first private key is the private key of the mobile terminal, the second public key is the public key of the vehicle terminal, and the second private key is the private key of the vehicle terminal. Assume that the user chooses to view the driving data from 15:00 to 17:00 on May 3, 2022 through the mobile terminal, thereby obtaining the user's requested data.
[0242] Method 1:
[0243] The mobile terminal can use the vehicle terminal public key to encrypt the request data to obtain the data access request. Then, the mobile terminal sends the data access request to the vehicle terminal, and the vehicle terminal can use the vehicle terminal private key to decrypt the data access request to obtain the request data. The vehicle terminal calls the corresponding driving data as the original data based on the request data. Then the vehicle terminal uses the vehicle terminal private key to encrypt the original data to obtain the target data. The vehicle terminal sends the target data to the mobile terminal, and the mobile terminal can use the vehicle terminal public key to decrypt the target data to obtain the original data.
[0244] Method 2:
[0245] The mobile terminal can use the vehicle terminal public key to encrypt the request data to obtain the data access request. Then, the mobile terminal sends the data access request to the vehicle terminal, and the vehicle terminal can use the vehicle terminal private key to decrypt the data access request to obtain the request data. The vehicle terminal calls the corresponding driving data as the original data based on the request data. Then the vehicle terminal uses the mobile terminal public key to encrypt the original data to obtain the target data. The vehicle terminal sends the target data to the mobile terminal, and the mobile terminal can use the mobile terminal private key to decrypt the target data to obtain the original data.
[0246] Method 3:
[0247] The mobile terminal can use the mobile terminal private key to encrypt the request data to obtain the data access request. Then, the mobile terminal sends the data access request to the vehicle terminal, and the vehicle terminal can use the mobile terminal public key to decrypt the data access request to obtain the request data. The vehicle terminal calls the corresponding driving data as the original data based on the request data. Then the vehicle terminal uses the vehicle terminal private key to encrypt the original data to obtain the target data. The vehicle terminal sends the target data to the mobile terminal, and the mobile terminal can use the vehicle terminal public key to decrypt the target data to obtain the original data.
[0248] Method 4:
[0249] The mobile terminal can use the mobile terminal private key to encrypt the request data to obtain the data access request. Then, the mobile terminal sends the data access request to the vehicle terminal, and the vehicle terminal can use the mobile terminal public key to decrypt the data access request to obtain the request data. The vehicle terminal calls the corresponding driving data as the original data based on the request data. Then the vehicle terminal uses the mobile terminal public key to encrypt the original data to obtain the target data. The vehicle terminal sends the target data to the mobile terminal, and the mobile terminal can use the mobile terminal private key to decrypt the target data to obtain the original data.
[0250] Secondly, in the embodiment of the present application, multiple ways of secure communication based on different keys are provided. 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.
[0251] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, 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 may also be included:
[0252] The second device obtains a first device identification set stored in the second device, wherein the first device identification set includes M first device identifications registered for the second device, where M is an integer greater than or equal to 1;
[0253] If the first device identifier successfully matches one of the first device identifiers in the first device identifier set, the second device determines that the first device identifier is a registered identifier.
[0254] In one or more embodiments, a method for determining whether a device identifier is a registered identifier is introduced. As can be seen from the aforementioned embodiments, a first device can register the first device identifier to a second device through a Bluetooth protocol or other secure channel. Based on this, the second device needs to match the received first device identifier. If the match is successful, it means that the first device is a device that has been registered, that is, the first device identifier is determined to be a registered identifier.
[0255] Specifically, the following will take the first device as a mobile terminal and the second device as a vehicle terminal as an example. A user can bind M MIDs to a vehicle terminal, that is, M mobile terminals are allowed to communicate with one vehicle terminal. For ease of understanding, please refer to Table 1, which is a schematic diagram of M MIDs registered to a vehicle terminal.
[0256] Table 1
[0257] CID MID CID_0001 MID_0235659 CID_0001 MID_0254981 CID_0001 MID_0264154
[0258] It can be seen that the same vehicle terminal (ie, 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 device identifiers, wherein the three first device identifiers are MID_0235659, MID_0254981 and MID_0264154 respectively.
[0259] Secondly, in the embodiment of the present application, a method for determining whether a device identification is a registered identification is provided. In the above method, the first device can register its own first device identification to the second device, which is stored by the second device. By verifying the device identification, it can be determined whether it is the same as the identity that has been registered, thereby improving the security and reliability of device communication.
[0260] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, another optional embodiment provided by the embodiment of the present application may further include:
[0261] The second device displays the first device identification set;
[0262] The second device responds to the deletion operation on the K first device identifiers in the first device identifier set, removes the K first device identifiers from the first device identifier set, and obtains an updated first device identifier set, where K is an integer greater than or equal to 1 and less than M;
[0263] It may also include:
[0264] The second device displays a logo adding control;
[0265] The second device displays a logo adding area in response to a selection operation on the logo adding control;
[0266] In response to the input operation on the identifier adding area, the second device adds T first 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.
[0267] In one or more embodiments, a method of binding and unbinding device identifiers is introduced. 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 will take the second device as an in-vehicle terminal as an example, and introduce the process of identifier binding and unbinding in combination with diagrams.
[0268] 1. Unbind the terminal ID binding relationship;
[0269] Specifically, for ease of understanding, see Figure 5 , Figure 5 FIG. 1 is a schematic diagram of an interface for releasing a terminal identification binding relationship in an embodiment of the present application. Figure 5 As shown in Figure (A), B1 is used to indicate the list of MIDs that have been bound to "CID_0001", of which 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 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 following. Figure 5 In the interface shown in Figure (B), the selected "MID_0235659" has been unbound from "CID_0001".
[0270] 2. Add terminal identification binding relationship;
[0271] Specifically, for ease of understanding, see Figure 6 , Figure 6 This is a schematic diagram of an interface for adding a terminal identification binding relationship in an embodiment of the present application, such as Figure 6 As shown in Figure (A), C1 is used to indicate the list of MIDs that have been bound to "CID_0001", of which there are currently 2 MIDs bound to "CID_0001". C2 is used to indicate the identifier adding control. After the user clicks the identifier adding control indicated by C3, the identifier adding area indicated by C3 will be displayed. Based on this, the user can enter the corresponding MID in the identifier adding area, for example, "MID_0264154". Since only one MID is added here, T is equal to 1. After the input is completed, it will be displayed as follows Figure 6 In the interface shown in Figure (B), the selected "MID_0264154" has been successfully unbound from "CID_0001".
[0272] Again, in the embodiment of the present application, a method for binding and unbinding device identification is provided. In this way, if the user's mobile terminal is lost, the previously bound MID can be deleted in the vehicle terminal and the loss can be reported in time to avoid being used by criminals. At the same time, the results are visualized on the vehicle terminal, so even if there is a malicious intrusion, it can be discovered in time and the malicious access party can be removed.
[0273] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in another optional embodiment provided by 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 may also be included:
[0274] When the second device and the first device start 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;
[0275] or,
[0276] Before the second device receives the first certificate sent by the first device and sends the second certificate to the first device, the method may further include:
[0277] 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;
[0278] or,
[0279] Before the second device receives the first certificate sent by the first device and sends the second certificate to the first device, the method further includes:
[0280] The second device displays a QR code, wherein the QR code includes an identification of the second device;
[0281] When the first device scans the QR code, the second device establishes a communication connection with the first device;
[0282] or,
[0283] Before the second device receives the first certificate sent by the first device and sends the second certificate to the first device, the method may further include:
[0284] The second device displays an information input area;
[0285] The second device establishes a communication connection with the first device in response to the first device identification input into the information input area.
[0286] In one or more embodiments, multiple ways of establishing a communication connection are introduced. As can be seen from the aforementioned embodiments, data can be transmitted after the first device and the second device establish a communication connection. Therefore, the following will take the first device as a mobile terminal and the second device as a vehicle-mounted terminal as an example to illustrate the way of establishing a communication connection.
[0287] It is understandable that the vehicle terminal is deployed in the intelligent connected car. For ease of understanding, please refer to Figure 7 , Figure 7 This is a communication diagram of a smart connected car in an embodiment of the present application. As shown in the figure, a smart connected car usually has a wireless hotspot (Wi-Fi) function, a Bluetooth function, a camera function, a global positioning system (GPS) function, a radar function, a communication function, etc. Based on this, the vehicle terminal can have built-in Wi-Fi function, Bluetooth function, GPS function and communication function, etc.
[0288] Association method 1;
[0289] The vehicle-mounted terminal and the mobile terminal can establish a connection by using a near field communication method. For example, the vehicle-mounted terminal and the mobile terminal both turn on the Bluetooth function and establish a communication connection based on the Bluetooth protocol.
[0290] The second way of association;
[0291] The vehicle-mounted terminal activates the hotspot function, and the mobile terminal accesses the hotspot corresponding to the vehicle-mounted terminal. Thus, the vehicle-mounted terminal and the mobile terminal access the same wireless hotspot, that is, the two communicate through the same Wi-Fi network.
[0292] Association method three;
[0293] The vehicle terminal displays a QR code that can be scanned by a mobile terminal. For ease of understanding, please refer to Figure 8 , Figure 8 This is a schematic diagram of implementing terminal communication based on a QR code in an embodiment of the present application. As shown in the figure, a QR code indicated by D1 is displayed on the vehicle terminal, wherein the QR code includes the CID of the vehicle terminal for the car owner APP of the mobile terminal to scan and obtain. Based on this, the mobile terminal can scan the QR code, and after the scanning is successful, the communication connection between the two devices is established.
[0294] Association method four;
[0295] 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 Fig. 9 , Fig. 9 This is a schematic diagram of realizing terminal communication based on manual input information in an embodiment of the present application. As shown in the figure, E1 is used to indicate the information input area, and 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 a communication connection between the two devices.
[0296] Secondly, in the embodiments of the present application, a variety of ways to establish a communication connection are provided. Through the above-mentioned method, the trusted party is added as the designated access party using near-field communication, which can prevent the public network communication from being tampered with and invaded. In addition, asymmetric encryption and certificate systems provide great protection for the security and reliability of data communications, and the present application can also adopt a lighter method. 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 to encrypt the 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.
[0297] Combined with the above introduction, the following will introduce the method of data transmission in this application, please refer to Fig.10In the embodiment of the present application, the method for data transmission may be executed by a terminal. Exemplarily, the terminal may be a mobile terminal, including:
[0298] 210. The first device sends a first certificate to the second device, and receives a second certificate sent by the second device;
[0299] In one or more embodiments, after the first device establishes a communication connection with the second device, the first device sends the first certificate to the second device, and the second device sends the second certificate to the first device. The first device may be a mobile terminal (e.g., a mobile phone, a tablet computer, or a computer), and the second device may be a vehicle-mounted terminal.
[0300] 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.
[0301] 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 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;
[0302] 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.
[0303] 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.
[0304] 230. If the first device identifier and the second device identifier are both registered identifiers, the first device sends a data access request to the second device, wherein the first device identifier and the first public key are obtained by the second device according to the first certificate, 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;
[0305] 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 the first device identifier and the second device identifier are both registered identifiers, the first device can 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.
[0306] 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.
[0307] 240. The first device receives 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.
[0308] In one or more embodiments, the second device uses the first public key or the second private key to encrypt the original data based on the data access request sent by the first device, thereby obtaining the target data. Then, the second device can send the target data to the first device.
[0309] 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.
[0310] In an embodiment of the present application, a method for data transmission is provided. By the above method, the key and certificate system is extended to the decentralized P2P, so that the terminals in the P2P network (for example, vehicle-mounted terminals and mobile terminals) can use the keys and certificates stored locally to achieve identity authentication, thereby facilitating the improvement of the security, privacy and reliability of data transmission between terminals.
[0311] Optionally, in the above Fig.10 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, before the first device sends the first certificate to the second device, the following may also be included:
[0312] The first device obtains a first public key and a first private key;
[0313] The first device stores a first private key;
[0314] 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;
[0315] The first device receives a first certificate sent by the authentication server.
[0316] In one or more embodiments, a method for a first device to apply for a certificate from an authority is introduced. It can be seen from the aforementioned embodiments that before the first device sends the first certificate to the second device, it is necessary to apply for the first certificate from the authority. First, the first device generates a key pair, that is, a first public key and a first private key. Then, on the one hand, the first device needs to store the first private key locally. On the other hand, the first device sends 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.
[0317] For ease of understanding, please refer to the example of the first device being a mobile terminal. Fig.11 , Fig.11 This is a schematic diagram of a mobile terminal workflow based on a vehicle networking system in an embodiment of the present application, as shown in the figure, specifically:
[0318] In step F1, the user downloads the APP to the mobile terminal, and the root certificate of the authority is built into the APP, wherein this process can be provided by the software development kit (SDK) of the APP. After the user logs in to the APP, the corresponding key pair (i.e., the mobile terminal public key and the mobile terminal private key) is generated according to different MIDs (for example, the owner account, the system assigned identification number or the mobile phone number, etc.). The mobile terminal private key is stored by the mobile terminal itself and is not leaked. It can be seen that, except for the mobile terminal, no one can know the mobile terminal private key.
[0319] In step F2, the mobile terminal binds the MID to the public key of the mobile terminal. Based on this, the mobile terminal initiates an HTTPS request or a TLS request to the authentication server of the authority to apply for the issuance of a certificate.
[0320] In step F3, 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 certificate (ie, the first certificate).
[0321] In step F4, the authentication server of the authority feeds back the certificate (i.e., the first certificate) to the mobile terminal through the HTTPS channel or the TLS channel, thereby preventing the mobile terminal from being hijacked and obtaining the wrong certificate to the greatest extent. Based on this, the mobile terminal saves the certificate (i.e., the first certificate).
[0322] 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, so as to ensure the legitimacy of the certificate.
[0323] 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.
[0324] It should be noted that the APP of the mobile terminal may clear the data. Therefore, when logging in again, you need to re-verify the key pair (i.e., the mobile terminal public key and the mobile terminal private key) and whether the certificate exists and is legal. If it does not exist or is illegal, it needs to be regenerated. The security of the APP is mainly guaranteed by the APP, that is, it is mainly to ensure that its private key cannot be obtained, and to use the encryption chip that comes with the APP system as much as possible.
[0325] Secondly, in the embodiment of the present application, a method is provided for a first device to apply for a certificate from an authority. Through the above method, the node device has a corresponding certificate, which is authentic and can confirm the identity of the sender of the information. Therefore, by cooperating with the method of exchanging certificates between node devices, the communication between devices can become safe and reliable.
[0326] Optionally, in the above Fig.10 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, after the first device receives the first certificate sent by the authentication server, the method may further include:
[0327] The first device uses the target public key to decrypt the first certificate 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;
[0328] The first device performs a hash calculation on the first public key and the first device identifier to obtain a first target digest;
[0329] If the first target signature is consistent with the first target digest, the first device stores the first certificate.
[0330] 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 (ie, 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.
[0331] Specifically, taking the first device as a mobile terminal as an example, the first certificate is decrypted using the target public key to obtain the first target signature, that is:
[0332] signature_1=publickey_CA(DC_1);
[0333] Wherein, 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.
[0334] The first public key and the first device identifier are hashed to obtain a first target digest, namely:
[0335] digest_1=hash(publickey_1+MID);
[0336] Wherein, digest_1 represents the first target digest. hash() represents hash calculation. publickey_1 represents the first public key. MID represents the first device identifier.
[0337] 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 reapply to the authority for a certificate.
[0338] Again, in the embodiment of the present application, a method for the first device to verify the first certificate is provided. Through the above method, after obtaining the first certificate, the first device can also verify the legitimacy of the first certificate. In this way, the legitimacy of its own local certificate is ensured, thereby improving the security and reliability of communication.
[0339] Optionally, in the above Fig.10 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, after the first device receives the second certificate sent by the second device, the following may also be included:
[0340] The first device uses the target public key to decrypt the second certificate to obtain a second digital signature, wherein the target public key is a public key generated by the authentication server;
[0341] The first device obtains a second public key to be verified and a second identifier to be verified from the second certificate;
[0342] 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;
[0343] If the second message digest is consistent with the second digital signature, the first device determines that the second certificate is a valid certificate;
[0344] The first device determines the second public key and the second device identifier according to the second certificate, which may specifically include:
[0345] 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.
[0346] In one or more embodiments, a method for a first device to verify a second 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. 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.
[0347] 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, that is:
[0348] signature_B=publickey_CA(DC_B);
[0349] Wherein, 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.
[0350] The second public key to be verified and the second identifier to be verified are hashed to obtain a second message digest, namely:
[0351] digest_B=hash(publickey_B+CID_B);
[0352] Wherein, digest_B represents the second message digest, hash() represents hash calculation, publickey_B represents the second public key to be verified, and CID_B represents the second identifier to be verified.
[0353] 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. On the contrary, if they are inconsistent, the first device will not send a request to the second device.
[0354] Secondly, in the embodiment of the present application, a method for the first device to verify the second certificate is provided. Through the above method, after obtaining the second certificate, the first device can also verify the validity of the second certificate to prevent other devices from using forged certificate request data, thereby improving the security and reliability of communication.
[0355] Optionally, in the above Fig.10 On the basis of the corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, before the first device sends a data access request to the second device, the following may also be included:
[0356] The first device encrypts the request data using the second public key to obtain a data access request;
[0357] After the first device sends the data access request to the second device, the method may further include:
[0358] 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;
[0359] or,
[0360] Before the first device sends the data access request to the second device, the method may further include:
[0361] The first device encrypts the request data using the first private key to obtain a data access request;
[0362] After the first device sends the data access request to the second device, the method may further include:
[0363] 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;
[0364] or,
[0365] After the first device receives the target data sent by the second device, the method may further include:
[0366] If the target data is obtained by encrypting the original data using the second private key by the second device, the first device decrypts the target data using the second public key to obtain the original data;
[0367] or,
[0368] After the first device receives the target data sent by the second device, the method may further include:
[0369] 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.
[0370] In one or more embodiments, multiple ways of securely communicating based on different keys are introduced. As can be seen from the above embodiments, the first device locally stores the first private key, and the first device can obtain the second public key. The second device locally stores the second private key, and the second device can obtain the first public key.
[0371] 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-mentioned embodiments, and will not be described in detail here.
[0372] Secondly, in the embodiment of the present application, multiple ways of secure communication based on different keys are provided. 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.
[0373] Optionally, in the above Fig.10 On the basis of the corresponding embodiments, 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 may also be included:
[0374] The first device obtains a set of second device identifiers stored in the first device, wherein the set of second device identifiers includes N second device identifiers registered for the first device, where N is an integer greater than or equal to 1;
[0375] If the second device identifier successfully matches one of the second device identifiers in the second device identifier set, the first device determines that the second device identifier is a registered identifier.
[0376] In one or more embodiments, a method for determining whether a device identifier is a registered identifier is introduced. As can be seen from the aforementioned embodiments, the second device can register the second device identifier to the first device through the Bluetooth protocol or other secure channels. Based on this, the first device needs to match the received second device identifier. If the match is successful, it means that the second device is a device that has been registered, that is, the second device identifier is determined to be a registered identifier.
[0377] Specifically, the following will take the first device as a mobile terminal and the second device as a vehicle-mounted terminal as an example for introduction. A user can bind N CIDs to a mobile terminal, that is, allow N vehicle-mounted terminals to communicate with one mobile terminal. For ease of understanding, please refer to Table 2, which is a schematic diagram of N CIDs registered to a mobile terminal.
[0378] Table 2
[0379] MID CID MID_0235659 CID_0001 MID_0235659 CID_0006
[0380] 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 device identifiers, wherein the two second device identifiers are CID_0001 and CID_0006 respectively.
[0381] Secondly, in the embodiment of the present application, a method is provided to determine whether the device identification is a registered identification. In this way, the second device can register its own second device identification to the first device, and the APP in the first device will save it. By verifying the device identification, it can be determined whether it is the same as the identity that has been registered, thereby improving the security and reliability of device communication.
[0382] Optionally, in the above Fig.10 On the basis of the corresponding embodiments, in another optional embodiment provided by 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 may also be included:
[0383] When the second device and the first device start the Bluetooth function, the first device and the second device establish a Bluetooth connection, so that a communication connection is established between the second device and the first device;
[0384] or,
[0385] Before the first device sends the first certificate to the second device and receives the second certificate sent by the second device, the method may further include:
[0386] 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;
[0387] or,
[0388] Before the first device sends the first certificate to the second device and receives the second certificate sent by the second device, the method may further include:
[0389] 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 an identification of the second device.
[0390] In one or more embodiments, multiple ways of establishing a communication connection are introduced. It can be seen from the above embodiments that data transmission can be performed after the first device and the second device establish a communication connection. It should be noted that the content described in this embodiment can refer to the association method 1, association method 2 and association method 3 in the above embodiments, and will not be repeated here.
[0391] Secondly, in the embodiments of the present application, a variety of ways to establish a communication connection are provided. Through the above-mentioned method, the trusted party is added as the designated access party using near-field communication, which can prevent the public network communication from being tampered with and invaded. In addition, asymmetric encryption and certificate systems provide great protection for the security and reliability of data communications, and the present application can also adopt a lighter method. 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 to encrypt the 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.
[0392] Combined with the above introduction, for ease of understanding, please refer to Fig.12 , Fig.12 This 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:
[0393] In step G1, the vehicle terminal pre-installs the root certificate of the authority before leaving the factory. During the initialization process of the vehicle terminal after leaving the factory, the vehicle terminal public key and the vehicle terminal private key are generated. Among them, the vehicle terminal private key is stored by the vehicle terminal itself and is not leaked.
[0394] 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 a TLS request to the authentication server of the authority to apply for the issuance of a certificate.
[0395] In step G3, 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 second certificate.
[0396] In step G4, the authentication server of the authority feeds back the second certificate to the vehicle terminal through the HTTPS channel or the TLS channel, and the vehicle terminal saves the second certificate.
[0397] In step G5, after receiving the second certificate, the vehicle terminal verifies whether the signature of the second certificate is correct through the root certificate pre-installed in step G1, so as to ensure the legitimacy of the certificate.
[0398] In step G6, the user downloads the APP to the mobile terminal, and the root certificate of the authority is built into the APP. This process can be provided by the SDK of the APP. After the user logs in to the APP, the corresponding mobile terminal public key and mobile terminal private key are generated according to different MIDs (for example, the car owner account or mobile phone number, etc.). The mobile terminal private key is saved by the mobile terminal itself and is not leaked.
[0399] In step G7, the mobile terminal binds the MID to the public key of the mobile terminal. Based on this, the mobile terminal initiates an HTTPS request or a TLS request to the authentication server of the authority to apply for the issuance of a certificate.
[0400] 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 public key of the mobile terminal to form a first certificate.
[0401] 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.
[0402] 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 certificate.
[0403] After both the vehicle terminal and the mobile terminal have a trusted and equal security environment, the relationship between the vehicle terminal and the mobile terminal (i.e., the car owner's APP) needs to be bound. This step is usually performed offline by the car owner after the first purchase and delivery of the car. Data is transmitted through Bluetooth protocols, etc., which has relatively low security risks.
[0404] In step G11, the vehicle terminal exchanges the CID to the car owner APP of the mobile terminal through the Bluetooth protocol or other security channels, and the car owner APP saves it.
[0405] In step G12, the car owner APP of the mobile terminal exchanges the MID to the vehicle terminal through the Bluetooth protocol or other security channels, and the vehicle terminal saves it.
[0406] When the mobile terminal and the vehicle terminal communicate, they exchange certificates with each other, and both parties verify each 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 both parties have verified their identities, they exchange keys with each other and can communicate securely.
[0407] This application solves the security trust requirements of direct connection between car owners and cars through P2P networks in the Internet of Vehicles. On the one hand, the key and certificate system is expanded to make the vehicle-mounted terminal and mobile terminal equivalent to the security and trust level of the server deployed in the computer room. On the other hand, the mutual trust between the car owner and the vehicle-mounted terminal is utilized, and the car owner usually does not actively damage his car. Finally, the communication space between car owners is isolated from each other and will not infringe on each other. Based on this, the security communication requirements of the vehicle-mounted terminal and the mobile terminal are guaranteed, and the high privacy protection standards required by regulators are met.
[0408] The data transmission device in this application is described in detail below. Fig.13 , Fig.13 This is a schematic diagram of an embodiment of a data transmission device in an embodiment of the present application. The data transmission device 30 includes:
[0409] The transceiver module 310 is configured to receive a first certificate sent by a first device and send a second certificate to the first device;
[0410] A determination module 320, 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;
[0411] The transceiver module 310 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 second device identifier and the second public key are obtained by the first device according to the second certificate, the data access request is encrypted by the first device using the second public key or the first private key, 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;
[0412] The transceiver module 310 is further used to respond to the 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.
[0413] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, 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;
[0414] An acquisition module 330, configured to acquire a second public key and a second private key before sending the second certificate to the first device;
[0415] The storage module 340 is used to store the second private key;
[0416] The transceiver module 310 is further used to send the second public key and the second device identification to the authentication server, so that the authentication server uses the target private key to sign the second public key and the second device identification to obtain a second certificate;
[0417] The transceiver module 310 is further configured to receive a second certificate sent by the authentication server.
[0418] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, 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;
[0419] The decryption module 350 is used to decrypt the second certificate using the target public key to obtain a second target signature after receiving the second certificate sent by the authentication server, wherein the target public key and the target private key are a key pair generated by the authentication server;
[0420] A generation module 360, configured to perform a hash calculation on the second public key and the second device identifier to obtain a second target digest;
[0421] The storage module 340 is further configured to store the second certificate if the second target signature is consistent with the second target digest.
[0422] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, in another embodiment of the data transmission device 30 provided in the embodiment of the present application,
[0423] 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;
[0424] 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;
[0425] 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;
[0426] 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;
[0427] 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.
[0428] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, in another embodiment of the data transmission device 30 provided in the embodiment of the present application,
[0429] 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;
[0430] Get the original data according to the request data;
[0431] The original data is encrypted using the second private key to obtain the target data;
[0432] Sending target data to the first device, so that the first device decrypts the target data using the second public key to obtain original data;
[0433] or,
[0434] 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;
[0435] Get the original data according to the request data;
[0436] The original data is encrypted using the first public key to obtain the target data;
[0437] Sending target data to the first device, so that the first device decrypts the target data using the first private key to obtain original data;
[0438] or,
[0439] The transceiver module 310 is specifically configured to 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;
[0440] Get the original data according to the request data;
[0441] The original data is encrypted using the second private key to obtain the target data;
[0442] Sending target data to the first device, so that the first device decrypts the target data using the second public key to obtain original data;
[0443] or,
[0444] The transceiver module 310 is specifically configured to 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;
[0445] Get the original data according to the request data;
[0446] The original data is encrypted using the first public key to obtain the target data;
[0447] The target data is sent to the first device, so that the first device decrypts the target data using the first private key to obtain the original data.
[0448] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, in another embodiment of the data transmission device 30 provided in the embodiment of the present application,
[0449] The acquisition module 330 is further configured to, after determining the first public key and the first device identifier according to the first certificate, acquire a set of first device identifiers stored in the second device, wherein the set of first device identifiers includes M first device identifiers registered for the second device, where M is an integer greater than or equal to 1;
[0450] 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 one of the first device identifiers in the first device identifier set.
[0451] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, 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;
[0452] Display module 370, used to display the first device identification set;
[0453] The processing module 380 is used to respond to the deletion operation on K first device identifiers in the first device identifier set, remove K first device identifiers from the first device identifier set, and obtain an updated first device identifier set, where K is an integer greater than or equal to 1 and less than M;
[0454] The display module 370 is also used to display a logo adding control;
[0455] The display module 370 is further used to respond to a selection operation on the logo adding control and display a logo adding area;
[0456] The processing module 380 is further configured to respond to an input operation on the identifier adding area and add T first 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.
[0457] Optionally, in the above Fig.13 On the basis of the corresponding embodiment, 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;
[0458] The communication module 390 is used to receive the first certificate sent by the first device, and before sending the second certificate to the first device, when the second device and the first device start the Bluetooth function, establish a Bluetooth connection with the first device, so that the second device and the first device establish a communication connection;
[0459] or,
[0460] The communication module 390 is further used to receive the first certificate sent by the first device, and before sending the second certificate to the first device, when the second device and the first device are connected to the same wireless hotspot, establish a communication connection with the first device;
[0461] or,
[0462] 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 an identification of the second device;
[0463] The communication module 390 is further configured to establish a communication connection with the first device when the first device scans the QR code;
[0464] or,
[0465] The display module 370 is further used to receive the first certificate sent by the first device, and display the information input area before sending the second certificate to the first device;
[0466] 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.
[0467] The data transmission device in this application is described in detail below. Fig.14 , Fig.14 This is another embodiment schematic diagram of a data transmission device in an embodiment of the present application. The data transmission device 40 includes:
[0468] 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;
[0469] A determination module 420, 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;
[0470] 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 first device identifier and the first public key are obtained by the second device according to the first certificate, 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;
[0471] The transceiver module 410 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.
[0472] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, 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;
[0473] An acquisition module 430, configured to acquire a first public key and a first private key before sending the first certificate to the second device;
[0474] The storage module 440 is used to store the first private key;
[0475] 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 with the target private key to obtain a first certificate;
[0476] The transceiver module 410 is further configured to receive a first certificate sent by the authentication server.
[0477] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, 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;
[0478] The decryption module 450 is used to, after receiving the first certificate sent by the authentication server, decrypt 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;
[0479] A generation module 460, configured to perform a hash calculation on the first public key and the first device identifier to obtain a first target digest;
[0480] The storage module 440 is further configured to store the first certificate if the first target signature is consistent with the first target digest.
[0481] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the data transmission device 40 provided in the embodiment of the present application,
[0482] 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;
[0483] 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;
[0484] 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;
[0485] 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;
[0486] 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.
[0487] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, 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;
[0488] The encryption module 470 is used 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;
[0489] The transceiver module 410 is further configured to send the data access request to the second device after sending the 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;
[0490] or,
[0491] The encryption module 470 is further configured to encrypt the request data using the first private key to obtain the data access request before sending the data access request to the second device;
[0492] The transceiver module 410 is further configured to send the data access request to the second device after sending the 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;
[0493] or,
[0494] The decryption module 450 is further configured to, after receiving the target data sent by the second device, decrypt the target data using the second public key to obtain the original data if the target data is obtained by encrypting the original data using the second private key by the second device;
[0495] The decryption module 450 is further 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 first public key, decrypt the target data using the first private key to obtain the original data.
[0496] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, in another embodiment of the data transmission device 40 provided in the embodiment of the present application,
[0497] The acquisition module 430 is further configured to, after determining the second public key and the second device identifier according to the second certificate, acquire a set of second device identifiers stored in the first device, wherein the set of second device identifiers includes N second device identifiers registered for the first device, where N is an integer greater than or equal to 1;
[0498] 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 one of the second device identifiers in the second device identifier set.
[0499] Optionally, in the above Fig.14 On the basis of the corresponding embodiment, 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;
[0500] The communication module 480 is used to send the first certificate to the second device, and before receiving the second certificate sent by the second device, 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;
[0501] or,
[0502] 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;
[0503] or,
[0504] The communication module 480 is further used 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 identification.
[0505] The present application also provides a data transmission device which can be deployed on a terminal. Fig.15 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. In the embodiments of the present application, the terminal is taken as an example for explanation:
[0506] Fig.15 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal provided in an embodiment of the present application. Fig.15The mobile phone includes: a radio frequency (RF) circuit 510, a memory 520, an input unit 530, a display unit 540, a sensor 550, an audio circuit 560, a wireless fidelity (WiFi) module 570, a processor 580, and a power supply 590. Those skilled in the art will understand that Fig.15 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0507] Combine the following Fig.15 A detailed introduction to the various components of the mobile phone:
[0508] The RF circuit 510 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 580 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 510 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 510 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
[0509] The memory 520 can be used to store software programs and modules. The processor 580 executes 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 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 520 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0510] The input unit 530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 530 may include a touch panel 531 and other input devices 532. The touch panel 531, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 531 or near the touch panel 531 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 531 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 580, and can receive and execute commands sent by the processor 580. In addition, the touch panel 531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 531, the input unit 530 may further include other input devices 532. Specifically, the other input devices 532 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a mouse, a joystick, etc.
[0511] The display unit 540 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 540 may include a display panel 541. Optionally, the display panel 541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 531 may cover the display panel 541. When the touch panel 531 detects a touch operation on or near it, it is transmitted to the processor 580 to determine the type of touch event. Subsequently, the processor 580 provides a corresponding visual output on the display panel 541 according to the type of touch event. Although in Fig.15 In the embodiment, the touch panel 531 and the display panel 541 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 531 and the display panel 541 can be integrated to realize the input and output functions of the mobile phone.
[0512] The mobile phone may also include at least one sensor 550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 541 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 541 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0513] The audio circuit 560, the speaker 561, and the microphone 562 can provide an audio interface between the user and the mobile phone. The audio circuit 560 can transmit the received audio data to the speaker 561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 560 and converted into audio data, and then the audio data is output to the processor 580 for processing, and then sent to another mobile phone through the RF circuit 510, or the audio data is output to the memory 520 for further processing.
[0514] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 570. It provides users with wireless broadband Internet access. Fig.15A WiFi module 570 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0515] The processor 580 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 520, and calling data stored in the memory 520. Optionally, the processor 580 may include one or more processing units; optionally, the processor 580 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 580.
[0516] The mobile phone also includes a power source 590 (such as a battery) for supplying power to various components. Optionally, the power source can be logically connected to the processor 580 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0517] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0518] The steps performed by the terminal in the above embodiment can be based on the Fig.15 The terminal structure shown.
[0519] 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.
[0520] 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.
[0521] A computer program product is also provided in an embodiment of the present application, including a computer program, which, when executed by a processor, implements the steps of the methods described in the above embodiments.
[0522] It can be understood that in the specific implementation of this application, user information, vehicle information, driving data and other related data 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 need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0523] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0524] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0525] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0526] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0527] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store computer programs.
[0528] 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned 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 method for data transmission, characterized in that: include: 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 second device identifier and the second public key are obtained by the first device according to the second certificate, the data access request is encrypted by the first device using the second public key or the first private key, 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, characterized in that Before sending the second certificate to the first device, the method further includes: 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, characterized in that After receiving the second certificate sent by the authentication server, the method further includes: 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, characterized in that: After receiving the first certificate sent by the first device, the method further includes: 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, characterized in that The step of responding to the data access request sent by the first device and sending target data to the first device includes: 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; Acquire original data according to the request data; Encrypting the original data using the second private key to obtain the target data; Sending 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; or, The step of responding to the data access request sent by the first device and sending target data to the first device includes: 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; Acquire original data according to the request data; Encrypting the original data using the first public key to obtain the target data; Sending 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; or, The step of responding to the data access request sent by the first device and sending target data to the first device includes: 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; Sending 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; or, The step of responding to the data access request sent by the first device and sending target data to the first device includes: 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 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 using the first private key to obtain the original data.
6. The method according to claim 1, characterized in that After determining the first public key and the first device identifier according to the first certificate, the method further includes: Acquire a first device identification set stored in the second device, wherein the first device identification set includes M first 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 one of the first device identifiers in the first device identifier set, the first device identifier is determined to be a registered identifier.
7. The method according to claim 6, characterized in that The method further comprises: Displaying the first device identification set; In response to a deletion operation on K first device identifiers in the first device identifier set, the K first device identifiers are removed 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 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 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, characterized in that Before receiving the first certificate sent by the first device and sending the second certificate to the first device, the method further includes: 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, Before receiving the first certificate sent by the first device and sending the second certificate to the first device, the method further includes: When the second device and the first device are connected to the same wireless hotspot, establishing a communication connection with the first device; or, Before receiving the first certificate sent by the first device and sending the second certificate to the first device, the method further includes: 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, Before receiving the first certificate sent by the first device and sending the second certificate to the first device, the method further includes: 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 method for data transmission, characterized in that: include: 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 public 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, a data access request is sent to the second device, wherein the first device identifier and the first public key are obtained by the second device according to the first certificate, the data access request is obtained by encrypting the first device using the second public key or the first private key, the first public key and the first private key are a public 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, characterized in that Before sending the first certificate to the second device, the method further includes: 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, characterized in that After receiving the first certificate sent by the authentication server, the method further includes: 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, characterized in that After receiving the second certificate sent by the second device, the method further includes: 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, characterized in that Before sending the data access request to the second device, the method further includes: Encrypting the request data using the second public 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 using the second private key to obtain the requested data; or, Before sending the data access request to the second device, the method further includes: Encrypting the request data 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 using the first public key to obtain the requested data; or, 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; or, 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 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, characterized in that After determining the second public key and the second device identification according to the second certificate, the method further includes: Acquire a set of second device identifiers stored in the first device, wherein the set of second device identifiers includes N second device identifiers registered for the first device, where N is an integer greater than or equal to 1; If the second device identifier successfully matches one of the second device identifiers 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, characterized in that Before sending the first certificate to the second device and receiving the second certificate sent by the second device, the method further includes: 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, Before sending the first certificate to the second device and receiving the second certificate sent by the second device, the method further includes: When the second device and the first device are connected to the same wireless hotspot, establishing a communication connection with the second device; or, Before sending the first certificate to the second device and receiving the second certificate sent by the second device, the method further includes: 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, characterized in that: include: 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 second device identifier and the second public key are obtained by the first device according to the second certificate, the data access request is encrypted by the first device using the second public key or the first private key, the second public key and the second private key are a public 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, characterized in that: include: 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 public 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 the first device identifier and the second device identifier are both registered identifiers, wherein the first device identifier and the first public key are obtained by the second device according to the first certificate, 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 public 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, wherein: When the processor executes the computer program, 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.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that: 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, characterized in that 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.
Citation Information
Patent Citations
Method for switching encryption safety data among peer-to-peer user nodes in P2P network
CN102111411A
Target tracking method and device, storage medium and intelligent equipment
CN111601254A
