WO2023230983A1 - Method and apparatus for establishing interoperation channel, chip, and storage medium - Google Patents

Method and apparatus for establishing interoperation channel, chip, and storage medium Download PDF

Info

Publication number
WO2023230983A1
WO2023230983A1 PCT/CN2022/096827 CN2022096827W WO2023230983A1 WO 2023230983 A1 WO2023230983 A1 WO 2023230983A1 CN 2022096827 W CN2022096827 W CN 2022096827W WO 2023230983 A1 WO2023230983 A1 WO 2023230983A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
negotiation
message
identification code
data
Prior art date
Application number
PCT/CN2022/096827
Other languages
French (fr)
Chinese (zh)
Inventor
包永明
吕小强
茹昭
张军
杨宁
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/096827 priority Critical patent/WO2023230983A1/en
Publication of WO2023230983A1 publication Critical patent/WO2023230983A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present application relates to the field of communication technology, and more specifically, to a method, device, chip and storage medium for establishing an interoperability channel.
  • This application provides a method, device, chip and storage medium for establishing an interoperability channel. Each aspect involved in this application is introduced below.
  • a first aspect provides a method for establishing an interoperability channel, including: a first device negotiating a shared key with a second device based on a key pair of the first device, the key pair of the first device including a third device.
  • a public key and a first private key the first device and the second device establish an interoperability channel based on the shared key; the first device sends a message to the second device through the interoperability channel Control instructions to control the second device, wherein the first device is a terminal device and the second device is a vehicle device.
  • a method for establishing an interoperability channel including: a second device negotiating a shared key with a first device based on a key pair of the second device, where the key pair of the second device includes a third device. two public keys and a second private key; the second device and the first device establish an interoperability channel based on the shared key; the second device receives the information of the first device through the interoperability channel. Control instructions, wherein the first device is a terminal device and the second device is a vehicle device.
  • a device for establishing an interoperability channel is provided.
  • the device is configured on a first device.
  • the device includes: a first negotiation module configured to negotiate with a second device based on a key pair of the first device.
  • a device for establishing an interoperability channel is provided.
  • the device is configured on a second device.
  • the device includes: a first negotiation module configured to negotiate with the first device based on a key pair of the second device.
  • a first receiving module configured to receive control of the first device through the interoperation channel, where the first device is a terminal device and the second device is a vehicle device.
  • a communication device configured in a first device.
  • the device includes a processor, a memory and a communication interface.
  • the memory is used to store one or more computer programs, and the processor is used to store one or more computer programs. Calling the computer program in the memory causes the first device to perform some or all of the steps in the method of the first aspect.
  • a communication device configured in a second device.
  • the device includes a processor, a memory and a communication interface.
  • the memory is used to store one or more computer programs
  • the processor is used to store one or more computer programs. Calling the computer program in the memory causes the second device to perform some or all of the steps in the method of the second aspect.
  • embodiments of the present application provide a communication system, which includes the above communication device.
  • the system may also include other devices that interact with the communication device in the solutions provided by the embodiments of this application.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program, and the computer program causes the communication device to perform some or all of the steps in the methods of the above aspects.
  • embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause the communication device to execute the above Some or all of the steps in various aspects of the method.
  • the computer program product can be a software installation package.
  • embodiments of the present application provide a chip, which includes a memory and a processor.
  • the processor can call and run a computer program from the memory to implement some or all of the steps described in the methods of the above aspects.
  • the first device and the second device can negotiate the shared key corresponding to the interoperability channel based on the key pair, so as to ensure the security and reliability of the communication of the interoperability channel and realize the communication between the first device and the second device. security control.
  • the method of negotiating shared keys based on key pairs is simple to implement and easy to operate.
  • FIG. 1 is an architectural example diagram of a wireless communication system applicable to embodiments of the present application.
  • FIG. 2 is a schematic flowchart of a method for establishing an interoperability channel according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a possible implementation of step S210 in FIG. 2 .
  • Figure 4 is a schematic flowchart of negotiating a first identity code according to an embodiment of the present application.
  • Figure 5 is a schematic flowchart of negotiating a first identity code provided by another embodiment of the present application.
  • Figure 6 is a schematic flowchart of a negotiation method for negotiating a shared key provided by an embodiment of the present application.
  • Figure 7 is a schematic flowchart of a method for establishing an interoperability channel provided by another embodiment of the present application.
  • Figure 8 is a schematic flowchart of a method for establishing an interoperability channel provided by yet another embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a device for establishing an interoperability channel provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a device for establishing an interoperability channel provided by another embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • FIG. 1 is an architectural example diagram of a wireless communication system 100 applicable to embodiments of the present application.
  • the wireless communication system 100 may include a first device 110 and a second device 120 .
  • the first device 110 may communicate with the second device 120 using an interoperation channel to implement interoperation between the first device 110 and the second device 120 .
  • a first device controls a second device.
  • the first device 110 and the second device 120 can establish a connection for communication through wired (for example, USB interface) or wireless network (for example, Bluetooth or mobile network), so that the first device 110 and the second device 120 can communicate with each other. Interoperation between two devices 120.
  • wired for example, USB interface
  • wireless network for example, Bluetooth or mobile network
  • Figure 1 exemplarily shows a first device 110 and a second device 120, but the embodiment of the present application is not limited thereto.
  • the wireless communication system 100 may include multiple first devices and/or multiple second devices.
  • a first device may control multiple second devices, or a second device may receive multiple first devices.
  • the wireless communication system 100 may also include other devices, such as a third device, which is not limited in this embodiment of the present application.
  • the first device 110 can communicate with the third device through the second device 120.
  • the first device 110 can control or access the third device through the second device 120.
  • the second device 120 can be understood as a relay device or a bridge device.
  • the technical solutions of the embodiments of the present application can be applied to various communication systems, such as: fifth generation (5th generation, 5G) systems or new radio (NR), long term evolution (long term evolution, LTE) systems , LTE frequency division duplex (FDD) system, LTE time division duplex (TDD), Bluetooth system, wireless fidelity (wireless fidelity, WiFi) system, etc.
  • 5G fifth generation
  • NR new radio
  • long term evolution long term evolution
  • LTE long term evolution
  • TDD LTE time division duplex
  • Bluetooth wireless fidelity
  • wireless fidelity wireless fidelity
  • WiFi wireless fidelity
  • the first device and the second device in the embodiments of the present application may be referred to as the first terminal device and the second terminal device respectively.
  • the terminal equipment can also be called user equipment (UE), access terminal, user unit, user station, mobile station, mobile station (MS), mobile terminal (mobile terminal, MT), remote station , remote terminal, mobile device, user terminal, terminal, wireless communications device, user agent or user device.
  • the first device and the second device in the embodiment of the present application may be devices that provide voice and/or data connectivity to users, and may be used to connect people, things, and machines, such as handheld devices and vehicle-mounted devices with wireless connection functions. wait.
  • the first device and/or the second device in the embodiment of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a notebook computer, a handheld computer, a mobile internet device (mobile internet device, MID), Wearable devices, Internet of things (IoT) devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control (industrial control), driverless ( Wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city Wireless terminals, wireless terminals in smart homes, etc.
  • IoT Internet of things
  • VR virtual reality
  • AR augmented reality
  • IoT devices may include smart travel tools such as vehicles and ships.
  • IoT devices may include smart home devices such as smart TVs, smart air conditioners, smart refrigerators, and sweeping robots.
  • IoT devices may include smart monitoring devices such as surveillance cameras, temperature sensors, sound sensors, etc.
  • the vehicle can be, for example, a family car, a taxi, a bus, a motorcycle, etc.
  • the smart air conditioner can be, for example, a vertical air conditioner, a hanging air conditioner, or a vertical air conditioner. Air conditioning, etc., this application is not limited to this.
  • the first device 110 and the second device 120 may be different types of devices to achieve interoperation between different types of devices.
  • the first device 110 can be a handheld terminal device such as a mobile phone or a tablet computer
  • the second device 120 can be an IoT device (such as a vehicle, a smart air conditioner, etc.). Based on this, the handheld terminal device can be used to control IoT devices (vehicles, smart air conditioners, etc.). air conditioning, etc.).
  • the first device 110 and the second device 120 may be devices from different manufacturers to achieve interoperability between devices of different manufacturers.
  • the first device 110 may be a device from a first manufacturer
  • the second device 120 may be a device from a second manufacturer (different from the first manufacturer). Based on this, the device produced by the first manufacturer may be implemented. Control of equipment produced by second manufacturers.
  • first device and the second device are located.
  • the first device and the second device may be deployed on land, including indoors or outdoors, handheld or vehicle-mounted.
  • the interoperation between the first device and the second device mentioned in the embodiments of this application, or the first device controlling the second device may refer to the interoperation or control between different types of devices, or It may refer to interoperability or control between devices of different manufacturers.
  • the embodiments of this application are not limited to this. For example, it may also refer to interoperation or control between devices of the same manufacturer, as long as the first It only suffices that the device and the second device can interoperate, or control and be controlled.
  • the second device may refer to a vehicle, a ship, or other smart travel tool
  • the first device may refer to a terminal device that can control the smart travel tool, such as a mobile phone, a tablet, a laptop, etc.
  • the mobile phone and the vehicle can realize the control of the vehicle by the mobile phone by establishing an interoperability channel.
  • the mobile phone can control the opening of car doors and windows, etc.
  • the second device may refer to a smart home device such as a smart air conditioner or a smart TV
  • the first device may also refer to a terminal device that controls the smart home device, such as a mobile phone, a tablet computer, etc.
  • the first device can control the smart home device, for example, control to turn on the air conditioner, turn on the TV, control and adjust the air conditioner temperature or adjust the air conditioner mode, etc.
  • different devices can achieve interoperability between devices by establishing interoperability channels, for example, to enable a first device to control a second device.
  • embodiments of the present application provide a method, device, chip, storage medium and program product for establishing an interoperability channel to negotiate the shared key corresponding to the interoperability channel based on a key pair, which is simple and easy to operate.
  • the method embodiments provided by the embodiments of the present application will be introduced in detail below with reference to the accompanying drawings.
  • Figure 2 is a schematic flowchart of a method for establishing an interoperability channel provided by an embodiment of the present application. The method shown in Figure 2 is described from the perspective of interaction between the first device and the second device.
  • the first device and the second device may be, for example, the first device 110 and the second device 120 in FIG. 1 .
  • the embodiments of the present application do not limit the specific types of the first device and the second device, as long as the first device and the second device can interoperate or realize the control of the second device by the first device.
  • the second device may refer to IoT devices, such as smart travel tools such as vehicles and ships, or smart home devices such as smart air conditioners and smart TVs, etc.
  • the first device may refer to a terminal device capable of controlling the IoT device.
  • the first device may be a terminal device
  • the second device may be a vehicle device.
  • the method shown in FIG. 2 may include steps S210 to S230, and these steps will be described in detail below.
  • step S210 the first device and the second device negotiate a shared key based on a keypair. It should be understood that the first device and the second device negotiate a shared key with the other party based on the key pair they own. Specifically, the first device can negotiate the shared key with the second device based on the key pair of the first device. , the second device can negotiate a shared key with the first device based on the key pair of the second device.
  • the key pair mentioned in the embodiment of this application may include a public key and a private key.
  • the key pair of the first device may include the first public key and the first private key (or the first public key and the first private key constitute the key pair of the first device), and the key pair of the second device
  • the key pair may include a second public key and a second private key (or the second public key and the second private key form a key pair of the second device).
  • This embodiment of the present application does not limit the sources of the key pair of the first device and the key pair of the second device.
  • the key pair of the first device may be generated by the first device
  • the key pair of the second device may be generated by the second device.
  • the key pair generated by the first device and/or the second device may be a temporary key pair, that is, the key pair is only valid during this shared key negotiation process.
  • the first device's key pair and the second device's key pair may be preconfigured.
  • the first device and the second device may negotiate to determine a shared key negotiation method according to the key negotiation methods (or types) supported by the first device and the second device respectively.
  • the first device and the second device negotiate and determine the shared key in a negotiation manner: negotiating the shared key based on a key pair. How the first device and the second device negotiate to determine the shared key will be introduced in detail later, and will not be described here.
  • the first device and the second device know the shared key negotiated by the first device and the second device, and the first device and the second device can perform encrypted communications based on the negotiated shared key.
  • the first device and the second device may generate the shared key based on one or more types of information.
  • the first device and the second device may use some key algorithms to generate the shared key.
  • both devices may use the same key algorithm to generate the shared key to ensure the security of the generated shared key.
  • the key algorithm can be a symmetric encryption algorithm, such as the data encryption standard (data encryption standard, DES) algorithm, advanced encryption standard (advanced encryption standard, AES) Algorithms etc.
  • step S220 the first device and the second device establish an interoperation channel based on the shared key.
  • the shared key is used to encrypt and security protect the communication between the first device and the second device.
  • the shared key can be used to encrypt information transmitted in the interoperability channel to improve communication security.
  • an interoperability channel can be understood as a control channel (or security control channel).
  • the first device can use the interoperability channel to The second device takes control.
  • the first device and the second device establish an interoperability channel based on the shared key, when the first device and the second device communicate using the interoperability channel, they can perform encrypted communication based on the shared key negotiated by the two, which strengthens the security of the communication.
  • the security protection of information (such as data, instructions, etc.) in the interoperability channel improves the security level of communication.
  • the shared key corresponding to each establishment of the interoperation channel may be different and random, that is, the first device and the second device Before each time a device establishes an interoperability channel, it can agree on a new shared key, and then use the shared key to encrypt communications and other processes to further improve the security of interoperability channel communications.
  • step S230 the first device controls the second device through the interoperation channel.
  • the first device may send a control instruction (also known as a control command, control signaling, etc.) to the second device through an interoperation channel to control the second device.
  • a control instruction also known as a control command, control signaling, etc.
  • the first device controlling the second device may mean that the first device controls the second device to perform some operations, such as opening operations, closing operations, adjusting operations, etc.
  • the first device controlling the second device may mean controlling opening of the vehicle door, closing of the vehicle window, etc.
  • the first device controlling the second device may mean controlling to turn on the air conditioner, adjust the air conditioner mode, adjust the temperature, etc.
  • the first device controlling the second device may refer to the first device accessing resources of the second device.
  • the first device controlling the second device may refer to checking the temperature of the second device, so that when the temperature of the second device exceeds a certain threshold, some operations are performed on the second device. .
  • the first device and the second device can negotiate the shared key corresponding to the interoperability channel based on the key pair, so as to ensure the security and reliability of the communication of the interoperability channel and realize the communication between the first device and the second device. security control.
  • the method of negotiating shared keys based on key pairs is simple to implement and easy to operate.
  • step S210 does not limit the implementation manner of step S210.
  • a possible implementation of step S210 is given below with reference to FIG. 3 , and the process of the first device and the second device negotiating a shared key based on the key pair is described in detail.
  • step S210 may include steps S212 to S218, and these steps will be described in detail below.
  • the first device sends a first message to the second device, and the first message may be used to request the second device to negotiate the shared key. Therefore, in some embodiments, the first message may also be called a key agreement request message, or a key exchange request message, or the like.
  • the first message includes first data
  • the first data includes the first public key.
  • this application does not limit the source of the key pair of the first device. That is, the sources of the first public key and the first private key may include multiple sources.
  • the first public key and the first private key may be the first public key and the first private key.
  • the first data may also include other information in addition to the first public key.
  • the first data may also include one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature, where the first signature is a username generated by the first device. The signature generated by the first private key.
  • the random numbers generated by the first device can be used to prevent replay attacks.
  • random numbers can be used as seed data and seed vectors to participate in the identification or data validity determination between the first device and the second device. It should be understood that in each process of the first device and the second device negotiating the shared key, the random number generated by the first device may be different and random. Preferably, the random number generated by the first device may be a true random number.
  • the first signature may include one or more of the following information: a first public key, a random number generated by the first device, and a device identification of the first device.
  • the first device may encrypt one or more of the information using the first private key to generate the first signature.
  • the first device may send the first signature and the content in the first signature to the second device, so that the second device uses the first public key to verify the first signature sent by the first device to verify the first signature of the first device. Verify the identity and prove that the key pair of the first device is authentic and not counterfeit.
  • the information contained in the first signature may be consistent with the information in the first data other than the first signature.
  • the first signature includes the first public key, the random number generated by the first device, the first The device identification of the device, then, in addition to the first signature, the corresponding first data should also include the first public key, the random number generated by the first device, and the device identification of the first device.
  • step S214 the second device generates a shared key based on the first public key and the second private key.
  • the sources of the second public key and the second private key may include multiple sources.
  • the second public key and the second private key may be The temporary public key and the temporary private key are generated by the second device, for example, after receiving the first message sent by the first device.
  • the temporary public key and the temporary private key form a key pair.
  • the second device generating the shared key according to the first public key and the second private key may mean that the second device generates the second key according to the first public key and the second private key, and then generates the second key according to the first public key and the second private key.
  • Two keys generate a shared secret.
  • the second device may generate the shared key based on the second key and one or more of the following information: a random number generated by the first device, a random number generated by the second device, the device of the first device identification, the device identification of the second device, and the identification code of the first device.
  • the second device can use one or more of the information as key parameters and use a key algorithm to generate the shared key.
  • the random number generated by the first device and the device identification of the first device may be carried by the first device in the first message.
  • the random number generated by the second device may be temporarily generated by the second device before generating the shared key.
  • the identification code of the first device may be configured by the first device for the second device in advance or may be generated by the second device. The identification code of the first device will be described in detail later and will not be described in detail here.
  • the second device can first verify the identity of the first device before generating the shared key.
  • the verification may mean that the second device can verify the first signature using the first public key.
  • the second device sends a first response to the first device.
  • the first response can be understood as a response message returned by the second device in response to the first message sent by the first device.
  • the response mentioned later can also refer to The response message returned for a certain message will not be described in detail later.
  • the first response contains the second data.
  • the second data contains the second public key.
  • the second data is data encrypted by the second device using the first public key.
  • the second data may also contain other information in addition to the second public key.
  • the second data may also include one or more of the following information: a random number generated by the second device, a device identification of the second device, and a second signature, where the second signature is a username generated by the second device. The signature generated by the second private key.
  • Both the device identification and the second signature of the second device can be used by the first device to authenticate the second device.
  • the second signature may include one or more of the following information: a second public key, a random number generated by the second device, and a device identification of the second device.
  • a second public key a random number generated by the second device
  • a device identification of the second device a device identification of the second device.
  • step S216 may be performed earlier than step S214, or step S214 and step S216 may be performed simultaneously.
  • step S2128 the first device generates a shared key based on the second public key and the first private key.
  • the first device generating the shared key according to the second public key and the first private key may mean that the first device generates the first key according to the second public key and the first private key, and then generates the first key according to the second public key and the first private key.
  • a key generates a shared secret.
  • the first device may generate the shared key based on the first key and one or more of the following information: a random number generated by the first device, a random number generated by the second device, a device of the first device identification, the device identification of the second device, and the identification code of the first device.
  • the first device can use one or more of the information as key parameters and use a key algorithm to generate the shared key.
  • the first device can use the same key algorithm as the second device to generate the shared key. Shared key.
  • the first message sent by the first device to the second device includes the first data.
  • the first data is encrypted data.
  • the encryption of the first data by the first device will be described in detail with reference to FIG. 3 .
  • the method provided by the embodiment of the present application may further include step S211.
  • the first device encrypts the first data according to the identification code of the first device.
  • the identity code of the first device can be used to indicate the identity of the first device, so that the second device can identify the identity of the first device.
  • the identification code of the first device can be used to encrypt the first data to prevent the first data from being leaked during transmission.
  • the identification code of the first device may be represented by a PIN code.
  • the first device After the first device encrypts the first data according to the identification code of the first device, after the second device receives the first data, it needs to decrypt the first data according to the identification code of the first device. Only after the second device successfully decrypts the first data can it learn the first public key and other information in the first data, thus avoiding the problem of easy leakage caused by the clear text transmission of the first public key.
  • the identity code of the first device may be determined through negotiation between the first device and the second device. That is to say, before the first device encrypts the first data according to the identification code of the first device, the first device can also negotiate the first identification code with the second device, and the first identification code can be used for the first identification code.
  • the first device corresponding to one identification code accesses a second device, that is, when a device wants to access a second device, it needs its corresponding first identification code as a credential to achieve access to the second device.
  • This application does not specifically limit the implementation method of negotiating the first identity code between the first device and the second device. Exemplarily, two implementation methods for the first device and the second device to negotiate the first identity code are introduced below with reference to FIG. 4 and FIG. 5 respectively.
  • FIG 4 is a schematic flowchart of a first device negotiating a first identity code with a second device according to an embodiment of the present application.
  • the first device sends a second message to the second device, and the second message is used to configure the first identity code.
  • the first identification code may be configured by the first device.
  • each first device may correspond to a fixed identification code. Therefore, in some embodiments, using This solution in which the first device configures the first identity code can also be called a solution in which a fixed identity code is used.
  • the first device may configure the first identity code to the second device in advance. After configuring the first identification code, the device corresponding to the first identification code can access the second device.
  • the first device when configuring the first identification code, can configure the first identification code and the first identification code to the second device in the form of tuple information.
  • the corresponding index such as ⁇ pincode, pincode_index>.
  • the first device can configure the first identity code and the index of the first identity code to the second device, and there is a one-to-one mapping relationship between the first identity code and the index of the first identity code.
  • the index corresponding to the identification code is sufficient.
  • the second device can know the correct identification code according to the identification code index, thereby decrypting the first data, further improving the security of communication.
  • the first device configures the first identity code and the index corresponding to the first identity code to the second device, when the first device sends the first message to the second device, in the first message In addition to containing the first data, it may also contain an index corresponding to the identification code of the first device.
  • the first data in the first message is encrypted using the identification code of the first device, and the index corresponding to the identification code of the first device is not encrypted.
  • the first device may configure a list containing multiple sets of first identity codes to the second device.
  • the list may contain multiple tuple information, and each tuple information is used to represent a set of first identities.
  • the device corresponding to the first identification code in each tuple information can access the second device.
  • the value of the index corresponding to the first identification code may be a non-zero value or a non-all-F value. value.
  • the first device after the first device configures the related information of the first identification code (for example, the identification code and the corresponding index) to the second device, the first device can store the configured first identification code accordingly.
  • the related information of the first identification code for example, the identification code and the corresponding index
  • the second device may also store information related to the first identification code configured by the first device, for example, store the first identification code that can access the second device and the index corresponding to the first identification code.
  • the second device may store information related to the first identity code in a resource of the second device. In some embodiments, the second device may store information related to the first identity code into a function cluster, for example, into a newly defined function cluster.
  • the second device After the second device stores the relevant information of the first identification code, it can query the correct identification code according to the identification code index sent by the first device.
  • Figure 5 is a schematic flowchart of a first device negotiating a first identity code with a second device according to another embodiment of the present application.
  • the first device sends a third message to the second device, and the third message is used to instruct the second device to return the first identity code.
  • the device corresponding to the first identification code can access the second device. That is to say, in this embodiment, the first identification code may be generated by the second device.
  • the second device when the first device and the second device negotiate a shared key, the second device can return a temporary identity code to the first device. Therefore, in some embodiments, this second device is used to provide the first device with a temporary identity code.
  • the scheme in which a device returns a temporary identification code can also be called a scheme in which a temporary identification code is used.
  • the first device may send a third message to the second device, and the third message may carry information indicating that the first device does not have an identity code, for example
  • the third message may carry data with an identity code index value of 0.
  • An identity code index value of 0 indicates that the first device does not have an identity code.
  • step S520 after receiving the third message, the second device returns the first identification code to the first device.
  • the first identification code returned by the second device for the first device is a temporary identification code, and the first device can access the second device based on the returned temporary identification code.
  • the second device after receiving the third message, the second device knows that the first device does not have an identification code according to the third message. Based on this, the second device can generate a temporary identification code and display the temporary identification code on on the display screen of the second device so that the first device knows the temporary identification code.
  • the second device after the second device knows that the first device does not have an identification code, it can also send a third response to the first device.
  • the third response can be used to inform the first device to input and the second device returns a response for the first device. temporary identification code.
  • the first device may send the first message to the second device.
  • the first message in addition to containing the first data, may also contain an index corresponding to the temporary identity code of the first device.
  • the temporary identity code The corresponding index is used to indicate that the first device already has an identification code.
  • the index corresponding to the temporary identification code contained in the first message may be a full F value, and the full F value is used to indicate that the first device has a temporary identification code.
  • the first device after the first device inputs the temporary identification code, it may not save the temporary identification code.
  • the first device and the second device may negotiate to determine the shared key according to the key negotiation method (or type) supported by the first device and the second device respectively. negotiation method. The following describes in detail the process of the first device and the second device negotiating the shared key negotiation method with reference to FIG. 6 .
  • step S610 the first device sends a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device.
  • the key negotiation methods supported by the first device may include one or more.
  • the key negotiation methods supported by the first device may include one or more of the following methods: key pair-based negotiation, node-based Interoperability certificate negotiation and sigma protocol negotiation.
  • the interoperability channel can be divided into different types according to the different ways in which the first device and the second device negotiate the shared key.
  • the first device and the second device negotiate a shared key based on a key pair, and the type of the corresponding interoperation channel is an interoperation channel based on the key pair.
  • the key negotiation method supported by the first device may also be referred to as the type of interoperability establishment supported by the first device. Therefore, in some embodiments, the fourth message may also be called an interoperation session establishment request message, which is not limited by this application.
  • step S620 the second device sends a fourth response to the first device, where the fourth response is used to indicate negotiating a shared key based on the key pair.
  • the second device may determine to negotiate the shared key based on the key pair according to the key negotiation mode supported by the first device, and notify the first device of the information through a fourth response.
  • the second device may indicate the key negotiation method supported by the second device in the fourth response, and the first device determines the negotiation method of the shared key.
  • the key negotiation method supported by the second device may include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
  • the fourth response only contains the method of negotiating a shared key based on a key pair.
  • the first device can directly determine that the shared key is negotiated based on a key pair.
  • the second device supports multiple key negotiation methods, for example, including key pair-based negotiation and sigma protocol-based negotiation.
  • the first device can use the key negotiation method supported by the second device. Choose one of the methods.
  • the key negotiation method selected by the first device is to negotiate a shared key with the second device based on a key pair.
  • Figure 7 is a schematic flowchart of a method for establishing an interoperability channel provided by another embodiment of the present application. As shown in Figure 7, the method may include steps S7010 to S7140.
  • the first device establishes a configuration channel with the second device.
  • the configuration channel may be a secure configuration channel, used for configuration operations between the first device and the second device.
  • step S7020 the first device sends a second message to the second device.
  • the second message is used to configure the first identification code and the index corresponding to the first identification code, for example, configure the tuple information ⁇ pincode, pincode_index>, so that the first The device corresponding to one identification code can access the second device.
  • the first device may configure multiple sets of first identification codes and indexes corresponding to the first identification codes to the second device, that is, configure multiple sets of tuple information.
  • the multiple sets of tuple information may form a configuration list, used to indicate information related to the first identification code that can access the second device.
  • the first device can correspondingly store the first identity code and the index corresponding to the first identity code. index.
  • the second device stores the first identification code configured by the first device and the index corresponding to the first identification code, for example, in a resource of the second device, or in a function set of the second device (such as a new defined function set).
  • step S7040 the configuration between the first device and the second device ends, and the configuration channel exits.
  • the first device in addition to configuring the first identity code to the second device, can also configure some basic configurations to the second device. After the identity code and basic configuration are completed, the first device communicates with the second device. The configuration between devices is completed and the configuration channel is exited.
  • step S7050 the first device sends a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device.
  • the key negotiation method supported by the first device may include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
  • the second device returns a fourth response to the first device.
  • the fourth response may be used to indicate the key negotiation method supported by the second device.
  • the key negotiation method supported by the second device is based on key pair negotiation.
  • step S7070 the first device encrypts the first data using the identification code of the first device.
  • the first device can generate a random number r1 and a temporary key pair (the first public key and the first private key), and then use the first private key to pair the first public key, the random number r1, and the first private key.
  • One or more of the device identification and other information of a device are encrypted to obtain the signature sign1, and further the first data is obtained.
  • the first data may include one or more of the following information: the first public key, the random number r1, The device identification and signature of the first device, sign1.
  • the first device can encrypt the first data using the identification code of the first device.
  • step S7080 the first device sends a first message to the second device.
  • the first message may carry the first data encrypted using the identity code of the first device and the index corresponding to the identity code.
  • the index is not encrypted. of.
  • the index corresponding to the identification code is a non-zero value or a non-full F value.
  • step S7090 the second device generates a shared key based on the first public key and the second private key.
  • the second device after receiving the first message, can find the identification code corresponding to the index value carried in the first message, and use the identification code to decrypt the first data.
  • the second device after the second device decrypts the first data, it can use the first public key to verify the signature sign1 to verify the identity of the first device and the authenticity of the key pair of the first device.
  • the second device after the second device decrypts the first data, it can generate a random number r2 and a temporary key pair (the second public key and the second private key), and then use the second private key to pair the second public key and the random key.
  • One or more of the number r2 and the device identification of the second device are encrypted to obtain the signature sign2, and further the second data is obtained.
  • the second data may include one or more of the following information: the second public key , random number r2, device identification of the second device, and signature sign2.
  • the second device can generate a shared key based on one or more of the following information: the second key generated based on the first public key and the second private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
  • step S7100 the second device sends a first response to the first device, where the first response carries second data encrypted using the first public key.
  • step S7110 the first device generates a shared key based on the second public key and the first private key.
  • the first device after receiving the first response, can decrypt the second data using the first private key and use the second public key to decrypt the signature sign2 to verify the identity of the second device.
  • the first device can generate a shared key based on one or more of the following information: the first key generated based on the second public key and the first private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
  • the first device may return a key negotiation result to the second device, and the result may be used to indicate that the first device has determined the shared key.
  • step S7130 the first device and the second device establish an interoperation channel based on the shared key.
  • step S7140 the first device controls the second device through the interoperation channel.
  • Figure 8 is a schematic flowchart of a method for establishing an interoperability channel provided by yet another embodiment of the present application. As shown in Figure 8, the method may include steps S8010 to S8130.
  • step S8010 the first device and the second device complete basic configuration and exit the configuration channel.
  • step S8020 the first device sends a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device.
  • the key negotiation method supported by the first device may include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
  • the second device returns a fourth response to the first device.
  • the fourth response may be used to indicate the key negotiation method supported by the second device.
  • the key negotiation method supported by the second device is based on key pair negotiation.
  • step S8040 the first device sends a third message to the second device, and the third message is used to instruct the second device to return the first identification code.
  • the third message may carry information indicating that the first device does not have an identity code. For example, data with an identity code index of 0 may be carried to indicate that the first device does not have an identity code.
  • the second device returns a first identification code to the first device.
  • the first identification code may be a temporary identification code.
  • the second device may send a third response to the first device, return an error code, and inform the first device that it needs to enter the temporary identity code returned by the second device for the first device.
  • the second device may display the temporary identification code that needs to be entered on the display screen of the second device.
  • step S8060 the first device encrypts the first data using the identification code of the first device.
  • the first device after the first device inputs the temporary identity code, it can first generate a random number r1 and a temporary key pair (first public key and first private key), and then use the first private key to pair the first public key , random number r1, and the device identification of the first device and other information are encrypted to obtain the signature sign1, and further obtain the first data.
  • the first data may include one or more of the following information: first Public key, random number r1, device identification of the first device, and signature sign1.
  • the first device After obtaining the first data, the first device can encrypt the first data using the identification code of the first device.
  • the first device may not save the identification code.
  • the first device sends a first message to the second device.
  • the first message may carry the first data encrypted using the identification code of the first device and the index corresponding to the identification code.
  • the index is not encrypted. of.
  • the index corresponding to the identification code is a full F value, and the full F value is used to indicate that the first device has a temporary identification code.
  • step S8080 the second device generates a shared key based on the first public key and the second private key.
  • the second device after receiving the first message, can find the identification code corresponding to the index value carried in the first message, and use the identification code to decrypt the first data.
  • the second device after the second device decrypts the first data, it can use the first public key to verify the signature sign1 to verify the identity of the first device and the authenticity of the key pair of the first device.
  • the second device after the second device decrypts the first data, it can generate a random number r2 and a temporary key pair (the second public key and the second private key), and then use the second private key to pair the second public key and the random key.
  • One or more of the number r2 and the device identification of the second device are encrypted to obtain the signature sign2, and further the second data is obtained.
  • the second data may include one or more of the following information: the second public key , random number r2, device identification of the second device, and signature sign2.
  • the second device can generate a shared key based on one or more of the following information: the second key generated based on the first public key and the second private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
  • step S8090 the second device sends a first response to the first device, where the first response carries second data encrypted using the first public key.
  • step S8100 the first device generates a shared key based on the second public key and the first private key.
  • the first device after receiving the first response, can decrypt the second data using the first private key and use the second public key to decrypt the signature sign2 to verify the identity of the second device.
  • the first device can generate a shared key based on one or more of the following information: the first key generated based on the second public key and the first private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
  • the first device may return a key negotiation result to the second device, and the result may be used to indicate that the first device has determined the shared key.
  • step S8120 the first device and the second device establish an interoperation channel based on the shared key.
  • step S8130 the first device controls the second device through the interoperation channel.
  • Figure 9 is a schematic structural diagram of a device for establishing an interoperability channel provided by an embodiment of the present application.
  • the device may be configured in the first device mentioned above.
  • the device 900 shown in FIG. 9 may include a first negotiation module 910, an establishment module 920 and a control module 930.
  • the first negotiation module 910 may be configured to negotiate a shared key with the second device according to a key pair of the first device, where the key pair of the first device includes a first public key and a first private key.
  • the establishing module 920 may be used to establish an interoperability channel based on the shared key with the second device.
  • the control module 930 may be used to send a control instruction to a second device through an interoperation channel to control the second device, where the first device is a terminal device and the second device is a vehicle device.
  • the first negotiation module further includes: a first sending module, configured to send a first message to the second device, where the first message includes first data, the first data includes a first public key, and the first public key is used to The second device generates a shared key; a first receiving module is configured to receive a first response from the second device, the first response includes second data, and the second data includes a second public key, a second public key and a second private key. A key pair constituting the second device; a generating module configured to generate a shared key based on the second public key and the first private key.
  • the first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or the second data also includes the following information.
  • the random number generated by the second device the device identification of the second device, and the second signature.
  • the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first public key, a random number generated by the first device, and the device identification of the first device.
  • the second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, and the device identification of the second device.
  • the apparatus 900 further includes: an encryption module, configured to encrypt the first data according to the identification code of the first device.
  • the apparatus 900 further includes: a second negotiation module, configured to negotiate a first identity code with the second device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
  • a second negotiation module configured to negotiate a first identity code with the second device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
  • the second negotiation module further includes: a second sending module, configured to send a second message to the second device, where the second message is used to configure the first identity code.
  • a second sending module configured to send a second message to the second device, where the second message is used to configure the first identity code.
  • the second negotiation module further includes: a third sending module, configured to send a third message to the second device, where the third message is used to instruct the second device to return the first identity code.
  • a third sending module configured to send a third message to the second device, where the third message is used to instruct the second device to return the first identity code.
  • the third message carries information indicating that the first device does not have an identification code.
  • the apparatus 900 further includes: a second receiving module configured to receive the first identification code returned by the second device for the first device.
  • the first identification code returned by the second device is displayed on the display screen of the second device.
  • the first identification code returned by the second device is a temporary identification code.
  • the apparatus 900 further includes: a third negotiation module, configured to negotiate a shared key negotiation method with the second device.
  • a third negotiation module configured to negotiate a shared key negotiation method with the second device.
  • the third negotiation module further includes: a fourth sending module, configured to send a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device; and a third receiving module, configured to A fourth response is received from the second device, the fourth response being used to indicate negotiating a shared key based on the key pair.
  • a fourth sending module configured to send a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device
  • a third receiving module configured to A fourth response is received from the second device, the fourth response being used to indicate negotiating a shared key based on the key pair.
  • the key negotiation methods supported by the first device and/or the second device include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
  • the shared key is generated by the first device based on one or more of the following information: the first key, a random number generated by the first device, a random number generated by the second device, the device of the first device identification, the device identification of the second device, and the identification code of the first device, where the first key is generated by the first device based on the second public key and the first private key.
  • Figure 10 is a schematic structural diagram of a device for establishing an interoperability channel provided by another embodiment of the present application.
  • the device may be configured in the second device mentioned above.
  • the device 1000 shown in FIG. 10 may include a first negotiation module 1010, an establishment module 1020, and a first receiving module 1030.
  • the first negotiation module 1010 may be configured to negotiate a shared key with the first device according to a key pair of the second device, where the key pair of the second device includes a second public key and a second private key.
  • the establishment module 1020 may be used to establish an interoperability channel based on the shared key with the first device.
  • the first receiving module 1030 may be configured to receive the control instruction of the first device through the interoperation channel, where the first device is a terminal device and the second device is a vehicle device.
  • the first negotiation module further includes: a second receiving module, configured to receive the first message sent by the first device, the first message includes the first data, the first data includes the first public key, the first public key and The first private key forms a key pair of the first device; the generating module is used to generate a shared key based on the first public key and the second private key; the first sending module is used to send a first response to the first device, The first response includes second data, the second data includes a second public key, and the second public key is used by the first device to generate a shared key.
  • a second receiving module configured to receive the first message sent by the first device, the first message includes the first data, the first data includes the first public key, the first public key and The first private key forms a key pair of the first device
  • the generating module is used to generate a shared key based on the first public key and the second private key
  • the first sending module is used to send a first response to the first device,
  • the first response includes second data
  • the second data includes a second
  • the first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or the second data also includes the following information.
  • the random number generated by the second device the device identification of the second device, and the second signature.
  • the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first public key, a random number generated by the first device, and the device identification of the first device.
  • the second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, and the device identification of the second device.
  • the apparatus 1000 further includes: a decryption module, configured to decrypt the first data according to the identification code of the first device.
  • a decryption module configured to decrypt the first data according to the identification code of the first device.
  • the apparatus 1000 further includes: a second negotiation module, configured to negotiate a first identity code with the first device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
  • a second negotiation module configured to negotiate a first identity code with the first device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
  • the second negotiation module further includes: a third receiving module, configured to receive a second message sent by the first device, where the second message is used to configure the first identity code.
  • the second negotiation module further includes: a fourth receiving module, configured to receive a third message sent by the first device, where the third message is used to instruct the second device to return the first identity code.
  • the third message carries information indicating that the first device does not have an identification code
  • the apparatus 1000 further includes: a return module configured to return the first identification code for the first device.
  • the first identification code returned by the second device is displayed on the display screen of the second device.
  • the first identification code returned by the second device is a temporary identification code.
  • the apparatus 1000 further includes: a third negotiation module, configured to negotiate a shared key negotiation method with the first device.
  • a third negotiation module configured to negotiate a shared key negotiation method with the first device.
  • the third negotiation module further includes: a fifth receiving module, configured to receive a fourth message sent by the first device, where the fourth message is used to indicate the key negotiation method supported by the first device; a second sending module, configured to A fourth response is sent to the first device, where the fourth response is used to indicate that the shared key is negotiated based on the key pair.
  • a fifth receiving module configured to receive a fourth message sent by the first device, where the fourth message is used to indicate the key negotiation method supported by the first device
  • a second sending module configured to A fourth response is sent to the first device, where the fourth response is used to indicate that the shared key is negotiated based on the key pair.
  • the key negotiation methods supported by the first device and/or the second device include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
  • the shared key is generated by the second device based on one or more of the following information: the second key, the random number generated by the first device, the random number generated by the second device, the device of the first device identification, the device identification of the second device, and the identification code of the first device, where the second key is generated by the second device based on the first public key and the second private key.
  • the device 900 for establishing an interoperation channel and/or the device 1000 for establishing an interoperation channel may also include a transceiver 1130 and a memory 1120, as specifically shown in FIG. 11 .
  • Figure 11 is a schematic structural diagram of a communication device according to an embodiment of the present application.
  • the dashed line in Figure 11 indicates that the unit or module is optional.
  • the device 1100 can be used to implement the method described in the above method embodiment.
  • Device 1100 may be a chip, terminal device or network device.
  • Apparatus 1100 may include one or more processors 1110.
  • the processor 1110 can support the device 1100 to implement the method described in the foregoing method embodiments.
  • the processor 1110 may be a general-purpose processor or a special-purpose processor.
  • the processor may be a central processing unit (CPU).
  • the processor can also be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • Apparatus 1100 may also include one or more memories 1120.
  • the memory 1120 stores a program, which can be executed by the processor 1110, so that the processor 1110 executes the method described in the foregoing method embodiment.
  • the memory 1120 may be independent of the processor 1110 or integrated in the processor 1110 .
  • Device 1100 may also include a transceiver 1130.
  • Processor 1110 may communicate with other devices or chips through transceiver 1130.
  • the processor 1110 can transmit and receive data with other devices or chips through the transceiver 1130 .
  • An embodiment of the present application also provides a computer-readable storage medium for storing a program.
  • the computer-readable storage medium can be applied in the terminal or network device provided by the embodiments of the present application, and the program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product includes a program.
  • the computer program product can be applied in the terminal or network device provided by the embodiments of the present application, and the program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
  • An embodiment of the present application also provides a computer program.
  • the computer program can be applied to the terminal or network device provided by the embodiments of the present application, and the computer program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
  • the "instruction" mentioned may be a direct instruction, an indirect instruction, or an association relationship.
  • a indicates B which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B. relation.
  • B corresponding to A means that B is associated with A, and B can be determined based on A.
  • determining B based on A does not mean determining B only based on A.
  • B can also be determined based on A and/or other information.
  • the term "correspondence” can mean that there is a direct correspondence or indirect correspondence between the two, or it can also mean that there is an association between the two, or it can also mean indicating and being instructed, configuring and being configured, etc. relation.
  • predefinition or “preconfiguration” can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices).
  • devices for example, including terminal devices and network devices.
  • predefined can refer to what is defined in the protocol.
  • the "protocol” may refer to a standard protocol in the communication field, which may include, for example, LTE protocol, NR protocol, and related protocols applied in future communication systems. This application does not limit this.
  • the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its functions and internal logic, and should not be determined by the implementation process of the embodiments of the present application. constitute any limitation.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • 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 they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be read by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVD)) or semiconductor media (e.g., solid state disks (SSD) )wait.
  • magnetic media e.g., floppy disks, hard disks, magnetic tapes
  • optical media e.g., digital video discs (DVD)
  • semiconductor media e.g., solid state disks (SSD)

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a method and apparatus for establishing an interoperation channel, a chip, and a storage medium. The method comprises: a first device negotiates a shared key with a second device according to a key pair of the first device (210), the key pair of the first device comprising a first public key and a first private key; the first device and the second device establish a shared key-based interoperation channel (220); the first device sends a control instruction to the second device by means of the interoperation channel (230), to control the second device, the first device being a terminal device, and the second device being a vehicle device. In embodiments of the present application, the first device and the second device may negotiate, on the basis of the key pair, the shared key corresponding to the interoperation channel, so as to ensure the security and reliability of communication of the interoperation channel, and realize security control of the second device by the first device. The manner of negotiating the shared key on the basis of the key pair is simple and easy to operate.

Description

建立互操作通道的方法、装置、芯片和存储介质Methods, devices, chips and storage media for establishing interoperability channels 技术领域Technical field
本申请涉及通信技术领域,并且更为具体地,涉及一种建立互操作通道的方法、装置、芯片和存储介质。The present application relates to the field of communication technology, and more specifically, to a method, device, chip and storage medium for establishing an interoperability channel.
背景技术Background technique
随着通信技术的快速发展,不同设备可以通过建立互操作通道实现设备之间的互操作,例如,对设备进行控制。With the rapid development of communication technology, different devices can achieve interoperability between devices by establishing interoperability channels, for example, to control devices.
相关技术中,为了保证互操作通道的通信的安全性和可靠性,可以基于共享密钥进行互操作通道的加密通信。但是,设备之间如何协商互操作通道对应的共享密钥,是亟待解决的问题。In the related technology, in order to ensure the security and reliability of the communication of the interoperability channel, encrypted communication of the interoperability channel can be performed based on the shared key. However, how to negotiate the shared key corresponding to the interoperability channel between devices is an issue that needs to be solved urgently.
发明内容Contents of the invention
本申请提供一种建立互操作通道的方法、装置、芯片和存储介质。下面对本申请涉及的各个方面进行介绍。This application provides a method, device, chip and storage medium for establishing an interoperability channel. Each aspect involved in this application is introduced below.
第一方面,提供了一种建立互操作通道的方法,包括:第一设备根据所述第一设备的密钥对与第二设备协商共享密钥,所述第一设备的密钥对包括第一公钥和第一私钥;所述第一设备与所述第二设备建立基于所述共享密钥的互操作通道;所述第一设备通过所述互操作通道向所述第二设备发送控制指令,以对所述第二设备进行控制,其中,所述第一设备为终端设备,所述第二设备为车设备。A first aspect provides a method for establishing an interoperability channel, including: a first device negotiating a shared key with a second device based on a key pair of the first device, the key pair of the first device including a third device. A public key and a first private key; the first device and the second device establish an interoperability channel based on the shared key; the first device sends a message to the second device through the interoperability channel Control instructions to control the second device, wherein the first device is a terminal device and the second device is a vehicle device.
第二方面,提供了一种建立互操作通道的方法,包括:第二设备根据所述第二设备的密钥对与第一设备协商共享密钥,所述第二设备的密钥对包括第二公钥和第二私钥;所述第二设备与所述第一设备建立基于所述共享密钥的互操作通道;所述第二设备通过所述互操作通道接收所述第一设备的控制指令,其中,所述第一设备为终端设备,所述第二设备为车设备。In a second aspect, a method for establishing an interoperability channel is provided, including: a second device negotiating a shared key with a first device based on a key pair of the second device, where the key pair of the second device includes a third device. two public keys and a second private key; the second device and the first device establish an interoperability channel based on the shared key; the second device receives the information of the first device through the interoperability channel. Control instructions, wherein the first device is a terminal device and the second device is a vehicle device.
第三方面,提供了一种建立互操作通道的装置,所述装置配置于第一设备,所述装置包括:第一协商模块,用于根据所述第一设备的密钥对与第二设备协商共享密钥,所述第一设备的密钥对包括第一公钥和第一私钥;建立模块,用于与所述第二设备建立基于所述共享密钥的互操作通道;控制模块,用于通过所述互操作通道向所述第二设备发送控制指令,以对所述第二设备进行控制,其中,所述第一设备为终端设备,所述第二设备为车设备。In a third aspect, a device for establishing an interoperability channel is provided. The device is configured on a first device. The device includes: a first negotiation module configured to negotiate with a second device based on a key pair of the first device. Negotiate a shared key, the key pair of the first device includes a first public key and a first private key; an establishment module, used to establish an interoperability channel based on the shared key with the second device; a control module , used to send control instructions to the second device through the interoperation channel to control the second device, wherein the first device is a terminal device and the second device is a vehicle device.
第四方面,提供了一种建立互操作通道的装置,所述装置配置于第二设备,所述装置包括:第一协商模块,用于根据所述第二设备的密钥对与第一设备协商共享密钥,所述第二设备的密钥对包括所述第二公钥和第二私钥;建立模块,用于与所述第一设备建立基于所述共享密钥的互操作通道;第一接收模块,用于通过所述互操作通道接收所述第一设备的控制,其中,所述第一设备为终端设备,所述第二设备为车设备。In a fourth aspect, a device for establishing an interoperability channel is provided. The device is configured on a second device. The device includes: a first negotiation module configured to negotiate with the first device based on a key pair of the second device. Negotiate a shared key, where the key pair of the second device includes the second public key and a second private key; an establishment module configured to establish an interoperability channel based on the shared key with the first device; A first receiving module, configured to receive control of the first device through the interoperation channel, where the first device is a terminal device and the second device is a vehicle device.
第五方面,提供一种通信装置,所述通信装置配置于第一设备,所述装置包括处理器、存储器以及通信接口,所述存储器用于存储一个或多个计算机程序,所述处理器用于调用所述存储器中的计算机程序使得所述第一设备执行第一方面的方法中的部分或全部步骤。In a fifth aspect, a communication device is provided. The communication device is configured in a first device. The device includes a processor, a memory and a communication interface. The memory is used to store one or more computer programs, and the processor is used to store one or more computer programs. Calling the computer program in the memory causes the first device to perform some or all of the steps in the method of the first aspect.
第六方面,提供一种通信装置,所述通信装置配置于第二设备,所述装置包括处理器、存储器以及通信接口,所述存储器用于存储一个或多个计算机程序,所述处理器用于调用所述存储器中的计算机程序使得所述第二设备执行第二方面的方法中的部分或全部步骤。In a sixth aspect, a communication device is provided. The communication device is configured in a second device. The device includes a processor, a memory and a communication interface. The memory is used to store one or more computer programs, and the processor is used to store one or more computer programs. Calling the computer program in the memory causes the second device to perform some or all of the steps in the method of the second aspect.
第七方面,本申请实施例提供了一种通信系统,该系统包括上述的通信装置。在另一种可能的设计中,该系统还可以包括本申请实施例提供的方案中与该通信装置进行交互的 其他设备。In a seventh aspect, embodiments of the present application provide a communication system, which includes the above communication device. In another possible design, the system may also include other devices that interact with the communication device in the solutions provided by the embodiments of this application.
第八方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序使得通信装置执行上述各个方面的方法中的部分或全部步骤。In an eighth aspect, embodiments of the present application provide a computer-readable storage medium that stores a computer program, and the computer program causes the communication device to perform some or all of the steps in the methods of the above aspects.
第九方面,本申请实施例提供了一种计算机程序产品,其中,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使通信装置执行上述各个方面的方法中的部分或全部步骤。在一些实现方式中,该计算机程序产品可以为一个软件安装包。In a ninth aspect, embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause the communication device to execute the above Some or all of the steps in various aspects of the method. In some implementations, the computer program product can be a software installation package.
第十方面,本申请实施例提供了一种芯片,该芯片包括存储器和处理器,处理器可以从存储器中调用并运行计算机程序,以实现上述各方面的方法中所描述的部分或全部步骤。In a tenth aspect, embodiments of the present application provide a chip, which includes a memory and a processor. The processor can call and run a computer program from the memory to implement some or all of the steps described in the methods of the above aspects.
本申请实施例中,第一设备和第二设备可以基于密钥对协商互操作通道对应的共享密钥,以保证互操作通道的通信的安全性和可靠性,实现第一设备对第二设备的安全控制。基于密钥对协商共享密钥的方式实现简单,易于操作。In this embodiment of the present application, the first device and the second device can negotiate the shared key corresponding to the interoperability channel based on the key pair, so as to ensure the security and reliability of the communication of the interoperability channel and realize the communication between the first device and the second device. security control. The method of negotiating shared keys based on key pairs is simple to implement and easy to operate.
附图说明Description of the drawings
图1为可应用于本申请实施例的无线通信系统的架构示例图。FIG. 1 is an architectural example diagram of a wireless communication system applicable to embodiments of the present application.
图2为本申请一实施例提供的建立互操作通道的方法的流程示意图。FIG. 2 is a schematic flowchart of a method for establishing an interoperability channel according to an embodiment of the present application.
图3为图2中步骤S210的一种可能的实现方式的流程示意图。FIG. 3 is a schematic flowchart of a possible implementation of step S210 in FIG. 2 .
图4为本申请一实施例提供的协商第一身份识别码的流程示意图。Figure 4 is a schematic flowchart of negotiating a first identity code according to an embodiment of the present application.
图5为本申请另一实施例提供的协商第一身份识别码的流程示意图。Figure 5 is a schematic flowchart of negotiating a first identity code provided by another embodiment of the present application.
图6为本申请实施例提供的协商共享密钥的协商方式的流程示意图。Figure 6 is a schematic flowchart of a negotiation method for negotiating a shared key provided by an embodiment of the present application.
图7为本申请另一实施例提供的建立互操作通道的方法的流程示意图。Figure 7 is a schematic flowchart of a method for establishing an interoperability channel provided by another embodiment of the present application.
图8为本申请又一实施例提供的建立互操作通道的方法的流程示意图。Figure 8 is a schematic flowchart of a method for establishing an interoperability channel provided by yet another embodiment of the present application.
图9为本申请一实施例提供的建立互操作通道的装置的结构示意图。Figure 9 is a schematic structural diagram of a device for establishing an interoperability channel provided by an embodiment of the present application.
图10为本申请另一实施例提供的建立互操作通道的装置的结构示意图。Figure 10 is a schematic structural diagram of a device for establishing an interoperability channel provided by another embodiment of the present application.
图11为本申请实施例提供的通信装置的结构示意图。Figure 11 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in this application will be described below with reference to the accompanying drawings.
图1为可应用于本申请实施例的无线通信系统100的架构示例图。如图1所示,该无线通信系统100可以包括第一设备110和第二设备120。第一设备110可以与第二设备120利用互操作通道进行通信,以实现第一设备110与第二设备120之间的互操作。例如,实现第一设备对第二设备的控制。FIG. 1 is an architectural example diagram of a wireless communication system 100 applicable to embodiments of the present application. As shown in FIG. 1 , the wireless communication system 100 may include a first device 110 and a second device 120 . The first device 110 may communicate with the second device 120 using an interoperation channel to implement interoperation between the first device 110 and the second device 120 . For example, a first device controls a second device.
在一些实施例中,第一设备110和第二设备120可以通过有线(例如,USB接口)或者无线网络(例如,蓝牙或移动网络)等方式建立连接以进行通信,实现第一设备110与第二设备120之间的互操作。In some embodiments, the first device 110 and the second device 120 can establish a connection for communication through wired (for example, USB interface) or wireless network (for example, Bluetooth or mobile network), so that the first device 110 and the second device 120 can communicate with each other. Interoperation between two devices 120.
图1示例性地示出了一个第一设备110和一个第二设备120,但本申请实施例对此并不限定。可选地,该无线通信系统100可以包括多个第一设备和/或多个第二设备,例如,第一设备可以控制多个第二设备,或者,一个第二设备可以接收多个第一设备的控制等。Figure 1 exemplarily shows a first device 110 and a second device 120, but the embodiment of the present application is not limited thereto. Optionally, the wireless communication system 100 may include multiple first devices and/or multiple second devices. For example, a first device may control multiple second devices, or a second device may receive multiple first devices. Equipment control, etc.
可选地,该无线通信系统100还可以包括其他设备,例如第三设备,本申请实施例对此不作限定。示例性地,第一设备110可以通过第二设备120实现与第三设备的通信,例如,第一设备110可以通过第二设备120来控制或访问第三设备。可选地,在该场景下,第二设备120可以理解为一种中继设备,或者桥接设备。Optionally, the wireless communication system 100 may also include other devices, such as a third device, which is not limited in this embodiment of the present application. For example, the first device 110 can communicate with the third device through the second device 120. For example, the first device 110 can control or access the third device through the second device 120. Optionally, in this scenario, the second device 120 can be understood as a relay device or a bridge device.
应理解,本申请实施例的技术方案可以应用于各种通信系统,例如:第五代(5th generation,5G)系统或新无线(new radio,NR)、长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division  duplex,TDD)、蓝牙系统、无线保真(wireless fidelity,WiFi)系统等。本申请提供的技术方案还可以应用于未来的通信系统,如第六代移动通信系统,又如卫星通信系统,等等。It should be understood that the technical solutions of the embodiments of the present application can be applied to various communication systems, such as: fifth generation (5th generation, 5G) systems or new radio (NR), long term evolution (long term evolution, LTE) systems , LTE frequency division duplex (FDD) system, LTE time division duplex (TDD), Bluetooth system, wireless fidelity (wireless fidelity, WiFi) system, etc. The technical solution provided by this application can also be applied to future communication systems, such as the sixth generation mobile communication system, satellite communication systems, and so on.
在一些实施例中,本申请实施例中的第一设备和第二设备可以分别称为第一终端设备和第二终端设备。其中,终端设备也可以称为用户设备(user equipment,UE)、接入终端、用户单元、用户站、移动站、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。In some embodiments, the first device and the second device in the embodiments of the present application may be referred to as the first terminal device and the second terminal device respectively. Among them, the terminal equipment can also be called user equipment (UE), access terminal, user unit, user station, mobile station, mobile station (MS), mobile terminal (mobile terminal, MT), remote station , remote terminal, mobile device, user terminal, terminal, wireless communications device, user agent or user device.
本申请实施例中的第一设备和第二设备可以是指向用户提供语音和/或数据连通性的设备,可以用于连接人、物和机,例如具有无线连接功能的手持式设备、车载设备等。示例性地,本申请实施例中的第一设备和/或第二设备可以是手机(mobile phone)、平板电脑(Pad)、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,物联网(internet of things,IoT)设备、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等。The first device and the second device in the embodiment of the present application may be devices that provide voice and/or data connectivity to users, and may be used to connect people, things, and machines, such as handheld devices and vehicle-mounted devices with wireless connection functions. wait. Illustratively, the first device and/or the second device in the embodiment of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a notebook computer, a handheld computer, a mobile internet device (mobile internet device, MID), Wearable devices, Internet of things (IoT) devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control (industrial control), driverless ( Wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city Wireless terminals, wireless terminals in smart homes, etc.
本申请实施例对IoT设备的类型不作限定。在一些实施例中,IoT设备可以包括车辆、船舶等智能出行工具。在一些实施例中,IoT设备可以包括智能电视、智能空调、智能冰箱、扫地机器人等智能家居设备。在一些实施例中,IoT设备可以包括监控摄像头、温度传感器、声音传感器等智能监控设备,等等。The embodiments of this application do not limit the type of IoT devices. In some embodiments, IoT devices may include smart travel tools such as vehicles and ships. In some embodiments, IoT devices may include smart home devices such as smart TVs, smart air conditioners, smart refrigerators, and sweeping robots. In some embodiments, IoT devices may include smart monitoring devices such as surveillance cameras, temperature sensors, sound sensors, etc.
进一步地,在IoT设备为车辆的情况下,车辆例如可以是家用汽车、出租车、公交车、摩托车等;在IoT设备为智能空调的情况下,智能空调例如可以是立式空调、挂式空调等,本申请对此并不限定。Further, when the IoT device is a vehicle, the vehicle can be, for example, a family car, a taxi, a bus, a motorcycle, etc.; when the IoT device is a smart air conditioner, the smart air conditioner can be, for example, a vertical air conditioner, a hanging air conditioner, or a vertical air conditioner. Air conditioning, etc., this application is not limited to this.
在一些实施例中,第一设备110与第二设备120可以是不同类型的设备,以实现不同类型的设备之间的互操作。例如,第一设备110可以是手机、平板电脑等手持终端设备,第二设备120可以是IoT设备(比如,车辆、智能空调等),基于此,可以实现手持终端设备对IoT设备(车辆、智能空调等)的控制。In some embodiments, the first device 110 and the second device 120 may be different types of devices to achieve interoperation between different types of devices. For example, the first device 110 can be a handheld terminal device such as a mobile phone or a tablet computer, and the second device 120 can be an IoT device (such as a vehicle, a smart air conditioner, etc.). Based on this, the handheld terminal device can be used to control IoT devices (vehicles, smart air conditioners, etc.). air conditioning, etc.).
在一些实施例中,第一设备110与第二设备120可以是来自不同制造商的设备,以实现不同制造商的设备之间的互操作。例如,第一设备110可以是来自第一制造商的设备,第二设备120可以是来自第二制造商(与第一制造商不同)的设备,基于此,可以实现第一制造商生产的设备对第二制造商生产的设备的控制。In some embodiments, the first device 110 and the second device 120 may be devices from different manufacturers to achieve interoperability between devices of different manufacturers. For example, the first device 110 may be a device from a first manufacturer, and the second device 120 may be a device from a second manufacturer (different from the first manufacturer). Based on this, the device produced by the first manufacturer may be implemented. Control of equipment produced by second manufacturers.
本申请实施例对第一设备和第二设备所处的场景不作限定。示例性地,第一设备和第二设备可以部署在陆地上,包括室内或室外、手持或车载。The embodiments of this application do not limit the scenarios in which the first device and the second device are located. For example, the first device and the second device may be deployed on land, including indoors or outdoors, handheld or vehicle-mounted.
应理解,本申请中的通信设备的全部或部分功能也可以通过在硬件上运行的软件功能来实现,或者通过平台(例如云平台)上实例化的虚拟化功能来实现。It should be understood that all or part of the functions of the communication device in this application can also be implemented through software functions running on hardware, or through virtualization functions instantiated on a platform (such as a cloud platform).
应理解,本申请实施例提及的第一设备与第二设备之间的互操作,或者第一设备对第二设备进行控制,可以是指不同类型的设备之间进行互操作或控制,也可以是指不同制造商的设备之间进行互操作或控制等,本申请实施例对此并不限定,例如,还可以是指相同制造商的设备之间进行互操作或控制等,只要第一设备和第二设备之间能够实现互操作、或实现控制与被控制即可。It should be understood that the interoperation between the first device and the second device mentioned in the embodiments of this application, or the first device controlling the second device, may refer to the interoperation or control between different types of devices, or It may refer to interoperability or control between devices of different manufacturers. The embodiments of this application are not limited to this. For example, it may also refer to interoperation or control between devices of the same manufacturer, as long as the first It only suffices that the device and the second device can interoperate, or control and be controlled.
应理解,本申请实施例提供的技术方案可以应用于设备之间进行互操作的任意场景,例如终端设备和IoT设备之间进行互操作。下面结合两个具体示例对本申请实施例的应用场景进行介绍,该示例并不用于限定本申请。It should be understood that the technical solutions provided by the embodiments of this application can be applied to any scenario in which devices interoperate, such as interoperability between terminal devices and IoT devices. The application scenarios of the embodiments of the present application are introduced below with two specific examples. These examples are not intended to limit the present application.
作为一个示例,第二设备可以是指车辆、船舶等智能出行工具,第一设备可以是指可以控制该智能出行工具的终端设备,例如,手机、平板电脑、笔记本电脑等。以第一设备 为手机、第二设备为车辆为例,手机和车辆可以通过建立互操作通道来实现手机对车辆的控制,例如,手机控制打开车门、打开车窗等。As an example, the second device may refer to a vehicle, a ship, or other smart travel tool, and the first device may refer to a terminal device that can control the smart travel tool, such as a mobile phone, a tablet, a laptop, etc. Taking the first device as a mobile phone and the second device as a vehicle as an example, the mobile phone and the vehicle can realize the control of the vehicle by the mobile phone by establishing an interoperability channel. For example, the mobile phone can control the opening of car doors and windows, etc.
作为另一个示例,第二设备可以是指智能空调、智能电视等智能家居设备,第一设备同样可以是指控制该智能家居设备的终端设备,例如,手机、平板电脑等。第一设备与智能家居设备建立互操作通道之后,第一设备可以对智能家居设备进行控制,例如,控制打开空调、打开电视、控制调节空调温度或调节空调模式等。As another example, the second device may refer to a smart home device such as a smart air conditioner or a smart TV, and the first device may also refer to a terminal device that controls the smart home device, such as a mobile phone, a tablet computer, etc. After the first device establishes an interoperability channel with the smart home device, the first device can control the smart home device, for example, control to turn on the air conditioner, turn on the TV, control and adjust the air conditioner temperature or adjust the air conditioner mode, etc.
近年来,随着通信技术的快速发展,不同设备之间的互操作的应用场景愈加频繁。在某些通信系统(例如,NR系统)中,不同设备可以通过建立互操作通道来实现设备之间的互操作,例如,实现第一设备对第二设备的控制。In recent years, with the rapid development of communication technology, interoperability application scenarios between different devices have become more frequent. In some communication systems (for example, NR systems), different devices can achieve interoperability between devices by establishing interoperability channels, for example, to enable a first device to control a second device.
然而,目前关于不同设备之间建立互操作通道的方案并不完善且不统一,作为一种可能的实现方式,为了保证互操作通道的通信的安全性和可靠性,可以基于共享密钥进行互操作通道的加密通信。但是,设备之间如何协商互操作通道对应的共享密钥,是亟待解决的问题。However, the current solution for establishing interoperability channels between different devices is incomplete and inconsistent. As a possible implementation method, in order to ensure the security and reliability of the communication of interoperability channels, mutual interaction can be based on shared keys. Encrypted communication for operational channels. However, how to negotiate the shared key corresponding to the interoperability channel between devices is an issue that needs to be solved urgently.
为了解决上述问题,本申请实施例提供一种建立互操作通道的方法、装置、芯片、存储介质和程序产品,以基于密钥对协商互操作通道对应的共享密钥,实现简单、易于操作。下面结合附图,对本申请实施例提供的方法实施例进行详细介绍。In order to solve the above problems, embodiments of the present application provide a method, device, chip, storage medium and program product for establishing an interoperability channel to negotiate the shared key corresponding to the interoperability channel based on a key pair, which is simple and easy to operate. The method embodiments provided by the embodiments of the present application will be introduced in detail below with reference to the accompanying drawings.
图2为本申请实施例提供的建立互操作通道的方法的流程示意图。图2所示的方法是站在第一设备和第二设备交互的角度描述的。第一设备和第二设备例如可以是图1中的第一设备110和第二设备120。Figure 2 is a schematic flowchart of a method for establishing an interoperability channel provided by an embodiment of the present application. The method shown in Figure 2 is described from the perspective of interaction between the first device and the second device. The first device and the second device may be, for example, the first device 110 and the second device 120 in FIG. 1 .
本申请实施例对第一设备和第二设备的具体类型不作限定,只要第一设备和第二设备之间能够实现互操作,或者实现第一设备对第二设备的控制即可。示例性地,第二设备可以是指IoT设备,例如车辆、船舶等智能出行工具,或者智能空调、智能电视等智能家居设备,等等;第一设备可以是指能够控制该IoT设备的终端设备。比如,在一些实施例中,第一设备可以为终端设备,第二设备可以为车设备。The embodiments of the present application do not limit the specific types of the first device and the second device, as long as the first device and the second device can interoperate or realize the control of the second device by the first device. For example, the second device may refer to IoT devices, such as smart travel tools such as vehicles and ships, or smart home devices such as smart air conditioners and smart TVs, etc.; the first device may refer to a terminal device capable of controlling the IoT device. . For example, in some embodiments, the first device may be a terminal device, and the second device may be a vehicle device.
图2所示的方法可以包括步骤S210至步骤S230,下面对这些步骤进行详细描述。The method shown in FIG. 2 may include steps S210 to S230, and these steps will be described in detail below.
在步骤S210,第一设备与第二设备基于密钥对(keypair)协商共享密钥。应该理解,第一设备和第二设备是分别基于自己拥有的密钥对与另一方协商共享密钥,具体地,第一设备可以根据第一设备的密钥对与第二设备协商共享密钥,第二设备可以根据第二设备的密钥对与第一设备协商共享密钥。In step S210, the first device and the second device negotiate a shared key based on a keypair. It should be understood that the first device and the second device negotiate a shared key with the other party based on the key pair they own. Specifically, the first device can negotiate the shared key with the second device based on the key pair of the first device. , the second device can negotiate a shared key with the first device based on the key pair of the second device.
应该理解,本申请实施例提及的密钥对可以包括一个公钥(public key)和一个私钥(private key)。换句话说,第一设备的密钥对可以包括第一公钥和第一私钥(或称,第一公钥和第一私钥组成第一设备的密钥对),第二设备的密钥对可以包括第二公钥和第二私钥(或称,第二公钥和第二私钥组成第二设备的密钥对)。本申请实施例对第一设备的密钥对和第二设备的密钥对的来源不作限定。在一些实施例中,第一设备的密钥对可以是第一设备生成的,第二设备的密钥对可以是第二设备生成的。可选地,第一设备和/或第二设备生成的密钥对可以是临时密钥对,也就是说,该密钥对仅在本次协商共享密钥的过程中有效。在一些实施例中,第一设备的密钥对和第二设备的密钥对可以是预配置的。It should be understood that the key pair mentioned in the embodiment of this application may include a public key and a private key. In other words, the key pair of the first device may include the first public key and the first private key (or the first public key and the first private key constitute the key pair of the first device), and the key pair of the second device The key pair may include a second public key and a second private key (or the second public key and the second private key form a key pair of the second device). This embodiment of the present application does not limit the sources of the key pair of the first device and the key pair of the second device. In some embodiments, the key pair of the first device may be generated by the first device, and the key pair of the second device may be generated by the second device. Optionally, the key pair generated by the first device and/or the second device may be a temporary key pair, that is, the key pair is only valid during this shared key negotiation process. In some embodiments, the first device's key pair and the second device's key pair may be preconfigured.
在一些实施例中,第一设备和第二设备在协商共享密钥前,可以根据第一设备和第二设备分别支持的密钥协商方式(或类型),协商确定共享密钥的协商方式。在本申请实施例中,第一设备和第二设备协商确定的共享密钥的协商方式为:基于密钥对协商共享密钥。关于第一设备和第二设备如何协商确定共享密钥的协商方式,后文将会详细介绍,此处暂不赘述。In some embodiments, before negotiating the shared key, the first device and the second device may negotiate to determine a shared key negotiation method according to the key negotiation methods (or types) supported by the first device and the second device respectively. In this embodiment of the present application, the first device and the second device negotiate and determine the shared key in a negotiation manner: negotiating the shared key based on a key pair. How the first device and the second device negotiate to determine the shared key will be introduced in detail later, and will not be described here.
在本申请实施例中,第一设备和第二设备协商出的共享密钥只有第一设备和第二设备彼此知道,第一设备和第二设备可以基于协商出的共享密钥进行加密通信。第一设备和第二设备在协商共享密钥的过程中,可以根据一种或多种信息生成该共享密钥。关于第一设 备和第二设备如何协商或如何生成共享密钥的具体描述,可以参见后文,此处暂不赘述。In this embodiment of the present application, only the first device and the second device know the shared key negotiated by the first device and the second device, and the first device and the second device can perform encrypted communications based on the negotiated shared key. During the process of negotiating the shared key, the first device and the second device may generate the shared key based on one or more types of information. For a detailed description of how the first device and the second device negotiate or how to generate a shared key, please refer to the following text and will not be described again here.
在一些实施例中,第一设备和第二设备可以利用一些密钥算法来生成共享密钥,例如,两者可以使用相同的密钥算法来生成共享密钥,以保证生成的共享密钥的对应性和一致性。本申请实施例对密钥算法的具体类型不作限定,示例性地,密钥算法可以是对称加密算法,比如数据加密标准(data encryption standard,DES)算法、高级加密标准(advanced encryption standard,AES)算法等。In some embodiments, the first device and the second device may use some key algorithms to generate the shared key. For example, both devices may use the same key algorithm to generate the shared key to ensure the security of the generated shared key. Correspondence and consistency. The embodiments of this application do not limit the specific type of the key algorithm. For example, the key algorithm can be a symmetric encryption algorithm, such as the data encryption standard (data encryption standard, DES) algorithm, advanced encryption standard (advanced encryption standard, AES) Algorithms etc.
在步骤S220,第一设备与第二设备建立基于共享密钥的互操作通道。第一设备和第二设备基于互操作通道进行通信(例如,发送或接收控制指令)时,该共享密钥用于对第一设备和第二设备之间的通信进行加密和安全性保护。换句话说,第一设备和第二设备基于互操作通道进行通信时,该共享密钥可以用于对互操作通道中传输的信息进行加密,以提升通信的安全性。In step S220, the first device and the second device establish an interoperation channel based on the shared key. When the first device and the second device communicate (for example, send or receive control instructions) based on the interoperability channel, the shared key is used to encrypt and security protect the communication between the first device and the second device. In other words, when the first device and the second device communicate based on the interoperability channel, the shared key can be used to encrypt information transmitted in the interoperability channel to improve communication security.
如前文所述,第一设备和第二设备可以利用互操作通道实现第一设备对第二设备的控制(设备之间的互操作)。在本申请实施例中,互操作通道可以理解为一种控制信道(或,安全控制信道),第一设备和第二设备之间建立互操作通道之后,第一设备可以通过该互操作通道对第二设备进行控制。第一设备与第二设备建立基于共享密钥的互操作通道后,第一设备与第二设备利用互操作通道进行通信时,可以基于两者协商出的共享密钥进行加密通信,加强了对互操作通道中的信息(比如数据、指令等)的安全性保护,提升了通信的安全等级。As mentioned above, the first device and the second device can use the interoperation channel to realize the control of the second device by the first device (interoperation between devices). In the embodiment of this application, an interoperability channel can be understood as a control channel (or security control channel). After an interoperability channel is established between the first device and the second device, the first device can use the interoperability channel to The second device takes control. After the first device and the second device establish an interoperability channel based on the shared key, when the first device and the second device communicate using the interoperability channel, they can perform encrypted communication based on the shared key negotiated by the two, which strengthens the security of the communication. The security protection of information (such as data, instructions, etc.) in the interoperability channel improves the security level of communication.
在一些实施例中,第一设备与第二设备建立基于共享密钥的互操作通道时,每次建立互操作通道对应的共享密钥可以是不同的、随机的,即第一设备和第二设备每次建立互操作通道之前,可以先约定一个新的共享密钥,然后再用该共享密钥进行加密通信等处理,进一步提高互操作通道的通信的安全性。In some embodiments, when the first device and the second device establish an interoperation channel based on a shared key, the shared key corresponding to each establishment of the interoperation channel may be different and random, that is, the first device and the second device Before each time a device establishes an interoperability channel, it can agree on a new shared key, and then use the shared key to encrypt communications and other processes to further improve the security of interoperability channel communications.
在步骤S230,第一设备通过互操作通道对第二设备进行控制。示例性地,第一设备可以通过互操作通道向第二设备发送控制指令(或称,控制命令、控制信令等)实现对第二设备的控制。In step S230, the first device controls the second device through the interoperation channel. For example, the first device may send a control instruction (also known as a control command, control signaling, etc.) to the second device through an interoperation channel to control the second device.
在一些实施例中,第一设备对第二设备进行控制可以是指第一设备控制第二设备执行一些操作,例如,打开操作、关闭操作、调节操作等。作为一个示例,第二设备为车辆时,第一设备对第二设备进行控制可以是指控制打开车门、关闭车窗等。作为另一个示例,第二设备为智能空调时,第一设备对第二设备进行控制可以是指控制打开空调、调节空调模式、调节温度等。In some embodiments, the first device controlling the second device may mean that the first device controls the second device to perform some operations, such as opening operations, closing operations, adjusting operations, etc. As an example, when the second device is a vehicle, the first device controlling the second device may mean controlling opening of the vehicle door, closing of the vehicle window, etc. As another example, when the second device is a smart air conditioner, the first device controlling the second device may mean controlling to turn on the air conditioner, adjust the air conditioner mode, adjust the temperature, etc.
在一些实施例中,第一设备对第二设备进行控制可以是指第一设备访问第二设备的资源。作为一个示例,第二设备为温度传感器时,第一设备对第二设备进行控制可以是指查看第二设备的温度,以便第二设备的温度超过某一阈值时,对第二设备执行一些操作。In some embodiments, the first device controlling the second device may refer to the first device accessing resources of the second device. As an example, when the second device is a temperature sensor, the first device controlling the second device may refer to checking the temperature of the second device, so that when the temperature of the second device exceeds a certain threshold, some operations are performed on the second device. .
本申请实施例中,第一设备和第二设备可以基于密钥对协商互操作通道对应的共享密钥,以保证互操作通道的通信的安全性和可靠性,实现第一设备对第二设备的安全控制。基于密钥对协商共享密钥的方式实现简单,易于操作。In this embodiment of the present application, the first device and the second device can negotiate the shared key corresponding to the interoperability channel based on the key pair, so as to ensure the security and reliability of the communication of the interoperability channel and realize the communication between the first device and the second device. security control. The method of negotiating shared keys based on key pairs is simple to implement and easy to operate.
本申请实施例对步骤S210的实现方式不作限定。下面结合图3,给出步骤S210的一种可能的实现方式,对第一设备和第二设备基于密钥对协商共享密钥的过程进行详细描述。示例性地,步骤S210可以包括步骤S212至步骤S218,下面对这些步骤进行详细描述。The embodiment of the present application does not limit the implementation manner of step S210. A possible implementation of step S210 is given below with reference to FIG. 3 , and the process of the first device and the second device negotiating a shared key based on the key pair is described in detail. For example, step S210 may include steps S212 to S218, and these steps will be described in detail below.
在步骤S212,第一设备向第二设备发送第一消息,第一消息可以用于请求第二设备协商共享密钥。因此,在一些实施例中,第一消息也可以称为密钥协商请求消息,或者称为密钥交换请求消息等。In step S212, the first device sends a first message to the second device, and the first message may be used to request the second device to negotiate the shared key. Therefore, in some embodiments, the first message may also be called a key agreement request message, or a key exchange request message, or the like.
在本申请实施例中,第一消息包含第一数据,第一数据包含第一公钥。前文提及,本申请对第一设备的密钥对的来源不作限定,即第一公钥和第一私钥的来源可以包括多种,例如第一公钥和第一私钥可以是第一设备生成的,比如在发送第一消息之前生成的临时公 钥和临时私钥,该临时公钥和临时私钥组成密钥对。In this embodiment of the present application, the first message includes first data, and the first data includes the first public key. As mentioned above, this application does not limit the source of the key pair of the first device. That is, the sources of the first public key and the first private key may include multiple sources. For example, the first public key and the first private key may be the first public key and the first private key. Generated by the device, such as the temporary public key and temporary private key generated before sending the first message, the temporary public key and the temporary private key form a key pair.
在一些实施例中,第一数据除包含第一公钥之外,还可以包含其他信息。示例性地,第一数据还可以包含以下信息中的一种或多种:第一设备生成的随机数、第一设备的设备标识、以及第一签名,其中,第一签名是第一设备使用第一私钥生成的签名。In some embodiments, the first data may also include other information in addition to the first public key. Exemplarily, the first data may also include one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature, where the first signature is a username generated by the first device. The signature generated by the first private key.
第一设备生成的随机数可以用于防止重放攻击(replay attacks)。在认证协议或数据加密传输体系中,随机数可以作为种子数据、种子向量参与到第一设备和第二设备之间的身份识别或数据有效性判别之中。应该理解,在第一设备和第二设备每次协商共享密钥的过程中,第一设备生成的随机数可以是不同的、随机的。优选地,第一设备生成的随机数可以是真随机数。The random numbers generated by the first device can be used to prevent replay attacks. In an authentication protocol or data encryption transmission system, random numbers can be used as seed data and seed vectors to participate in the identification or data validity determination between the first device and the second device. It should be understood that in each process of the first device and the second device negotiating the shared key, the random number generated by the first device may be different and random. Preferably, the random number generated by the first device may be a true random number.
第一设备的设备标识和第一签名均可以用于第二设备对第一设备进行身份验证。在一些实施例中,第一签名中可以包括以下信息中的一种或多种:第一公钥、第一设备生成的随机数、第一设备的设备标识。第一设备可以使用第一私钥对这些信息中的一种或多种进行加密以生成第一签名。第一设备可以将第一签名以及第一签名中的内容发送给第二设备,以便于第二设备使用第一公钥对第一设备发送的第一签名进行校验,以对第一设备的身份进行验证,同时证明第一设备的密钥对是真实的,不是仿冒的。Both the device identification and the first signature of the first device can be used by the second device to authenticate the first device. In some embodiments, the first signature may include one or more of the following information: a first public key, a random number generated by the first device, and a device identification of the first device. The first device may encrypt one or more of the information using the first private key to generate the first signature. The first device may send the first signature and the content in the first signature to the second device, so that the second device uses the first public key to verify the first signature sent by the first device to verify the first signature of the first device. Verify the identity and prove that the key pair of the first device is authentic and not counterfeit.
应该理解,第一签名中包含的信息与第一数据中除第一签名之外的信息可以是一致的,例如,第一签名中包含第一公钥、第一设备生成的随机数、第一设备的设备标识,那么,对应的第一数据中除第一签名外,也应该包含第一公钥、第一设备生成的随机数、第一设备的设备标识。It should be understood that the information contained in the first signature may be consistent with the information in the first data other than the first signature. For example, the first signature includes the first public key, the random number generated by the first device, the first The device identification of the device, then, in addition to the first signature, the corresponding first data should also include the first public key, the random number generated by the first device, and the device identification of the first device.
在步骤S214,第二设备根据第一公钥和第二私钥,生成共享密钥。In step S214, the second device generates a shared key based on the first public key and the second private key.
如前文所述,本申请对第二设备的密钥对的来源不作限定,即,第二公钥和第二私钥的来源可以包括多种,例如第二公钥和第二私钥可以是第二设备生成的,比如在接收第一设备发送的第一消息之后生成的临时公钥和临时私钥,该临时公钥和临时私钥组成密钥对。As mentioned above, this application does not limit the source of the key pair of the second device. That is, the sources of the second public key and the second private key may include multiple sources. For example, the second public key and the second private key may be The temporary public key and the temporary private key are generated by the second device, for example, after receiving the first message sent by the first device. The temporary public key and the temporary private key form a key pair.
在一些实施例中,第二设备根据第一公钥和第二私钥,生成共享密钥可以是指,第二设备根据第一公钥和第二私钥生成第二密钥,然后根据第二密钥生成共享密钥。示例性地,第二设备可以根据第二密钥以及以下信息中的一种或多种来生成共享密钥:第一设备生成的随机数、第二设备生成的随机数、第一设备的设备标识、第二设备的设备标识、第一设备的身份识别码。作为一种实现方式,第二设备可以以该信息中的一种或多种作为密钥参数,使用密钥算法来生成共享密钥。In some embodiments, the second device generating the shared key according to the first public key and the second private key may mean that the second device generates the second key according to the first public key and the second private key, and then generates the second key according to the first public key and the second private key. Two keys generate a shared secret. Exemplarily, the second device may generate the shared key based on the second key and one or more of the following information: a random number generated by the first device, a random number generated by the second device, the device of the first device identification, the device identification of the second device, and the identification code of the first device. As an implementation manner, the second device can use one or more of the information as key parameters and use a key algorithm to generate the shared key.
需要说明的是,第一设备生成的随机数以及第一设备的设备标识可以是第一设备在第一消息中携带的。第二设备生成的随机数可以是第二设备在生成共享密钥之前临时生成的。第一设备的身份识别码可以是第一设备提前为第二设备配置的或者也可以是第二设备生成的。关于第一设备的身份识别码后文将会详细描述,此处暂不赘述。It should be noted that the random number generated by the first device and the device identification of the first device may be carried by the first device in the first message. The random number generated by the second device may be temporarily generated by the second device before generating the shared key. The identification code of the first device may be configured by the first device for the second device in advance or may be generated by the second device. The identification code of the first device will be described in detail later and will not be described in detail here.
在一些实施例中,第二设备在生成共享密钥之前可以先对第一设备的身份进行验证,该验证可以是指第二设备可以利用第一公钥对第一签名进行校验。In some embodiments, the second device can first verify the identity of the first device before generating the shared key. The verification may mean that the second device can verify the first signature using the first public key.
在步骤S216,第二设备向第一设备发送第一响应,第一响应可以理解为是第二设备针对第一设备发送的第一消息返回的响应消息,后文提及的响应也可指是针对某一消息返回的响应消息,后文不再赘述。第一响应包含第二数据。第二数据包含第二公钥。In step S216, the second device sends a first response to the first device. The first response can be understood as a response message returned by the second device in response to the first message sent by the first device. The response mentioned later can also refer to The response message returned for a certain message will not be described in detail later. The first response contains the second data. The second data contains the second public key.
在一些实施例中,第二数据是第二设备使用第一公钥进行加密的数据。In some embodiments, the second data is data encrypted by the second device using the first public key.
在一些实施例中,第二数据除包含第二公钥之外,还可以包含其他信息。示例性地,第二数据还可以包含以下信息中的一种或多种:第二设备生成的随机数、第二设备的设备标识、以及第二签名,其中,第二签名是第二设备使用第二私钥生成的签名。In some embodiments, the second data may also contain other information in addition to the second public key. Exemplarily, the second data may also include one or more of the following information: a random number generated by the second device, a device identification of the second device, and a second signature, where the second signature is a username generated by the second device. The signature generated by the second private key.
为了简洁,第二设备生成的随机数的相关描述可以参见前文第一设备生成的随机数的相关描述,此处不再赘述。For the sake of simplicity, the relevant description of the random number generated by the second device can be found in the previous relevant description of the random number generated by the first device, and will not be described again here.
第二设备的设备标识和第二签名均可以用于第一设备对第二设备进行身份验证。在一 些实施例中,第二签名中可以包括以下信息中的一种或多种:第二公钥、第二设备生成的随机数、第二设备的设备标识。关于第一设备对第二签名的校验过程可以参见前文第二设备对第一签名校验过程。Both the device identification and the second signature of the second device can be used by the first device to authenticate the second device. In some embodiments, the second signature may include one or more of the following information: a second public key, a random number generated by the second device, and a device identification of the second device. Regarding the verification process of the second signature by the first device, please refer to the aforementioned verification process of the first signature by the second device.
本申请实施例对步骤S214和步骤S216的执行顺序不作限定。在一些实施例中,步骤S216的执行顺序可以早于步骤S214,或者可以同时执行步骤S214和步骤S216。The embodiment of the present application does not limit the execution order of step S214 and step S216. In some embodiments, step S216 may be performed earlier than step S214, or step S214 and step S216 may be performed simultaneously.
在步骤S218,第一设备根据第二公钥和第一私钥,生成共享密钥。In step S218, the first device generates a shared key based on the second public key and the first private key.
在一些实施例中,第一设备根据第二公钥和第一私钥,生成共享密钥可以是指,第一设备根据第二公钥和第一私钥生成第一密钥,然后根据第一密钥生成共享密钥。示例性地,第一设备可以根据第一密钥以及以下信息中的一种或多种来生成共享密钥:第一设备生成的随机数、第二设备生成的随机数、第一设备的设备标识、第二设备的设备标识、第一设备的身份识别码。作为一种实现方式,第一设备可以以该信息中的一种或多种作为密钥参数,使用密钥算法来生成共享密钥,例如,可以与第二设备使用相同的密钥算法来生成共享密钥。In some embodiments, the first device generating the shared key according to the second public key and the first private key may mean that the first device generates the first key according to the second public key and the first private key, and then generates the first key according to the second public key and the first private key. A key generates a shared secret. Exemplarily, the first device may generate the shared key based on the first key and one or more of the following information: a random number generated by the first device, a random number generated by the second device, a device of the first device identification, the device identification of the second device, and the identification code of the first device. As an implementation manner, the first device can use one or more of the information as key parameters and use a key algorithm to generate the shared key. For example, the first device can use the same key algorithm as the second device to generate the shared key. Shared key.
如前文所述,第一设备向第二设备发送的第一消息中包含第一数据。在一些实施例中,该第一数据为加密的数据。下面继续结合图3,对第一设备对第一数据进行加密进行详细描述。As mentioned above, the first message sent by the first device to the second device includes the first data. In some embodiments, the first data is encrypted data. Next, the encryption of the first data by the first device will be described in detail with reference to FIG. 3 .
继续参见图3,在一些实施例中,在步骤S212之前,本申请实施例提供的方法还可以包括步骤S211。在步骤S211,第一设备根据第一设备的身份识别码对第一数据进行加密。Continuing to refer to Figure 3, in some embodiments, before step S212, the method provided by the embodiment of the present application may further include step S211. In step S211, the first device encrypts the first data according to the identification code of the first device.
一方面,第一设备的身份识别码可以用于指示第一设备的身份,以便第二设备对第一设备的身份进行识别。另一方面,第一设备的身份识别码可以用于对第一数据进行加密,以避免第一数据在传输的过程中泄露。On the one hand, the identity code of the first device can be used to indicate the identity of the first device, so that the second device can identify the identity of the first device. On the other hand, the identification code of the first device can be used to encrypt the first data to prevent the first data from being leaked during transmission.
在一些实施例中,第一设备的身份识别码可以由PIN码(pincode)表示。In some embodiments, the identification code of the first device may be represented by a PIN code.
第一设备根据第一设备的身份识别码对第一数据进行加密后,第二设备接收到第一数据后,需要根据第一设备的身份识别码对第一数据进行解密。第二设备成功解密第一数据后,才能够获知第一公钥以及第一数据中的其他信息,避免了第一公钥明文传输导致的容易泄露的问题。After the first device encrypts the first data according to the identification code of the first device, after the second device receives the first data, it needs to decrypt the first data according to the identification code of the first device. Only after the second device successfully decrypts the first data can it learn the first public key and other information in the first data, thus avoiding the problem of easy leakage caused by the clear text transmission of the first public key.
在一些实施例中,第一设备的身份识别码可以是由第一设备和第二设备协商确定的。也就是说,在第一设备根据第一设备的身份识别码对第一数据进行加密之前,第一设备还可以与第二设备协商第一身份识别码,该第一身份识别码可以用于第一身份识别码对应的设备访问第二设备,即某一设备想要访问第二设备时,需要以其对应的第一身份识别码作为凭证来实现对第二设备的访问。本申请对第一设备与第二设备协商第一身份识别码的实现方式不作具体限定。示例性地,下面分别结合图4和图5,介绍两种第一设备与第二设备协商第一身份识别码的实现方式。In some embodiments, the identity code of the first device may be determined through negotiation between the first device and the second device. That is to say, before the first device encrypts the first data according to the identification code of the first device, the first device can also negotiate the first identification code with the second device, and the first identification code can be used for the first identification code. When a device corresponding to one identification code accesses a second device, that is, when a device wants to access a second device, it needs its corresponding first identification code as a credential to achieve access to the second device. This application does not specifically limit the implementation method of negotiating the first identity code between the first device and the second device. Exemplarily, two implementation methods for the first device and the second device to negotiate the first identity code are introduced below with reference to FIG. 4 and FIG. 5 respectively.
图4为本申请一实施例提供的第一设备与第二设备协商第一身份识别码的流程示意图。如图4所示,在步骤S410,第一设备向第二设备发送第二消息,第二消息用于配置第一身份识别码。也就是说,在该实施例中,第一身份识别码可以是第一设备配置的,如此一来,每个第一设备可以对应一个固定的身份识别码,因此,在一些实施例中,采用这种第一设备配置第一身份识别码的方案也可以称为采用固定身份识别码的方案。Figure 4 is a schematic flowchart of a first device negotiating a first identity code with a second device according to an embodiment of the present application. As shown in Figure 4, in step S410, the first device sends a second message to the second device, and the second message is used to configure the first identity code. That is to say, in this embodiment, the first identification code may be configured by the first device. In this way, each first device may correspond to a fixed identification code. Therefore, in some embodiments, using This solution in which the first device configures the first identity code can also be called a solution in which a fixed identity code is used.
作为一种实现方式,第一设备在配置阶段,可以预先向第二设备配置第一身份识别码。配置第一身份识别码之后,第一身份识别码对应的设备便可以访问第二设备。As an implementation manner, during the configuration phase, the first device may configure the first identity code to the second device in advance. After configuring the first identification code, the device corresponding to the first identification code can access the second device.
为了避免身份识别码的明文传输,在一些实施例中,第一设备在配置第一身份识别码时,可以以元组信息的形式向第二设备配置第一身份识别码以及第一身份识别码对应的索引,例如<pincode,pincode_index>。换句话说,第一设备可以向第二设备配置第一身份识别码以及第一身份识别码的索引,该第一身份识别码与第一身份识别码的索引存在一一映射关系。如此一来,第一设备使用第一设备的身份识别码对第一数据进行加密后,无需向 第二设备传输第一设备的身份识别码以便于第二设备解密,而是向第二设备传输该身份识别码对应的索引即可,第二设备可以根据身份识别码索引知晓正确的身份识别码,从而对第一数据进行解密,进一步提高了通信的安全性。In order to avoid the clear text transmission of the identification code, in some embodiments, when configuring the first identification code, the first device can configure the first identification code and the first identification code to the second device in the form of tuple information. The corresponding index, such as <pincode, pincode_index>. In other words, the first device can configure the first identity code and the index of the first identity code to the second device, and there is a one-to-one mapping relationship between the first identity code and the index of the first identity code. In this way, after the first device uses the first device's identification code to encrypt the first data, it does not need to transmit the first device's identification code to the second device for decryption by the second device, but transmits it to the second device. The index corresponding to the identification code is sufficient. The second device can know the correct identification code according to the identification code index, thereby decrypting the first data, further improving the security of communication.
在一些实施例中,若第一设备向第二设备配置了第一身份识别码以及第一身份识别码对应的索引时,第一设备在向第二设备发送第一消息时,第一消息中除包含第一数据之外,还可以包含第一设备的身份识别码对应的索引。其中,第一消息中的第一数据使用第一设备的身份识别码进行加密,而第一设备的身份识别码对应的索引不加密。In some embodiments, if the first device configures the first identity code and the index corresponding to the first identity code to the second device, when the first device sends the first message to the second device, in the first message In addition to containing the first data, it may also contain an index corresponding to the identification code of the first device. Wherein, the first data in the first message is encrypted using the identification code of the first device, and the index corresponding to the identification code of the first device is not encrypted.
在一些实施例中,第一设备可以向第二设备配置包含多组第一身份识别码的列表,该列表中可以包含多个元组信息,每个元组信息用于表示一组第一身份识别码以及第一身份识别码对应的索引,每个元组信息中的第一身份识别码对应的设备均可以访问第二设备。In some embodiments, the first device may configure a list containing multiple sets of first identity codes to the second device. The list may contain multiple tuple information, and each tuple information is used to represent a set of first identities. The identification code and the index corresponding to the first identification code. The device corresponding to the first identification code in each tuple information can access the second device.
在一些实施例中,第一设备向第二设备配置第一身份识别码以及第一身份识别码对应的索引时,第一身份识别码对应的索引的取值可以为非零值、非全F值。In some embodiments, when the first device configures the first identification code and the index corresponding to the first identification code to the second device, the value of the index corresponding to the first identification code may be a non-zero value or a non-all-F value. value.
在一些实施例中,第一设备向第二设备配置了第一身份识别码的相关信息(例如,身份识别码及对应的索引)之后,第一设备可以对应存储配置的第一身份识别码的相关信息。In some embodiments, after the first device configures the related information of the first identification code (for example, the identification code and the corresponding index) to the second device, the first device can store the configured first identification code accordingly. Related Information.
在一些实施例中,第二设备也可以存储第一设备配置的第一身份识别码的相关信息,例如,存储可访问第二设备的第一身份识别码以及第一身份识别码对应的索引。In some embodiments, the second device may also store information related to the first identification code configured by the first device, for example, store the first identification code that can access the second device and the index corresponding to the first identification code.
本申请实施例对第二设备存储的方式不作限定。在一些实施例中,第二设备可以将第一身份识别码的相关信息存储至第二设备的资源中。在一些实施例中,第二设备可以将第一身份识别码的相关信息存储至功能集(cluster)中,例如存储至新定义的功能集中。The embodiment of the present application does not limit the storage method of the second device. In some embodiments, the second device may store information related to the first identity code in a resource of the second device. In some embodiments, the second device may store information related to the first identity code into a function cluster, for example, into a newly defined function cluster.
第二设备存储第一身份识别码的相关信息后,便可以根据第一设备发送的身份识别码索引查询正确的身份识别码。After the second device stores the relevant information of the first identification code, it can query the correct identification code according to the identification code index sent by the first device.
图5为本申请另一实施例提供的第一设备与第二设备协商第一身份识别码的流程示意图。如图5所示,在步骤S510,第一设备向第二设备发送第三消息,第三消息用于指示第二设备返回第一身份识别码。第二设备返回第一身份识别码之后,第一身份识别码对应的设备便可以访问第二设备。也就是说,在该实施例中,第一身份识别码可以是第二设备生成的。Figure 5 is a schematic flowchart of a first device negotiating a first identity code with a second device according to another embodiment of the present application. As shown in Figure 5, in step S510, the first device sends a third message to the second device, and the third message is used to instruct the second device to return the first identity code. After the second device returns the first identification code, the device corresponding to the first identification code can access the second device. That is to say, in this embodiment, the first identification code may be generated by the second device.
在一些实施例中,第一设备和第二设备协商共享密钥时,第二设备可以为第一设备返回一个临时身份识别码,因此,在一些实施例中,采用这种第二设备为第一设备返回临时身份识别码的方案也可以称为采用临时身份识别码的方案。In some embodiments, when the first device and the second device negotiate a shared key, the second device can return a temporary identity code to the first device. Therefore, in some embodiments, this second device is used to provide the first device with a temporary identity code. The scheme in which a device returns a temporary identification code can also be called a scheme in which a temporary identification code is used.
作为一种实现方式,第一设备在向第二设备发送第一消息之前,可以向第二设备发送第三消息,该第三消息中可以携带指示第一设备不具有身份识别码的信息,例如第三消息中可以携带身份识别码索引值为0的数据,身份识别码索引值为0表示第一设备不具有身份识别码。As an implementation manner, before sending the first message to the second device, the first device may send a third message to the second device, and the third message may carry information indicating that the first device does not have an identity code, for example The third message may carry data with an identity code index value of 0. An identity code index value of 0 indicates that the first device does not have an identity code.
在步骤S520,第二设备接收第三消息后,为第一设备返回第一身份识别码。在一些实施例中,第二设备为第一设备返回的第一身份识别码为临时身份识别码,第一设备可以根据返回的临时身份识别码,实现对第二设备的访问。In step S520, after receiving the third message, the second device returns the first identification code to the first device. In some embodiments, the first identification code returned by the second device for the first device is a temporary identification code, and the first device can access the second device based on the returned temporary identification code.
作为一种实现方式,第二设备接收第三消息后,根据第三消息知晓第一设备不具有身份识别码,基于此,第二设备可以生成临时身份识别码并将该临时身份识别码显示在第二设备的显示屏上,以便于第一设备知晓该临时身份识别码。As an implementation manner, after receiving the third message, the second device knows that the first device does not have an identification code according to the third message. Based on this, the second device can generate a temporary identification code and display the temporary identification code on on the display screen of the second device so that the first device knows the temporary identification code.
在一些实施例中,第二设备知晓第一设备不具有身份识别码后,还可以向第一设备发送第三响应,第三响应可以用于告知第一设备输入第二设备为第一设备返回的临时身份识别码。In some embodiments, after the second device knows that the first device does not have an identification code, it can also send a third response to the first device. The third response can be used to inform the first device to input and the second device returns a response for the first device. temporary identification code.
在一些实施例中,第一设备输入第一设备的临时身份识别码后,可以向第二设备发送第一消息。可选地,第一设备在向第二设备发送第一消息时,第一消息中除包含第一数据之外,还可以包含第一设备的临时身份识别码对应的索引,该临时身份识别码对应的索引 用于表示第一设备已经具有身份识别码了。示例性地,第一消息中包含的临时身份识别码对应的索引可以为全F值,该全F值用于表示第一设备具有临时身份识别码了。In some embodiments, after the first device inputs the temporary identification code of the first device, it may send the first message to the second device. Optionally, when the first device sends the first message to the second device, the first message, in addition to containing the first data, may also contain an index corresponding to the temporary identity code of the first device. The temporary identity code The corresponding index is used to indicate that the first device already has an identification code. For example, the index corresponding to the temporary identification code contained in the first message may be a full F value, and the full F value is used to indicate that the first device has a temporary identification code.
在一些实施例中,第一设备输入临时身份识别码后,可以不保存该临时身份识别码。In some embodiments, after the first device inputs the temporary identification code, it may not save the temporary identification code.
前文提及,在一些实施例中,第一设备和第二设备在协商共享密钥前,可以根据第一设备和第二设备分别支持的密钥协商方式(或类型),协商确定共享密钥的协商方式。下面结合图6,对第一设备和第二设备协商共享密钥的协商方式的过程进行详细介绍。As mentioned above, in some embodiments, before negotiating the shared key, the first device and the second device may negotiate to determine the shared key according to the key negotiation method (or type) supported by the first device and the second device respectively. negotiation method. The following describes in detail the process of the first device and the second device negotiating the shared key negotiation method with reference to FIG. 6 .
在步骤S610,第一设备向第二设备发送第四消息,第四消息用于指示第一设备支持的密钥协商方式。In step S610, the first device sends a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device.
第一设备支持的密钥协商方式可以包括一种或多种,示例性地,第一设备支持的密钥协商方式可以包括以下方式中的一种或多种:基于密钥对协商、基于节点互操作证书协商、以及基于sigma协议协商。The key negotiation methods supported by the first device may include one or more. For example, the key negotiation methods supported by the first device may include one or more of the following methods: key pair-based negotiation, node-based Interoperability certificate negotiation and sigma protocol negotiation.
应该理解,第一设备和第二设备协商确定出共享密钥的协商方式之后,可以基于该协商方式协商共享密钥,并建立基于该共享密钥的互操作通道,因此,在一些实施例中,可以根据第一设备和第二设备协商共享密钥的方式的不同,将互操作通道划分为不同的类型。示例性地,第一设备和第二设备基于密钥对协商共享密钥,其对应的互操作通道的类型为基于密钥对的互操作通道。或者说,第一设备支持的密钥协商方式也可以称为第一设备支持的建立互操作的类型。因此,在一些实施例中,第四消息也可以称为互操作会话建立请求消息,本申请对此并不限定。It should be understood that after the first device and the second device negotiate and determine the negotiation method of the shared key, they can negotiate the shared key based on the negotiation method and establish an interoperability channel based on the shared key. Therefore, in some embodiments, , the interoperability channel can be divided into different types according to the different ways in which the first device and the second device negotiate the shared key. For example, the first device and the second device negotiate a shared key based on a key pair, and the type of the corresponding interoperation channel is an interoperation channel based on the key pair. In other words, the key negotiation method supported by the first device may also be referred to as the type of interoperability establishment supported by the first device. Therefore, in some embodiments, the fourth message may also be called an interoperation session establishment request message, which is not limited by this application.
在步骤S620,第二设备向第一设备发送第四响应,第四响应用于指示基于密钥对协商共享密钥。In step S620, the second device sends a fourth response to the first device, where the fourth response is used to indicate negotiating a shared key based on the key pair.
作为一种实现方式,第二设备可以根据第一设备支持的密钥协商方式,确定基于密钥对协商共享密钥,并将该信息通过第四响应通知给第一设备。As an implementation manner, the second device may determine to negotiate the shared key based on the key pair according to the key negotiation mode supported by the first device, and notify the first device of the information through a fourth response.
作为另一种实现方式,第二设备接收到第四消息之后,可以在第四响应中指示第二设备支持的密钥协商方式,由第一设备确定共享密钥的协商方式。第二设备支持的密钥协商方式可以包括以下方式的一种或多种:基于密钥对协商、基于节点互操作证书协商、以及基于sigma协议协商。As another implementation manner, after receiving the fourth message, the second device may indicate the key negotiation method supported by the second device in the fourth response, and the first device determines the negotiation method of the shared key. The key negotiation method supported by the second device may include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
例如,第二设备仅支持基于密钥对协商共享密钥,那么第四响应中仅包含基于密钥对协商共享密钥的方式,第一设备接收到第四响应后,可以直接确定基于密钥对与第二设备协商共享密钥。或者,第二设备支持的密钥协商方式包括多种,例如,包括基于密钥对协商和基于sigma协议协商,那么第一设备接收到第四响应后,可以从第二设备支持的密钥协商方式中选择一种,在本申请实施例中,第一设备选择的密钥协商方式为基于密钥对与第二设备协商共享密钥。For example, if the second device only supports shared key negotiation based on a key pair, then the fourth response only contains the method of negotiating a shared key based on a key pair. After receiving the fourth response, the first device can directly determine that the shared key is negotiated based on a key pair. Negotiate a shared secret key with the second device. Alternatively, the second device supports multiple key negotiation methods, for example, including key pair-based negotiation and sigma protocol-based negotiation. Then, after receiving the fourth response, the first device can use the key negotiation method supported by the second device. Choose one of the methods. In this embodiment of the present application, the key negotiation method selected by the first device is to negotiate a shared key with the second device based on a key pair.
为了便于本领域技术人员理解本申请实施例的技术方案的实施过程,下面给出两个具体示例。应该理解,该示例并不用于限定本申请的技术方案,例如,示例中的步骤并不都是必须的,实际实施时可能只采用部分步骤,或者采用比列举的步骤更多的步骤;或者,示例中的步骤的执行顺序也不是必须的,某些步骤是可以同时执行或者调换执行顺序的。In order to facilitate those skilled in the art to understand the implementation process of the technical solutions of the embodiments of this application, two specific examples are given below. It should be understood that this example is not used to limit the technical solution of the present application. For example, not all steps in the example are necessary, and only some of the steps may be used in actual implementation, or more steps than the listed steps may be used; or, The execution order of the steps in the example is not necessary. Some steps can be executed at the same time or the execution order is reversed.
示例一(采用固定身份识别码)Example 1 (using fixed identification code)
图7为本申请另一实施例提供的建立互操作通道的方法的流程示意图。如图7所示,该方法可以包括步骤S7010至步骤S7140。Figure 7 is a schematic flowchart of a method for establishing an interoperability channel provided by another embodiment of the present application. As shown in Figure 7, the method may include steps S7010 to S7140.
在步骤S7010,第一设备与第二设备建立配置通道。该配置通道可以是一种安全配置信道,用于第一设备与第二设备之间进行配置操作。In step S7010, the first device establishes a configuration channel with the second device. The configuration channel may be a secure configuration channel, used for configuration operations between the first device and the second device.
在步骤S7020,第一设备向第二设备发送第二消息,第二消息用于配置第一身份识别码以及第一身份识别码对应的索引,例如配置元组信息<pincode,pincode_index>,以便第一身份识别码对应的设备可以访问第二设备。In step S7020, the first device sends a second message to the second device. The second message is used to configure the first identification code and the index corresponding to the first identification code, for example, configure the tuple information <pincode, pincode_index>, so that the first The device corresponding to one identification code can access the second device.
在一些实施例中,第一设备可以向第二设备配置多组第一身份识别码以及第一身份识 别码对应的索引,即配置多组元组信息。该多组元组信息可以形成配置列表,用于指示可访问第二设备的第一身份识别码的相关信息。In some embodiments, the first device may configure multiple sets of first identification codes and indexes corresponding to the first identification codes to the second device, that is, configure multiple sets of tuple information. The multiple sets of tuple information may form a configuration list, used to indicate information related to the first identification code that can access the second device.
在一些实施例中,第一设备向第二设备配置第一身份识别码以及第一身份识别码对应的索引后,第一设备可以对应存储该第一身份识别码以及第一身份识别码对应的索引。In some embodiments, after the first device configures the first identity code and the index corresponding to the first identity code to the second device, the first device can correspondingly store the first identity code and the index corresponding to the first identity code. index.
在步骤S7030,第二设备存储第一设备配置的第一身份识别码以及第一身份识别码对应的索引,例如存储至第二设备的资源中,或者存储至第二设备的功能集(比如新定义的功能集)中。In step S7030, the second device stores the first identification code configured by the first device and the index corresponding to the first identification code, for example, in a resource of the second device, or in a function set of the second device (such as a new defined function set).
在步骤S7040,第一设备与第二设备之间的配置结束,退出配置通道。In step S7040, the configuration between the first device and the second device ends, and the configuration channel exits.
在一些实施例中,第一设备除了向第二设备配置第一身份识别码之外,还可以向第二设备配置一些基础配置,待完成身份识别码以及基础配置后,第一设备与第二设备之间的配置结束,退出配置通道。In some embodiments, in addition to configuring the first identity code to the second device, the first device can also configure some basic configurations to the second device. After the identity code and basic configuration are completed, the first device communicates with the second device. The configuration between devices is completed and the configuration channel is exited.
在步骤S7050,第一设备向第二设备发送第四消息,第四消息用于指示第一设备支持的密钥协商方式。In step S7050, the first device sends a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device.
在一些实施例中,第一设备支持的密钥协商方式可以包括以下方式中的一种或多种:基于密钥对协商、基于节点互操作证书协商、基于sigma协议协商。In some embodiments, the key negotiation method supported by the first device may include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
在步骤S7060,第二设备向第一设备返回第四响应。第四响应可以用于指示第二设备支持的密钥协商方式,例如第二设备支持的密钥协商方式为基于密钥对协商。In step S7060, the second device returns a fourth response to the first device. The fourth response may be used to indicate the key negotiation method supported by the second device. For example, the key negotiation method supported by the second device is based on key pair negotiation.
在步骤S7070,第一设备使用第一设备的身份识别码对第一数据进行加密。In step S7070, the first device encrypts the first data using the identification code of the first device.
作为一种实现方式,首先第一设备可以生成随机数r1和临时密钥对(第一公钥和第一私钥),然后使用第一私钥对第一公钥、随机数r1、以及第一设备的设备标识等信息中的一种或多种进行加密得到签名sign1,进一步得到第一数据,第一数据可以包括以下信息中的一种或多种:第一公钥、随机数r1、第一设备的设备标识、签名sign1。得到第一数据后,第一设备可以使用第一设备的身份识别码对第一数据进行加密。As an implementation manner, first the first device can generate a random number r1 and a temporary key pair (the first public key and the first private key), and then use the first private key to pair the first public key, the random number r1, and the first private key. One or more of the device identification and other information of a device are encrypted to obtain the signature sign1, and further the first data is obtained. The first data may include one or more of the following information: the first public key, the random number r1, The device identification and signature of the first device, sign1. After obtaining the first data, the first device can encrypt the first data using the identification code of the first device.
在步骤S7080,第一设备向第二设备发送第一消息,第一消息中可以携带使用第一设备的身份识别码进行加密的第一数据以及该身份识别码对应的索引,该索引是不加密的。In step S7080, the first device sends a first message to the second device. The first message may carry the first data encrypted using the identity code of the first device and the index corresponding to the identity code. The index is not encrypted. of.
在一些实施例中,该身份识别码对应的索引为非零值、非全F值。In some embodiments, the index corresponding to the identification code is a non-zero value or a non-full F value.
在步骤S7090,第二设备根据第一公钥和第二私钥,生成共享密钥。In step S7090, the second device generates a shared key based on the first public key and the second private key.
在一些实施例中,第二设备接收第一消息之后,可以通过第一消息中携带的索引值对应找到身份识别码,使用该身份识别码解密第一数据。In some embodiments, after receiving the first message, the second device can find the identification code corresponding to the index value carried in the first message, and use the identification code to decrypt the first data.
在一些实施例中,第二设备解密第一数据后,可以使用第一公钥校验签名sign1,验证第一设备的身份以及第一设备的密钥对的真实性。In some embodiments, after the second device decrypts the first data, it can use the first public key to verify the signature sign1 to verify the identity of the first device and the authenticity of the key pair of the first device.
在一些实施例中,第二设备解密第一数据后,可以生成随机数r2和临时密钥对(第二公钥和第二私钥),然后使用第二私钥对第二公钥、随机数r2、以及第二设备的设备标识等信息中的一种或多种进行加密得到签名sign2,进一步得到第二数据,第二数据可以包括以下信息中的一种或多种:第二公钥、随机数r2、第二设备的设备标识、签名sign2。In some embodiments, after the second device decrypts the first data, it can generate a random number r2 and a temporary key pair (the second public key and the second private key), and then use the second private key to pair the second public key and the random key. One or more of the number r2 and the device identification of the second device are encrypted to obtain the signature sign2, and further the second data is obtained. The second data may include one or more of the following information: the second public key , random number r2, device identification of the second device, and signature sign2.
基于此,第二设备可以根据以下信息中的一种或多种生成共享密钥:根据第一公钥和第二私钥生成的第二密钥、随机数r1、随机数r2、第一设备的设备标识、第二设备的设备标识、第一设备的身份识别码等。Based on this, the second device can generate a shared key based on one or more of the following information: the second key generated based on the first public key and the second private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
在步骤S7100,第二设备向第一设备发送第一响应,第一响应中携带使用第一公钥进行加密的第二数据。In step S7100, the second device sends a first response to the first device, where the first response carries second data encrypted using the first public key.
在步骤S7110,第一设备根据第二公钥和第一私钥,生成共享密钥。In step S7110, the first device generates a shared key based on the second public key and the first private key.
在一些实施例中,第一设备接收第一响应后,可以通过第一私钥解密第二数据,使用第二公钥解签签名sign2,以对第二设备的身份进行校验。In some embodiments, after receiving the first response, the first device can decrypt the second data using the first private key and use the second public key to decrypt the signature sign2 to verify the identity of the second device.
基于此,第一设备可以根据以下信息中的一种或多种生成共享密钥:根据第二公钥和第一私钥生成的第一密钥、随机数r1、随机数r2、第一设备的设备标识、第二设备的设备 标识、第一设备的身份识别码等。Based on this, the first device can generate a shared key based on one or more of the following information: the first key generated based on the second public key and the first private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
在步骤S7120,第一设备可以向第二设备返回密钥协商的结果,该结果可以用于指示第一设备已经确定共享密钥。In step S7120, the first device may return a key negotiation result to the second device, and the result may be used to indicate that the first device has determined the shared key.
在步骤S7130,第一设备和第二设备建立基于共享密钥的互操作通道。In step S7130, the first device and the second device establish an interoperation channel based on the shared key.
在步骤S7140,第一设备通过互操作通道对第二设备进行控制。In step S7140, the first device controls the second device through the interoperation channel.
示例二(采用临时身份识别码)Example 2 (using temporary identification code)
图8为本申请又一实施例提供的建立互操作通道的方法的流程示意图。如图8所示,该方法可以包括步骤S8010至步骤S8130。Figure 8 is a schematic flowchart of a method for establishing an interoperability channel provided by yet another embodiment of the present application. As shown in Figure 8, the method may include steps S8010 to S8130.
在步骤S8010,第一设备与第二设备完成基础配置,并退出配置通道。In step S8010, the first device and the second device complete basic configuration and exit the configuration channel.
在步骤S8020,第一设备向第二设备发送第四消息,第四消息用于指示第一设备支持的密钥协商方式。In step S8020, the first device sends a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device.
在一些实施例中,第一设备支持的密钥协商方式可以包括以下方式中的一种或多种:基于密钥对协商、基于节点互操作证书协商、基于sigma协议协商。In some embodiments, the key negotiation method supported by the first device may include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
在步骤S8030,第二设备向第一设备返回第四响应。第四响应可以用于指示第二设备支持的密钥协商方式,例如第二设备支持的密钥协商方式为基于密钥对协商。In step S8030, the second device returns a fourth response to the first device. The fourth response may be used to indicate the key negotiation method supported by the second device. For example, the key negotiation method supported by the second device is based on key pair negotiation.
在步骤S8040,第一设备向第二设备发送第三消息,第三消息用于指示第二设备返回第一身份识别码。In step S8040, the first device sends a third message to the second device, and the third message is used to instruct the second device to return the first identification code.
在一些实施例中,第三消息中可以携带指示第一设备不具有身份识别码的信息,例如,可以携带身份识别码索引为0的数据来指示第一设备不具有身份识别码。In some embodiments, the third message may carry information indicating that the first device does not have an identity code. For example, data with an identity code index of 0 may be carried to indicate that the first device does not have an identity code.
在步骤S8050,第二设备为第一设备返回第一身份识别码,该第一身份识别码可以是临时身份识别码。In step S8050, the second device returns a first identification code to the first device. The first identification code may be a temporary identification code.
在一些实施例中,第二设备可以向第一设备发送第三响应,返回错误码,告知第一设备需要输入第二设备为第一设备返回的临时身份识别码。In some embodiments, the second device may send a third response to the first device, return an error code, and inform the first device that it needs to enter the temporary identity code returned by the second device for the first device.
在一些实施例中,第二设备可以将需要输入的临时身份识别码显示在第二设备的显示屏上。In some embodiments, the second device may display the temporary identification code that needs to be entered on the display screen of the second device.
在步骤S8060,第一设备使用第一设备的身份识别码对第一数据进行加密。In step S8060, the first device encrypts the first data using the identification code of the first device.
作为一种实现方式,第一设备输入临时身份识别码之后,首先可以生成随机数r1和临时密钥对(第一公钥和第一私钥),然后使用第一私钥对第一公钥、随机数r1、以及第一设备的设备标识等信息中的一种或多种进行加密得到签名sign1,进一步得到第一数据,第一数据可以包括以下信息中的一种或多种:第一公钥、随机数r1、第一设备的设备标识、签名sign1。得到第一数据后,第一设备可以使用第一设备的身份识别码对第一数据进行加密。As an implementation method, after the first device inputs the temporary identity code, it can first generate a random number r1 and a temporary key pair (first public key and first private key), and then use the first private key to pair the first public key , random number r1, and the device identification of the first device and other information are encrypted to obtain the signature sign1, and further obtain the first data. The first data may include one or more of the following information: first Public key, random number r1, device identification of the first device, and signature sign1. After obtaining the first data, the first device can encrypt the first data using the identification code of the first device.
在一些实施例中,第一设备输入临时身份识别码之后,可以不保存该身份识别码。In some embodiments, after the first device inputs the temporary identification code, the first device may not save the identification code.
在步骤S8070,第一设备向第二设备发送第一消息,第一消息中可以携带使用第一设备的身份识别码进行加密的第一数据以及该身份识别码对应的索引,该索引是不加密的。In step S8070, the first device sends a first message to the second device. The first message may carry the first data encrypted using the identification code of the first device and the index corresponding to the identification code. The index is not encrypted. of.
在一些实施例中,该身份识别码对应的索引为全F值,该全F值用于指示第一设备有临时身份识别码了。In some embodiments, the index corresponding to the identification code is a full F value, and the full F value is used to indicate that the first device has a temporary identification code.
在步骤S8080,第二设备根据第一公钥和第二私钥,生成共享密钥。In step S8080, the second device generates a shared key based on the first public key and the second private key.
在一些实施例中,第二设备接收第一消息之后,可以通过第一消息中携带的索引值对应找到身份识别码,使用该身份识别码解密第一数据。In some embodiments, after receiving the first message, the second device can find the identification code corresponding to the index value carried in the first message, and use the identification code to decrypt the first data.
在一些实施例中,第二设备解密第一数据后,可以使用第一公钥校验签名sign1,验证第一设备的身份以及第一设备的密钥对的真实性。In some embodiments, after the second device decrypts the first data, it can use the first public key to verify the signature sign1 to verify the identity of the first device and the authenticity of the key pair of the first device.
在一些实施例中,第二设备解密第一数据后,可以生成随机数r2和临时密钥对(第二公钥和第二私钥),然后使用第二私钥对第二公钥、随机数r2、以及第二设备的设备标识等信息中的一种或多种进行加密得到签名sign2,进一步得到第二数据,第二数据可以包括 以下信息中的一种或多种:第二公钥、随机数r2、第二设备的设备标识、签名sign2。In some embodiments, after the second device decrypts the first data, it can generate a random number r2 and a temporary key pair (the second public key and the second private key), and then use the second private key to pair the second public key and the random key. One or more of the number r2 and the device identification of the second device are encrypted to obtain the signature sign2, and further the second data is obtained. The second data may include one or more of the following information: the second public key , random number r2, device identification of the second device, and signature sign2.
基于此,第二设备可以根据以下信息中的一种或多种生成共享密钥:根据第一公钥和第二私钥生成的第二密钥、随机数r1、随机数r2、第一设备的设备标识、第二设备的设备标识、第一设备的身份识别码等。Based on this, the second device can generate a shared key based on one or more of the following information: the second key generated based on the first public key and the second private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
在步骤S8090,第二设备向第一设备发送第一响应,第一响应中携带使用第一公钥进行加密的第二数据。In step S8090, the second device sends a first response to the first device, where the first response carries second data encrypted using the first public key.
在步骤S8100,第一设备根据第二公钥和第一私钥,生成共享密钥。In step S8100, the first device generates a shared key based on the second public key and the first private key.
在一些实施例中,第一设备接收第一响应后,可以通过第一私钥解密第二数据,使用第二公钥解签签名sign2,以对第二设备的身份进行校验。In some embodiments, after receiving the first response, the first device can decrypt the second data using the first private key and use the second public key to decrypt the signature sign2 to verify the identity of the second device.
基于此,第一设备可以根据以下信息中的一种或多种生成共享密钥:根据第二公钥和第一私钥生成的第一密钥、随机数r1、随机数r2、第一设备的设备标识、第二设备的设备标识、第一设备的身份识别码等。Based on this, the first device can generate a shared key based on one or more of the following information: the first key generated based on the second public key and the first private key, the random number r1, the random number r2, the first device device identification, the device identification of the second device, the identification code of the first device, etc.
在步骤S8110,第一设备可以向第二设备返回密钥协商的结果,该结果可以用于指示第一设备已经确定共享密钥。In step S8110, the first device may return a key negotiation result to the second device, and the result may be used to indicate that the first device has determined the shared key.
在步骤S8120,第一设备和第二设备建立基于共享密钥的互操作通道。In step S8120, the first device and the second device establish an interoperation channel based on the shared key.
在步骤S8130,第一设备通过互操作通道对第二设备进行控制。In step S8130, the first device controls the second device through the interoperation channel.
上文结合图1至图8,详细描述了本申请的方法实施例,下面结合图9至图11,详细描述本申请的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。The method embodiments of the present application are described in detail above with reference to FIGS. 1 to 8 , and the device embodiments of the present application are described in detail below with reference to FIGS. 9 to 11 . It should be understood that the description of the method embodiments corresponds to the description of the device embodiments. Therefore, the parts not described in detail can be referred to the previous method embodiments.
图9为本申请一实施例提供的建立互操作通道的装置的结构示意图。该装置可以配置于前文所述的第一设备。图9所示的装置900可以包括第一协商模块910、建立模块920以及控制模块930。Figure 9 is a schematic structural diagram of a device for establishing an interoperability channel provided by an embodiment of the present application. The device may be configured in the first device mentioned above. The device 900 shown in FIG. 9 may include a first negotiation module 910, an establishment module 920 and a control module 930.
第一协商模块910可以用于根据第一设备的密钥对与第二设备协商共享密钥,第一设备的密钥对包括第一公钥和第一私钥。The first negotiation module 910 may be configured to negotiate a shared key with the second device according to a key pair of the first device, where the key pair of the first device includes a first public key and a first private key.
建立模块920可以用于与第二设备建立基于共享密钥的互操作通道。The establishing module 920 may be used to establish an interoperability channel based on the shared key with the second device.
控制模块930可以用于通过互操作通道向第二设备发送控制指令,以对第二设备进行控制,其中,第一设备为终端设备,第二设备为车设备。The control module 930 may be used to send a control instruction to a second device through an interoperation channel to control the second device, where the first device is a terminal device and the second device is a vehicle device.
可选地,第一协商模块进一步包括:第一发送模块,用于向第二设备发送第一消息,第一消息包含第一数据,第一数据包含第一公钥,第一公钥用于第二设备生成共享密钥;第一接收模块,用于从第二设备接收第一响应,第一响应包含第二数据,第二数据包含第二公钥,第二公钥和第二私钥组成第二设备的密钥对;生成模块,用于根据第二公钥和第一私钥,生成共享密钥。Optionally, the first negotiation module further includes: a first sending module, configured to send a first message to the second device, where the first message includes first data, the first data includes a first public key, and the first public key is used to The second device generates a shared key; a first receiving module is configured to receive a first response from the second device, the first response includes second data, and the second data includes a second public key, a second public key and a second private key. A key pair constituting the second device; a generating module configured to generate a shared key based on the second public key and the first private key.
可选地,第一数据还包含以下信息中的一种或多种:第一设备生成的随机数、第一设备的设备标识、以及第一签名;和/或,第二数据还包含以下信息中的一种或多种:第二设备生成的随机数、第二设备的设备标识、以及第二签名。Optionally, the first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or the second data also includes the following information. One or more of: the random number generated by the second device, the device identification of the second device, and the second signature.
可选地,第一签名为第一设备使用第一私钥对以下信息中的一种或多种进行加密得到的:第一公钥、第一设备生成的随机数、第一设备的设备标识;第二签名为第二设备使用第二私钥对以下信息中的一种或多种进行加密得到的:第二公钥、第二设备生成的随机数、第二设备的设备标识。Optionally, the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first public key, a random number generated by the first device, and the device identification of the first device. ; The second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, and the device identification of the second device.
可选地,装置900还包括:加密模块,用于根据第一设备的身份识别码对第一数据进行加密。Optionally, the apparatus 900 further includes: an encryption module, configured to encrypt the first data according to the identification code of the first device.
可选地,装置900还包括:第二协商模块,用于与第二设备协商第一身份识别码,第一身份识别码用于第一身份识别码对应的设备访问第二设备。Optionally, the apparatus 900 further includes: a second negotiation module, configured to negotiate a first identity code with the second device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
可选地,第二协商模块进一步包括:第二发送模块,用于向第二设备发送第二消息,第二消息用于配置第一身份识别码。Optionally, the second negotiation module further includes: a second sending module, configured to send a second message to the second device, where the second message is used to configure the first identity code.
可选地,第二协商模块进一步包括:第三发送模块,用于向第二设备发送第三消息,第三消息用于指示第二设备返回第一身份识别码。Optionally, the second negotiation module further includes: a third sending module, configured to send a third message to the second device, where the third message is used to instruct the second device to return the first identity code.
可选地,第三消息携带指示第一设备不具有身份识别码的信息,装置900还包括:第二接收模块,用于接收第二设备为第一设备返回的第一身份识别码。Optionally, the third message carries information indicating that the first device does not have an identification code. The apparatus 900 further includes: a second receiving module configured to receive the first identification code returned by the second device for the first device.
可选地,第二设备返回的第一身份识别码显示在第二设备的显示屏上。Optionally, the first identification code returned by the second device is displayed on the display screen of the second device.
可选地,第二设备返回的第一身份识别码为临时身份识别码。Optionally, the first identification code returned by the second device is a temporary identification code.
可选地,装置900还包括:第三协商模块,用于与第二设备协商共享密钥的协商方式。Optionally, the apparatus 900 further includes: a third negotiation module, configured to negotiate a shared key negotiation method with the second device.
可选地,第三协商模块进一步包括:第四发送模块,用于向第二设备发送第四消息,第四消息用于指示第一设备支持的密钥协商方式;第三接收模块,用于从第二设备接收第四响应,第四响应用于指示基于密钥对协商共享密钥。Optionally, the third negotiation module further includes: a fourth sending module, configured to send a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device; and a third receiving module, configured to A fourth response is received from the second device, the fourth response being used to indicate negotiating a shared key based on the key pair.
可选地,第一设备和/或第二设备支持的密钥协商方式包括以下方式中的一种或多种:基于密钥对协商,基于节点互操作证书协商,以及基于sigma协议协商。Optionally, the key negotiation methods supported by the first device and/or the second device include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
可选地,共享密钥是第一设备根据以下信息中的一种或多种生成的:第一密钥、第一设备生成的随机数、第二设备生成的随机数、第一设备的设备标识、第二设备的设备标识、以及第一设备的身份识别码,其中,第一密钥是第一设备根据第二公钥和第一私钥生成的。Optionally, the shared key is generated by the first device based on one or more of the following information: the first key, a random number generated by the first device, a random number generated by the second device, the device of the first device identification, the device identification of the second device, and the identification code of the first device, where the first key is generated by the first device based on the second public key and the first private key.
图10为本申请另一实施例提供的建立互操作通道的装置的结构示意图。该装置可以配置于前文所述的第二设备。图10所示的装置1000可以包括第一协商模块1010、建立模块1020、以及第一接收模块1030。Figure 10 is a schematic structural diagram of a device for establishing an interoperability channel provided by another embodiment of the present application. The device may be configured in the second device mentioned above. The device 1000 shown in FIG. 10 may include a first negotiation module 1010, an establishment module 1020, and a first receiving module 1030.
第一协商模块1010可以用于根据第二设备的密钥对与第一设备协商共享密钥,第二设备的密钥对包括第二公钥和第二私钥。The first negotiation module 1010 may be configured to negotiate a shared key with the first device according to a key pair of the second device, where the key pair of the second device includes a second public key and a second private key.
建立模块1020可以用于与第一设备建立基于共享密钥的互操作通道。The establishment module 1020 may be used to establish an interoperability channel based on the shared key with the first device.
第一接收模块1030可以用于通过互操作通道接收第一设备的控制指令,其中,第一设备为终端设备,第二设备为车设备。The first receiving module 1030 may be configured to receive the control instruction of the first device through the interoperation channel, where the first device is a terminal device and the second device is a vehicle device.
可选地,第一协商模块进一步包括:第二接收模块,用于接收第一设备发送的第一消息,第一消息包含第一数据,第一数据包含第一公钥,第一公钥和第一私钥组成第一设备的密钥对;生成模块,用于根据第一公钥和第二私钥,生成共享密钥;第一发送模块,用于向第一设备发送第一响应,第一响应包含第二数据,第二数据包含第二公钥,第二公钥用于第一设备生成共享密钥。Optionally, the first negotiation module further includes: a second receiving module, configured to receive the first message sent by the first device, the first message includes the first data, the first data includes the first public key, the first public key and The first private key forms a key pair of the first device; the generating module is used to generate a shared key based on the first public key and the second private key; the first sending module is used to send a first response to the first device, The first response includes second data, the second data includes a second public key, and the second public key is used by the first device to generate a shared key.
可选地,第一数据还包含以下信息中的一种或多种:第一设备生成的随机数、第一设备的设备标识、以及第一签名;和/或,第二数据还包含以下信息中的一种或多种:第二设备生成的随机数、第二设备的设备标识、以及第二签名。Optionally, the first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or the second data also includes the following information. One or more of: the random number generated by the second device, the device identification of the second device, and the second signature.
可选地,第一签名为第一设备使用第一私钥对以下信息中的一种或多种进行加密得到的:第一公钥、第一设备生成的随机数、第一设备的设备标识;第二签名为第二设备使用第二私钥对以下信息中的一种或多种进行加密得到的:第二公钥、第二设备生成的随机数、第二设备的设备标识。Optionally, the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first public key, a random number generated by the first device, and the device identification of the first device. ; The second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, and the device identification of the second device.
可选地,装置1000还包括:解密模块,用于根据第一设备的身份识别码对第一数据进行解密。Optionally, the apparatus 1000 further includes: a decryption module, configured to decrypt the first data according to the identification code of the first device.
可选地,装置1000还包括:第二协商模块,用于与第一设备协商第一身份识别码,第一身份识别码用于第一身份识别码对应的设备访问第二设备。Optionally, the apparatus 1000 further includes: a second negotiation module, configured to negotiate a first identity code with the first device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
可选地,第二协商模块进一步包括:第三接收模块,用于接收第一设备发送的第二消息,第二消息用于配置第一身份识别码。Optionally, the second negotiation module further includes: a third receiving module, configured to receive a second message sent by the first device, where the second message is used to configure the first identity code.
可选地,第二协商模块进一步包括:第四接收模块,用于接收第一设备发送的第三消息,第三消息用于指示第二设备返回第一身份识别码。Optionally, the second negotiation module further includes: a fourth receiving module, configured to receive a third message sent by the first device, where the third message is used to instruct the second device to return the first identity code.
可选地,第三消息携带指示第一设备不具有身份识别码的信息,装置1000还包括:返回模块,用于为第一设备返回第一身份识别码。Optionally, the third message carries information indicating that the first device does not have an identification code, and the apparatus 1000 further includes: a return module configured to return the first identification code for the first device.
可选地,第二设备返回的第一身份识别码显示在第二设备的显示屏上。Optionally, the first identification code returned by the second device is displayed on the display screen of the second device.
可选地,第二设备返回的第一身份识别码为临时身份识别码。Optionally, the first identification code returned by the second device is a temporary identification code.
可选地,装置1000还包括:第三协商模块,用于与第一设备协商共享密钥的协商方式。Optionally, the apparatus 1000 further includes: a third negotiation module, configured to negotiate a shared key negotiation method with the first device.
可选地,第三协商模块进一步包括:第五接收模块,用于接收第一设备发送的第四消息,第四消息用于指示第一设备支持的密钥协商方式;第二发送模块,用于向第一设备发送第四响应,第四响应用于指示基于密钥对协商共享密钥。Optionally, the third negotiation module further includes: a fifth receiving module, configured to receive a fourth message sent by the first device, where the fourth message is used to indicate the key negotiation method supported by the first device; a second sending module, configured to A fourth response is sent to the first device, where the fourth response is used to indicate that the shared key is negotiated based on the key pair.
可选地,第一设备和/或第二设备支持的密钥协商方式包括以下方式中的一种或多种:基于密钥对协商,基于节点互操作证书协商,以及基于sigma协议协商。Optionally, the key negotiation methods supported by the first device and/or the second device include one or more of the following methods: key pair-based negotiation, node interoperability certificate-based negotiation, and sigma protocol-based negotiation.
可选地,共享密钥是第二设备根据以下信息中的一种或多种生成的:第二密钥、第一设备生成的随机数、第二设备生成的随机数、第一设备的设备标识、第二设备的设备标识、以及第一设备的身份识别码,其中,第二密钥是第二设备根据第一公钥和第二私钥生成的。Optionally, the shared key is generated by the second device based on one or more of the following information: the second key, the random number generated by the first device, the random number generated by the second device, the device of the first device identification, the device identification of the second device, and the identification code of the first device, where the second key is generated by the second device based on the first public key and the second private key.
在可选的实施例中,建立互操作通道的装置900和/或建立互操作通道的装置1000还可以包括收发器1130和存储器1120,具体如图11所示。In an optional embodiment, the device 900 for establishing an interoperation channel and/or the device 1000 for establishing an interoperation channel may also include a transceiver 1130 and a memory 1120, as specifically shown in FIG. 11 .
图11是本申请实施例的通信装置的示意性结构图。图11中的虚线表示该单元或模块为可选的。该装置1100可用于实现上述方法实施例中描述的方法。装置1100可以是芯片、终端设备或网络设备。Figure 11 is a schematic structural diagram of a communication device according to an embodiment of the present application. The dashed line in Figure 11 indicates that the unit or module is optional. The device 1100 can be used to implement the method described in the above method embodiment. Device 1100 may be a chip, terminal device or network device.
装置1100可以包括一个或多个处理器1110。该处理器1110可支持装置1100实现前文方法实施例所描述的方法。该处理器1110可以是通用处理器或者专用处理器。例如,该处理器可以为中央处理单元(central processing unit,CPU)。或者,该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Apparatus 1100 may include one or more processors 1110. The processor 1110 can support the device 1100 to implement the method described in the foregoing method embodiments. The processor 1110 may be a general-purpose processor or a special-purpose processor. For example, the processor may be a central processing unit (CPU). Alternatively, the processor can also be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
装置1100还可以包括一个或多个存储器1120。存储器1120上存储有程序,该程序可以被处理器1110执行,使得处理器1110执行前文方法实施例所描述的方法。存储器1120可以独立于处理器1110也可以集成在处理器1110中。Apparatus 1100 may also include one or more memories 1120. The memory 1120 stores a program, which can be executed by the processor 1110, so that the processor 1110 executes the method described in the foregoing method embodiment. The memory 1120 may be independent of the processor 1110 or integrated in the processor 1110 .
装置1100还可以包括收发器1130。处理器1110可以通过收发器1130与其他设备或芯片进行通信。例如,处理器1110可以通过收发器1130与其他设备或芯片进行数据收发。Device 1100 may also include a transceiver 1130. Processor 1110 may communicate with other devices or chips through transceiver 1130. For example, the processor 1110 can transmit and receive data with other devices or chips through the transceiver 1130 .
本申请实施例还提供一种计算机可读存储介质,用于存储程序。该计算机可读存储介质可应用于本申请实施例提供的终端或网络设备中,并且该程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。An embodiment of the present application also provides a computer-readable storage medium for storing a program. The computer-readable storage medium can be applied in the terminal or network device provided by the embodiments of the present application, and the program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
本申请实施例还提供一种计算机程序产品。该计算机程序产品包括程序。该计算机程序产品可应用于本申请实施例提供的终端或网络设备中,并且该程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。An embodiment of the present application also provides a computer program product. The computer program product includes a program. The computer program product can be applied in the terminal or network device provided by the embodiments of the present application, and the program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
本申请实施例还提供一种计算机程序。该计算机程序可应用于本申请实施例提供的终端或网络设备中,并且该计算机程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。An embodiment of the present application also provides a computer program. The computer program can be applied to the terminal or network device provided by the embodiments of the present application, and the computer program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
应理解,本申请中术语“系统”和“网络”可以被可互换使用。另外,本申请使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。It should be understood that the terms "system" and "network" may be used interchangeably in this application. In addition, the terms used in this application are only used to explain specific embodiments of the application and are not intended to limit the application. The terms “first”, “second”, “third” and “fourth” in the description, claims and drawings of this application are used to distinguish different objects, rather than to describe a specific sequence. . Furthermore, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion.
在本申请的实施例中,提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A 获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。In the embodiments of this application, the "instruction" mentioned may be a direct instruction, an indirect instruction, or an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B. relation.
在本申请实施例中,“与A相应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。In the embodiment of this application, "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and/or other information.
在本申请实施例中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。In the embodiments of this application, the term "correspondence" can mean that there is a direct correspondence or indirect correspondence between the two, or it can also mean that there is an association between the two, or it can also mean indicating and being instructed, configuring and being configured, etc. relation.
本申请实施例中,“预定义”或“预配置”可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。In the embodiment of this application, "predefinition" or "preconfiguration" can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices). The application does not limit its specific implementation method. For example, predefined can refer to what is defined in the protocol.
本申请实施例中,所述“协议”可以指通信领域的标准协议,例如可以包括LTE协议、NR协议以及应用于未来的通信系统中的相关协议,本申请对此不做限定。In the embodiment of this application, the "protocol" may refer to a standard protocol in the communication field, which may include, for example, LTE protocol, NR protocol, and related protocols applied in future communication systems. This application does not limit this.
本申请实施例中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。The term "and/or" in the embodiment of this application is only an association relationship describing associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, and A and B exist simultaneously. , there are three situations of B alone. In addition, the character "/" in this article generally indicates that the related objects are an "or" relationship.
在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。In the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be determined by the implementation process of the embodiments of the present application. constitute any limitation.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this 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 illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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 they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够读取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital video disc,DVD))或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be read by a computer or a data storage device such as a server or data center integrated with one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVD)) or semiconductor media (e.g., solid state disks (SSD) )wait.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (67)

  1. 一种建立互操作通道的方法,其特征在于,包括:A method for establishing an interoperability channel, which is characterized by including:
    第一设备根据所述第一设备的密钥对与第二设备协商共享密钥,所述第一设备的密钥对包括第一公钥和第一私钥;The first device negotiates a shared key with the second device based on the key pair of the first device, where the key pair of the first device includes a first public key and a first private key;
    所述第一设备与所述第二设备建立基于所述共享密钥的互操作通道;The first device and the second device establish an interoperability channel based on the shared key;
    所述第一设备通过所述互操作通道向所述第二设备发送控制指令,以对所述第二设备进行控制;The first device sends control instructions to the second device through the interoperation channel to control the second device;
    其中,所述第一设备为终端设备,所述第二设备为车设备。Wherein, the first device is a terminal device, and the second device is a vehicle device.
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备根据所述第一设备的密钥对与第二设备协商共享密钥,包括:The method of claim 1, wherein the first device negotiates a shared key with the second device based on the key pair of the first device, including:
    所述第一设备向所述第二设备发送第一消息,所述第一消息包含第一数据,所述第一数据包含所述第一公钥,所述第一公钥用于所述第二设备生成所述共享密钥;The first device sends a first message to the second device, the first message includes first data, the first data includes the first public key, and the first public key is used for the first The second device generates the shared key;
    所述第一设备从所述第二设备接收第一响应,所述第一响应包含第二数据,所述第二数据包含第二公钥,所述第二公钥和第二私钥组成所述第二设备的密钥对;The first device receives a first response from the second device, the first response includes second data, the second data includes a second public key, and the second public key and the second private key constitute the The key pair of the second device;
    所述第一设备根据所述第二公钥和所述第一私钥,生成所述共享密钥。The first device generates the shared key based on the second public key and the first private key.
  3. 根据权利要求2所述的方法,其特征在于:The method according to claim 2, characterized in that:
    所述第一数据还包含以下信息中的一种或多种:所述第一设备生成的随机数、所述第一设备的设备标识、以及第一签名;和/或The first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or
    所述第二数据还包含以下信息中的一种或多种:所述第二设备生成的随机数、所述第二设备的设备标识、以及第二签名。The second data also includes one or more of the following information: a random number generated by the second device, a device identification of the second device, and a second signature.
  4. 根据权利要求3所述的方法,其特征在于,所述第一签名为所述第一设备使用所述第一私钥对以下信息中的一种或多种进行加密得到的:所述第一公钥、所述第一设备生成的随机数、所述第一设备的设备标识;The method of claim 3, wherein the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first Public key, random number generated by the first device, and device identification of the first device;
    所述第二签名为所述第二设备使用所述第二私钥对以下信息中的一种或多种进行加密得到的:所述第二公钥、所述第二设备生成的随机数、所述第二设备的设备标识。The second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, The device identifier of the second device.
  5. 根据权利要求2-4中任一项所述的方法,其特征在于,在所述第一设备向所述第二设备发送第一消息之前,所述方法还包括:The method according to any one of claims 2-4, characterized in that, before the first device sends the first message to the second device, the method further includes:
    所述第一设备根据所述第一设备的身份识别码对所述第一数据进行加密。The first device encrypts the first data according to the identification code of the first device.
  6. 根据权利要求5所述的方法,其特征在于,在所述第一设备根据所述第一设备的身份识别码对所述第一数据进行加密之前,所述方法还包括:The method according to claim 5, characterized in that, before the first device encrypts the first data according to the identification code of the first device, the method further includes:
    所述第一设备与所述第二设备协商第一身份识别码,所述第一身份识别码用于所述第一身份识别码对应的设备访问所述第二设备。The first device negotiates with the second device a first identity code, and the first identity code is used for the device corresponding to the first identity code to access the second device.
  7. 根据权利要求6所述的方法,其特征在于,所述第一设备与所述第二设备协商第一身份识别码,包括:The method according to claim 6, characterized in that the first device negotiates the first identity code with the second device, including:
    所述第一设备向所述第二设备发送第二消息,所述第二消息用于配置所述第一身份识别码。The first device sends a second message to the second device, where the second message is used to configure the first identity code.
  8. 根据权利要求6所述的方法,其特征在于,所述第一设备与所述第二设备协商第一身份识别码,包括:The method according to claim 6, characterized in that the first device negotiates the first identity code with the second device, including:
    所述第一设备向所述第二设备发送第三消息,所述第三消息用于指示所述第二设备返回所述第一身份识别码。The first device sends a third message to the second device, where the third message is used to instruct the second device to return the first identification code.
  9. 根据权利要求8所述的方法,其特征在于,所述第三消息携带指示所述第一设备不具有身份识别码的信息,The method of claim 8, wherein the third message carries information indicating that the first device does not have an identification code,
    所述方法还包括:The method also includes:
    所述第一设备接收所述第二设备返回的所述第一身份识别码。The first device receives the first identification code returned by the second device.
  10. 根据权利要求9所述的方法,其特征在于,所述第二设备返回的所述第一身份识 别码显示在所述第二设备的显示屏上。The method according to claim 9, characterized in that the first identification code returned by the second device is displayed on the display screen of the second device.
  11. 根据权利要求8-10中任一项所述的方法,其特征在于,所述第二设备返回的所述第一身份识别码为临时身份识别码。The method according to any one of claims 8-10, characterized in that the first identification code returned by the second device is a temporary identification code.
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,在所述第一设备根据所述第一设备的密钥对与第二设备协商共享密钥之前,所述方法还包括:The method according to any one of claims 1-11, characterized in that, before the first device negotiates a shared key with the second device according to the key pair of the first device, the method further includes :
    所述第一设备与所述第二设备协商所述共享密钥的协商方式。The first device negotiates with the second device a negotiation method for the shared key.
  13. 根据权利要求12所述的方法,其特征在于,所述第一设备与所述第二设备协商所述共享密钥的协商方式,包括:The method according to claim 12, characterized in that the first device and the second device negotiate a negotiation method for the shared key, including:
    所述第一设备向所述第二设备发送第四消息,所述第四消息用于指示所述第一设备支持的密钥协商方式;The first device sends a fourth message to the second device, where the fourth message is used to indicate a key negotiation method supported by the first device;
    所述第一设备从所述第二设备接收第四响应,所述第四响应用于指示基于密钥对协商所述共享密钥。The first device receives a fourth response from the second device, the fourth response being used to indicate negotiating the shared key based on a key pair.
  14. 根据权利要求13所述的方法,其特征在于,所述第一设备和/或所述第二设备支持的密钥协商方式包括以下方式中的一种或多种:基于密钥对协商,基于节点互操作证书协商,以及基于sigma协议协商。The method according to claim 13, characterized in that the key negotiation method supported by the first device and/or the second device includes one or more of the following methods: based on key pair negotiation, based on Node interoperability certificate negotiation, and negotiation based on sigma protocol.
  15. 根据权利要求1-14中任一项所述的方法,其特征在于,所述共享密钥是所述第一设备根据以下信息中的一种或多种生成的:第一密钥、所述第一设备生成的随机数、所述第二设备生成的随机数、所述第一设备的设备标识、所述第二设备的设备标识、以及所述第一设备的身份识别码,其中,所述第一密钥是所述第一设备根据第二公钥和所述第一私钥生成的。The method according to any one of claims 1-14, characterized in that the shared key is generated by the first device according to one or more of the following information: the first key, the The random number generated by the first device, the random number generated by the second device, the device identification of the first device, the device identification of the second device, and the identification code of the first device, wherein, The first key is generated by the first device based on the second public key and the first private key.
  16. 一种建立互操作通道的方法,其特征在于,包括:A method for establishing an interoperability channel, which is characterized by including:
    第二设备根据所述第二设备的密钥对与第一设备协商共享密钥,所述第二设备的密钥对包括第二公钥和第二私钥;The second device negotiates a shared key with the first device based on the key pair of the second device, where the key pair of the second device includes a second public key and a second private key;
    所述第二设备与所述第一设备建立基于所述共享密钥的互操作通道;The second device establishes an interoperability channel based on the shared key with the first device;
    所述第二设备通过所述互操作通道接收所述第一设备的控制指令;The second device receives the control instruction of the first device through the interoperation channel;
    其中,所述第一设备为终端设备,所述第二设备为车设备。Wherein, the first device is a terminal device, and the second device is a vehicle device.
  17. 根据权利要求16所述的方法,其特征在于,所述第二设备根据所述第二设备的密钥对与第一设备协商共享密钥,包括:The method of claim 16, wherein the second device negotiates a shared key with the first device based on the key pair of the second device, including:
    所述第二设备接收所述第一设备发送的第一消息,所述第一消息包含第一数据,所述第一数据包含第一公钥,所述第一公钥和第一私钥组成所述第一设备的密钥对;The second device receives the first message sent by the first device, the first message contains first data, the first data contains a first public key, and the first public key and the first private key are composed of The key pair of the first device;
    所述第二设备根据所述第一公钥和所述第二私钥,生成所述共享密钥;The second device generates the shared key based on the first public key and the second private key;
    所述第二设备向所述第一设备发送第一响应,所述第一响应包含第二数据,所述第二数据包含所述第二公钥,所述第二公钥用于所述第一设备生成所述共享密钥。The second device sends a first response to the first device, the first response includes second data, the second data includes the second public key, and the second public key is used for the first A device generates the shared key.
  18. 根据权利要求17所述的方法,其特征在于:The method according to claim 17, characterized in that:
    所述第一数据还包含以下信息中的一种或多种:所述第一设备生成的随机数、所述第一设备的设备标识、以及第一签名;和/或The first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or
    所述第二数据还包含以下信息中的一种或多种:所述第二设备生成的随机数、所述第二设备的设备标识、以及第二签名。The second data also includes one or more of the following information: a random number generated by the second device, a device identification of the second device, and a second signature.
  19. 根据权利要求18所述的方法,其特征在于,所述第一签名为所述第一设备使用所述第一私钥对以下信息中的一种或多种进行加密得到的:所述第一公钥、所述第一设备生成的随机数、所述第一设备的设备标识;The method of claim 18, wherein the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first Public key, random number generated by the first device, and device identification of the first device;
    所述第二签名为所述第二设备使用所述第二私钥对以下信息中的一种或多种进行加密得到的:所述第二公钥、所述第二设备生成的随机数、所述第二设备的设备标识。The second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, The device identifier of the second device.
  20. 根据权利要求17-19中任一项所述的方法,其特征在于,在所述第二设备接收所述第一设备发送的第一消息之后,所述方法还包括:The method according to any one of claims 17-19, characterized in that, after the second device receives the first message sent by the first device, the method further includes:
    所述第二设备根据所述第一设备的身份识别码对所述第一数据进行解密。The second device decrypts the first data according to the identification code of the first device.
  21. 根据权利要求20所述的方法,其特征在于,在所述第二设备根据所述第一设备的身份识别码对所述第一数据进行解密之前,所述方法还包括:The method according to claim 20, characterized in that, before the second device decrypts the first data according to the identification code of the first device, the method further includes:
    所述第二设备与所述第一设备协商第一身份识别码,所述第一身份识别码用于所述第一身份识别码对应的设备访问所述第二设备。The second device negotiates a first identity code with the first device, and the first identity code is used for the device corresponding to the first identity code to access the second device.
  22. 根据权利要求21所述的方法,其特征在于,所述第二设备与所述第一设备协商第一身份识别码,包括:The method according to claim 21, characterized in that the second device negotiates the first identity code with the first device, including:
    所述第二设备接收所述第一设备发送的第二消息,所述第二消息用于配置所述第一身份识别码。The second device receives a second message sent by the first device, and the second message is used to configure the first identity code.
  23. 根据权利要求21所述的方法,其特征在于,所述第二设备与所述第一设备协商第一身份识别码,包括:The method according to claim 21, characterized in that the second device negotiates the first identity code with the first device, including:
    所述第二设备接收所述第一设备发送的第三消息,所述第三消息用于指示所述第二设备返回所述第一身份识别码。The second device receives a third message sent by the first device, and the third message is used to instruct the second device to return the first identification code.
  24. 根据权利要求23所述的方法,其特征在于,所述第三消息携带指示所述第一设备不具有身份识别码的信息,The method of claim 23, wherein the third message carries information indicating that the first device does not have an identification code,
    所述方法还包括:The method also includes:
    所述第二设备为所述第一设备返回所述第一身份识别码。The second device returns the first identification code to the first device.
  25. 根据权利要求24所述的方法,其特征在于,所述第二设备返回的所述第一身份识别码显示在所述第二设备的显示屏上。The method according to claim 24, characterized in that the first identification code returned by the second device is displayed on the display screen of the second device.
  26. 根据权利要求23-25中任一项所述的方法,其特征在于,所述第二设备返回的所述第一身份识别码为临时身份识别码。The method according to any one of claims 23 to 25, characterized in that the first identification code returned by the second device is a temporary identification code.
  27. 根据权利要求16-26中任一项所述的方法,其特征在于,在所述第二设备根据所述第二设备的密钥对与第一设备协商共享密钥之前,所述方法还包括:The method according to any one of claims 16-26, characterized in that, before the second device negotiates a shared key with the first device according to the key pair of the second device, the method further includes :
    所述第二设备与所述第一设备协商所述共享密钥的协商方式。The second device negotiates with the first device a negotiation method for the shared key.
  28. 根据权利要求27所述的方法,其特征在于,所述第二设备与所述第一设备协商所述共享密钥的协商方式,包括:The method according to claim 27, characterized in that the second device and the first device negotiate a negotiation method for the shared key, including:
    所述第二设备接收所述第一设备发送的第四消息,所述第四消息用于指示所述第一设备支持的密钥协商方式;The second device receives a fourth message sent by the first device, where the fourth message is used to indicate a key negotiation method supported by the first device;
    所述第二设备向所述第一设备发送第四响应,所述第四响应用于指示基于密钥对协商所述共享密钥。The second device sends a fourth response to the first device, where the fourth response is used to indicate negotiating the shared key based on a key pair.
  29. 根据权利要求28所述的方法,其特征在于,所述第一设备和/或所述第二设备支持的密钥协商方式包括以下方式中的一种或多种:基于密钥对协商,基于节点互操作证书协商,以及基于sigma协议协商。The method according to claim 28, characterized in that the key negotiation method supported by the first device and/or the second device includes one or more of the following methods: based on key pair negotiation, based on Node interoperability certificate negotiation, and negotiation based on sigma protocol.
  30. 根据权利要求16-29中任一项所述的方法,其特征在于,所述共享密钥是所述第二设备根据以下信息中的一种或多种生成的:第二密钥、所述第一设备生成的随机数、所述第二设备生成的随机数、所述第一设备的设备标识、所述第二设备的设备标识、以及所述第一设备的身份识别码,其中,所述第二密钥是所述第二设备根据第一公钥和所述第二私钥生成的。The method according to any one of claims 16-29, characterized in that the shared key is generated by the second device according to one or more of the following information: the second key, the The random number generated by the first device, the random number generated by the second device, the device identification of the first device, the device identification of the second device, and the identification code of the first device, wherein, The second key is generated by the second device based on the first public key and the second private key.
  31. 一种建立互操作通道的装置,其特征在于,所述装置配置于第一设备,所述装置包括:A device for establishing an interoperability channel, characterized in that the device is configured on a first device, and the device includes:
    第一协商模块,用于根据所述第一设备的密钥对与第二设备协商共享密钥,所述第一设备的密钥对包括第一公钥和第一私钥;A first negotiation module configured to negotiate a shared key with a second device based on a key pair of the first device, where the key pair of the first device includes a first public key and a first private key;
    建立模块,用于与所述第二设备建立基于所述共享密钥的互操作通道;An establishment module, configured to establish an interoperability channel based on the shared key with the second device;
    控制模块,用于通过所述互操作通道向所述第二设备发送控制指令,以对所述第二设备进行控制;A control module, configured to send control instructions to the second device through the interoperability channel to control the second device;
    其中,所述第一设备为终端设备,所述第二设备为车设备。Wherein, the first device is a terminal device, and the second device is a vehicle device.
  32. 根据权利要求31所述的装置,其特征在于,所述第一协商模块进一步包括:The device according to claim 31, wherein the first negotiation module further includes:
    第一发送模块,用于向所述第二设备发送第一消息,所述第一消息包含第一数据,所述第一数据包含所述第一公钥,所述第一公钥用于所述第二设备生成所述共享密钥;A first sending module, configured to send a first message to the second device, where the first message includes first data, where the first data includes the first public key, and the first public key is used for the The second device generates the shared key;
    第一接收模块,用于从所述第二设备接收第一响应,所述第一响应包含第二数据,所述第二数据包含第二公钥,所述第二公钥和第二私钥组成所述第二设备的密钥对;A first receiving module, configured to receive a first response from the second device, the first response containing second data, the second data containing a second public key, the second public key and a second private key A key pair constituting the second device;
    生成模块,用于根据所述第二公钥和所述第一私钥,生成所述共享密钥。A generating module, configured to generate the shared key according to the second public key and the first private key.
  33. 根据权利要求32所述的装置,其特征在于:The device according to claim 32, characterized in that:
    所述第一数据还包含以下信息中的一种或多种:所述第一设备生成的随机数、所述第一设备的设备标识、以及第一签名;和/或The first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or
    所述第二数据还包含以下信息中的一种或多种:所述第二设备生成的随机数、所述第二设备的设备标识、以及第二签名。The second data also includes one or more of the following information: a random number generated by the second device, a device identification of the second device, and a second signature.
  34. 根据权利要求33所述的装置,其特征在于,所述第一签名为所述第一设备使用所述第一私钥对以下信息中的一种或多种进行加密得到的:所述第一公钥、所述第一设备生成的随机数、所述第一设备的设备标识;The device according to claim 33, wherein the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first Public key, random number generated by the first device, and device identification of the first device;
    所述第二签名为所述第二设备使用所述第二私钥对以下信息中的一种或多种进行加密得到的:所述第二公钥、所述第二设备生成的随机数、所述第二设备的设备标识。The second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, The device identifier of the second device.
  35. 根据权利要求32-34中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 32-34, characterized in that the device further includes:
    加密模块,用于根据所述第一设备的身份识别码对所述第一数据进行加密。An encryption module, configured to encrypt the first data according to the identification code of the first device.
  36. 根据权利要求35所述的装置,其特征在于,所述装置还包括:The device of claim 35, further comprising:
    第二协商模块,用于与所述第二设备协商第一身份识别码,所述第一身份识别码用于所述第一身份识别码对应的设备访问所述第二设备。The second negotiation module is configured to negotiate a first identity code with the second device. The first identity code is used for the device corresponding to the first identity code to access the second device.
  37. 根据权利要求36所述的装置,其特征在于,所述第二协商模块进一步包括:The device according to claim 36, characterized in that the second negotiation module further includes:
    第二发送模块,用于向所述第二设备发送第二消息,所述第二消息用于配置所述第一身份识别码。The second sending module is configured to send a second message to the second device, where the second message is used to configure the first identity code.
  38. 根据权利要求36所述的装置,其特征在于,所述第二协商模块进一步包括:The device according to claim 36, characterized in that the second negotiation module further includes:
    第三发送模块,用于向所述第二设备发送第三消息,所述第三消息用于指示所述第二设备返回所述第一身份识别码。A third sending module is configured to send a third message to the second device, where the third message is used to instruct the second device to return the first identification code.
  39. 根据权利要求38所述的装置,其特征在于,所述第三消息携带指示所述第一设备不具有身份识别码的信息,The device according to claim 38, wherein the third message carries information indicating that the first device does not have an identification code,
    所述装置还包括:The device also includes:
    第二接收模块,用于接收所述第二设备返回的所述第一身份识别码。The second receiving module is configured to receive the first identification code returned by the second device.
  40. 根据权利要求39所述的装置,其特征在于,所述第二设备返回的所述第一身份识别码显示在所述第二设备的显示屏上。The device according to claim 39, characterized in that the first identification code returned by the second device is displayed on the display screen of the second device.
  41. 根据权利要求38-40中任一项所述的装置,其特征在于,所述第二设备返回的所述第一身份识别码为临时身份识别码。The device according to any one of claims 38 to 40, characterized in that the first identification code returned by the second device is a temporary identification code.
  42. 根据权利要求31-41中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 31-41, characterized in that the device further includes:
    第三协商模块,用于与所述第二设备协商所述共享密钥的协商方式。The third negotiation module is configured to negotiate the negotiation method of the shared key with the second device.
  43. 根据权利要求42所述的装置,其特征在于,所述第三协商模块进一步包括:The device according to claim 42, characterized in that the third negotiation module further includes:
    第四发送模块,用于向所述第二设备发送第四消息,所述第四消息用于指示所述第一设备支持的密钥协商方式;A fourth sending module, configured to send a fourth message to the second device, where the fourth message is used to indicate the key negotiation method supported by the first device;
    第三接收模块,用于从所述第二设备接收第四响应,所述第四响应用于指示基于密钥对协商所述共享密钥。A third receiving module configured to receive a fourth response from the second device, where the fourth response is used to indicate negotiating the shared key based on a key pair.
  44. 根据权利要求43所述的装置,其特征在于,所述第一设备和/或所述第二设备支持的密钥协商方式包括以下方式中的一种或多种:基于密钥对协商,基于节点互操作证书 协商,以及基于sigma协议协商。The device according to claim 43, characterized in that the key negotiation method supported by the first device and/or the second device includes one or more of the following methods: based on key pair negotiation, based on Node interoperability certificate negotiation, and negotiation based on sigma protocol.
  45. 根据权利要求31-44中任一项所述的装置,其特征在于,所述共享密钥是所述第一设备根据以下信息中的一种或多种生成的:第一密钥、所述第一设备生成的随机数、所述第二设备生成的随机数、所述第一设备的设备标识、所述第二设备的设备标识、以及所述第一设备的身份识别码,其中,所述第一密钥是所述第一设备根据第二公钥和所述第一私钥生成的。The device according to any one of claims 31-44, wherein the shared key is generated by the first device according to one or more of the following information: the first key, the The random number generated by the first device, the random number generated by the second device, the device identification of the first device, the device identification of the second device, and the identification code of the first device, wherein, The first key is generated by the first device based on the second public key and the first private key.
  46. 一种建立互操作通道的装置,其特征在于,所述装置配置于第二设备,所述装置包括:A device for establishing an interoperability channel, characterized in that the device is configured on a second device, and the device includes:
    第一协商模块,用于根据所述第二设备的密钥对与第一设备协商共享密钥,所述第二设备的密钥对包括第二公钥和第二私钥;A first negotiation module configured to negotiate a shared key with the first device based on the key pair of the second device, where the key pair of the second device includes a second public key and a second private key;
    建立模块,用于与所述第一设备建立基于所述共享密钥的互操作通道;An establishment module, configured to establish an interoperability channel based on the shared key with the first device;
    第一接收模块,用于通过所述互操作通道接收所述第一设备的控制指令;A first receiving module, configured to receive control instructions of the first device through the interoperation channel;
    其中,所述第一设备为终端设备,所述第二设备为车设备。Wherein, the first device is a terminal device, and the second device is a vehicle device.
  47. 根据权利要求46所述的装置,其特征在于,所述第一协商模块进一步包括:The device according to claim 46, wherein the first negotiation module further includes:
    第二接收模块,用于接收所述第一设备发送的第一消息,所述第一消息包含第一数据,所述第一数据包含第一公钥,所述第一公钥和第一私钥组成所述第一设备的密钥对;The second receiving module is configured to receive the first message sent by the first device, the first message includes first data, the first data includes a first public key, the first public key and the first private key. The key constitutes a key pair of the first device;
    生成模块,用于根据所述第一公钥和所述第二私钥,生成所述共享密钥;A generating module, configured to generate the shared key according to the first public key and the second private key;
    第一发送模块,用于向所述第一设备发送第一响应,所述第一响应包含第二数据,所述第二数据包含所述第二公钥,所述第二公钥用于所述第一设备生成所述共享密钥。A first sending module, configured to send a first response to the first device, where the first response includes second data, the second data includes the second public key, and the second public key is used for the The first device generates the shared key.
  48. 根据权利要求47所述的装置,其特征在于:The device according to claim 47, characterized in that:
    所述第一数据还包含以下信息中的一种或多种:所述第一设备生成的随机数、所述第一设备的设备标识、以及第一签名;和/或The first data also includes one or more of the following information: a random number generated by the first device, a device identification of the first device, and a first signature; and/or
    所述第二数据还包含以下信息中的一种或多种:所述第二设备生成的随机数、所述第二设备的设备标识、以及第二签名。The second data also includes one or more of the following information: a random number generated by the second device, a device identification of the second device, and a second signature.
  49. 根据权利要求48所述的装置,其特征在于,所述第一签名为所述第一设备使用所述第一私钥对以下信息中的一种或多种进行加密得到的:所述第一公钥、所述第一设备生成的随机数、所述第一设备的设备标识;The apparatus according to claim 48, wherein the first signature is obtained by the first device using the first private key to encrypt one or more of the following information: the first Public key, random number generated by the first device, and device identification of the first device;
    所述第二签名为所述第二设备使用所述第二私钥对以下信息中的一种或多种进行加密得到的:所述第二公钥、所述第二设备生成的随机数、所述第二设备的设备标识。The second signature is obtained by the second device using the second private key to encrypt one or more of the following information: the second public key, a random number generated by the second device, The device identifier of the second device.
  50. 根据权利要求47-49中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 47-49, characterized in that the device further includes:
    解密模块,用于根据所述第一设备的身份识别码对所述第一数据进行解密。A decryption module, configured to decrypt the first data according to the identification code of the first device.
  51. 根据权利要求50所述的装置,其特征在于,所述装置还包括:The device according to claim 50, characterized in that the device further includes:
    第二协商模块,用于与所述第一设备协商第一身份识别码,所述第一身份识别码用于所述第一身份识别码对应的设备访问所述第二设备。The second negotiation module is configured to negotiate a first identity code with the first device. The first identity code is used for the device corresponding to the first identity code to access the second device.
  52. 根据权利要求51所述的装置,其特征在于,所述第二协商模块进一步包括:The device according to claim 51, characterized in that the second negotiation module further includes:
    第三接收模块,用于接收所述第一设备发送的第二消息,所述第二消息用于配置所述第一身份识别码。The third receiving module is configured to receive a second message sent by the first device, where the second message is used to configure the first identity code.
  53. 根据权利要求51所述的装置,其特征在于,所述第二协商模块进一步包括:The device according to claim 51, characterized in that the second negotiation module further includes:
    第四接收模块,用于接收所述第一设备发送的第三消息,所述第三消息用于指示所述第二设备返回所述第一身份识别码。The fourth receiving module is configured to receive a third message sent by the first device, where the third message is used to instruct the second device to return the first identification code.
  54. 根据权利要求53所述的装置,其特征在于,所述第三消息携带指示所述第一设备不具有身份识别码的信息,The device according to claim 53, wherein the third message carries information indicating that the first device does not have an identification code,
    所述装置还包括:The device also includes:
    返回模块,用于为所述第一设备返回所述第一身份识别码。A return module, configured to return the first identification code to the first device.
  55. 根据权利要求54所述的装置,其特征在于,所述第二设备返回的所述第一身份识 别码显示在所述第二设备的显示屏上。The device according to claim 54, characterized in that the first identification code returned by the second device is displayed on the display screen of the second device.
  56. 根据权利要求53-55中任一项所述的装置,其特征在于,所述第二设备返回的所述第一身份识别码为临时身份识别码。The device according to any one of claims 53-55, characterized in that the first identification code returned by the second device is a temporary identification code.
  57. 根据权利要求46-56中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 46-56, characterized in that the device further includes:
    第三协商模块,用于与所述第一设备协商所述共享密钥的协商方式。The third negotiation module is configured to negotiate the negotiation method of the shared key with the first device.
  58. 根据权利要求57所述的装置,其特征在于,所述第三协商模块进一步包括:The device according to claim 57, characterized in that the third negotiation module further includes:
    第五接收模块,用于接收所述第一设备发送的第四消息,所述第四消息用于指示所述第一设备支持的密钥协商方式;A fifth receiving module, configured to receive a fourth message sent by the first device, where the fourth message is used to indicate the key negotiation method supported by the first device;
    第二发送模块,用于向所述第一设备发送第四响应,所述第四响应用于指示基于密钥对协商所述共享密钥。The second sending module is configured to send a fourth response to the first device, where the fourth response is used to indicate negotiating the shared key based on a key pair.
  59. 根据权利要求58所述的装置,其特征在于,所述第一设备和/或所述第二设备支持的密钥协商方式包括以下方式中的一种或多种:基于密钥对协商,基于节点互操作证书协商,以及基于sigma协议协商。The device according to claim 58, characterized in that the key negotiation method supported by the first device and/or the second device includes one or more of the following methods: based on key pair negotiation, based on Node interoperability certificate negotiation, and negotiation based on sigma protocol.
  60. 根据权利要求46-59中任一项所述的装置,其特征在于,所述共享密钥是所述第二设备根据以下信息中的一种或多种生成的:第二密钥、所述第一设备生成的随机数、所述第二设备生成的随机数、所述第一设备的设备标识、所述第二设备的设备标识、以及所述第一设备的身份识别码,其中,所述第二密钥是所述第二设备根据第一公钥和所述第二私钥生成的。The device according to any one of claims 46-59, characterized in that the shared key is generated by the second device according to one or more of the following information: the second key, the The random number generated by the first device, the random number generated by the second device, the device identification of the first device, the device identification of the second device, and the identification code of the first device, wherein, The second key is generated by the second device based on the first public key and the second private key.
  61. 一种通信装置,其特征在于,所述通信装置配置于第一设备,所述装置包括存储器和处理器,所述存储器用于存储程序,所述处理器用于调用所述存储器中的程序,以使所述第一设备执行如权利要求1-15中任一项所述的方法。A communication device, characterized in that the communication device is configured in a first device, the device includes a memory and a processor, the memory is used to store programs, and the processor is used to call the program in the memory to The first device is caused to perform the method according to any one of claims 1-15.
  62. 一种通信装置,其特征在于,所述通信装置配置于第二设备,所述装置包括存储器和处理器,所述存储器用于存储程序,所述处理器用于调用所述存储器中的程序,以使所述第二设备执行如权利要求16-30中任一项所述的方法。A communication device, characterized in that the communication device is configured in a second device, the device includes a memory and a processor, the memory is used to store programs, and the processor is used to call the program in the memory to The second device is caused to perform the method according to any one of claims 16-30.
  63. 一种装置,其特征在于,包括处理器,用于从存储器中调用程序,以使所述装置执行如权利要求1-30中任一项所述的方法。A device, characterized by comprising a processor for calling a program from a memory, so that the device executes the method according to any one of claims 1-30.
  64. 一种芯片,其特征在于,包括处理器,用于从存储器调用程序,使得安装有所述芯片的设备执行如权利要求1-30中任一项所述的方法。A chip, characterized in that it includes a processor for calling a program from a memory, so that a device installed with the chip executes the method according to any one of claims 1-30.
  65. 一种计算机可读存储介质,其特征在于,其上存储有程序,所述程序使得计算机执行如权利要求1-30中任一项所述的方法。A computer-readable storage medium, characterized in that a program is stored thereon, and the program causes the computer to execute the method according to any one of claims 1-30.
  66. 一种计算机程序产品,其特征在于,包括程序,所述程序使得计算机执行如权利要求1-30中任一项所述的方法。A computer program product, characterized by comprising a program that causes a computer to execute the method according to any one of claims 1-30.
  67. 一种计算机程序,其特征在于,所述计算机程序使得计算机执行如权利要求1-30中任一项所述的方法。A computer program, characterized in that the computer program causes the computer to perform the method according to any one of claims 1-30.
PCT/CN2022/096827 2022-06-02 2022-06-02 Method and apparatus for establishing interoperation channel, chip, and storage medium WO2023230983A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/096827 WO2023230983A1 (en) 2022-06-02 2022-06-02 Method and apparatus for establishing interoperation channel, chip, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/096827 WO2023230983A1 (en) 2022-06-02 2022-06-02 Method and apparatus for establishing interoperation channel, chip, and storage medium

Publications (1)

Publication Number Publication Date
WO2023230983A1 true WO2023230983A1 (en) 2023-12-07

Family

ID=89026752

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/096827 WO2023230983A1 (en) 2022-06-02 2022-06-02 Method and apparatus for establishing interoperation channel, chip, and storage medium

Country Status (1)

Country Link
WO (1) WO2023230983A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404363A (en) * 2010-09-10 2012-04-04 联想(北京)有限公司 Access method and access device
CN108111467A (en) * 2016-11-24 2018-06-01 华为技术有限公司 Identity identifying method and equipment and system
US20190215154A1 (en) * 2016-09-05 2019-07-11 Lg Electronics Inc. Lightweight and escrow-less authenticated key agreement for the internet of things
CN111314274A (en) * 2019-07-30 2020-06-19 厦门雅迅网络股份有限公司 Vehicle-mounted terminal and center platform bidirectional authentication method and system
CN111614621A (en) * 2020-04-20 2020-09-01 深圳奇迹智慧网络有限公司 Internet of things communication method and system
WO2021047276A1 (en) * 2019-09-12 2021-03-18 华为技术有限公司 Key generation method and device
WO2022088094A1 (en) * 2020-10-30 2022-05-05 华为技术有限公司 Secure communication method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404363A (en) * 2010-09-10 2012-04-04 联想(北京)有限公司 Access method and access device
US20190215154A1 (en) * 2016-09-05 2019-07-11 Lg Electronics Inc. Lightweight and escrow-less authenticated key agreement for the internet of things
CN108111467A (en) * 2016-11-24 2018-06-01 华为技术有限公司 Identity identifying method and equipment and system
CN111314274A (en) * 2019-07-30 2020-06-19 厦门雅迅网络股份有限公司 Vehicle-mounted terminal and center platform bidirectional authentication method and system
WO2021047276A1 (en) * 2019-09-12 2021-03-18 华为技术有限公司 Key generation method and device
CN111614621A (en) * 2020-04-20 2020-09-01 深圳奇迹智慧网络有限公司 Internet of things communication method and system
WO2022088094A1 (en) * 2020-10-30 2022-05-05 华为技术有限公司 Secure communication method and apparatus

Similar Documents

Publication Publication Date Title
US10630647B2 (en) Secure wireless communication between controllers and accessories
US10951592B2 (en) Secure wireless communication between controllers and accessories
CN110235424A (en) For providing the device and method with managing security information in a communications system
JP2016540462A (en) Key configuration method, system, and apparatus
JP2008042882A (en) Apparatus and method for managing station by wireless network in wpa-psk environment
EP4312448A2 (en) Method and electronic device for managing digital keys
US10708769B2 (en) Cloud assisted accessory pairing
CN112449323B (en) Communication method, device and system
EP4068675A1 (en) Method and device for certificate application
WO2022160124A1 (en) Service authorisation management method and apparatus
WO2023001082A1 (en) Network configuration method and apparatus
WO2021022406A1 (en) Identity authentication method and device
CN113301537B (en) Method, device, electronic equipment and storage medium for establishing communication connection
WO2022087842A1 (en) Network configuration method and apparatus for intelligent device
WO2023230983A1 (en) Method and apparatus for establishing interoperation channel, chip, and storage medium
CN114785532B (en) Security chip communication method and device based on bidirectional signature authentication
WO2023230979A1 (en) Method and apparatus for establishing interoperability channel, and chip and storage medium
US20220369103A1 (en) Method and apparatus for performing uwb secure ranging
WO2023230975A1 (en) Method and apparatus for establishing interoperation channel, and chip and storage medium
CN113455032B (en) Communication method, communication device, and computer-readable medium
WO2022094936A1 (en) Access method, device, and cloud platform device
US11606199B2 (en) Management of groups of connected objects using wireless communication protocols
EP4184857A1 (en) Bluetooth node pairing method and related apparatus
CN114095524B (en) Method and device for transmitting message, central hub device and readable storage medium
WO2023220937A1 (en) Communication methods and apparatuses, devices, storage medium, chip, product and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22944313

Country of ref document: EP

Kind code of ref document: A1