CN116489190A - Communication method, device, electronic device and storage medium for vehicle and cloud - Google Patents
Communication method, device, electronic device and storage medium for vehicle and cloud Download PDFInfo
- Publication number
- CN116489190A CN116489190A CN202310453488.2A CN202310453488A CN116489190A CN 116489190 A CN116489190 A CN 116489190A CN 202310453488 A CN202310453488 A CN 202310453488A CN 116489190 A CN116489190 A CN 116489190A
- Authority
- CN
- China
- Prior art keywords
- communication
- vehicle
- cloud
- symmetric encryption
- public
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0435—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0823—Network architectures or network communication protocols for network security for authentication of entities using certificates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0869—Network architectures or network communication protocols for network security for authentication of entities for achieving mutual authentication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请提供一种用于车辆与云端的通信方法、装置、电子设备及存储介质。该方法包括:获取车辆的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到预定的模拟通信工具上;利用模拟通信工具对车端与云端的通信代理服务进行双向证书认证,以便建立车端与通信代理服务之间的对称加密通道;确定车端发送给通信代理服务的通信数据,对通信数据执行序列化操作,得到通信数据对应的字节数组;利用预定的字符数组将字节数组转换成目标格式的文本,将目标格式的文本通过对称加密通道上报给云端。本申请操作简单,学习成本低,而且易理解,提升车端与云端通信的便捷性。
The present application provides a communication method, device, electronic equipment and storage medium for a vehicle and a cloud. The method includes: obtaining a digital certificate and a public-private key pair of the vehicle, and configuring the digital certificate and the public-private key pair of the vehicle on a predetermined analog communication tool; using the analog communication tool to perform two-way certificate authentication on the communication proxy service between the vehicle end and the cloud, so as to establish a symmetrical encryption channel between the vehicle end and the communication proxy service; determining the communication data sent by the vehicle end to the communication proxy service, performing a serialization operation on the communication data to obtain a byte array corresponding to the communication data; using a predetermined character array to convert the byte array into text in a target format, and reporting the text in the target format to the cloud through a symmetric encryption channel . This application is simple to operate, low in learning costs, and easy to understand, which improves the convenience of communication between the vehicle end and the cloud.
Description
技术领域technical field
本申请涉及新能源汽车技术领域,尤其涉及一种用于车辆与云端的通信方法、装置、电子设备及存储介质。The present application relates to the technical field of new energy vehicles, and in particular to a communication method, device, electronic equipment and storage medium for vehicles and the cloud.
背景技术Background technique
新能源汽车在行业中的广泛应用要求对车辆进行远程监控和升级,为此需要在车载终端与云端之间实现高效、安全的通信。MQTT协议和protobuf格式作为有效的通信技术在新能源汽车领域得到广泛应用。然而,在测试环境下如何实现车云间的证书认证和模拟protobuf格式的MQTT通信,以方便开发和调试成为一项挑战。The wide application of new energy vehicles in the industry requires remote monitoring and upgrading of vehicles, for which efficient and secure communication between vehicle terminals and the cloud is required. The MQTT protocol and protobuf format are widely used in the field of new energy vehicles as effective communication technologies. However, how to implement certificate authentication between vehicles and clouds and simulate MQTT communication in protobuf format in the test environment to facilitate development and debugging has become a challenge.
现有的模拟方式主要包括两种方案:使用通信工具和编写代码。其中,通信工具具有诸多优点,但通信工具使用的Payload格式不支持protobuf。编写代码的方案中,如使用JAVA代码模拟车端上报信息给云端的过程。但这种方法在实现双向证书认证时,学习成本和时间成本过大,不适用于特殊环境的一次性验证。同时,现有方法中的通信工具Payload格式不支持protobuf。因此,导致现有的车云通信方法存在操作复杂,学习成本高,通信不便的问题。The existing simulation methods mainly include two schemes: using communication tools and writing codes. Among them, the communication tool has many advantages, but the Payload format used by the communication tool does not support protobuf. In the program of writing code, such as using JAVA code to simulate the process of reporting information from the car to the cloud. However, when this method realizes two-way certificate authentication, the learning cost and time cost are too large, and it is not suitable for one-time verification in a special environment. At the same time, the Payload format of the communication tool in the existing method does not support protobuf. Therefore, the existing vehicle-cloud communication method has the problems of complicated operation, high learning cost, and inconvenient communication.
发明内容Contents of the invention
有鉴于此,本申请实施例提供了一种用于车辆与云端的通信方法、装置、电子设备及存储介质,以解决现有技术存在的车云通信方法存在操作复杂,学习成本高,通信不便的问题。In view of this, the embodiment of the present application provides a communication method, device, electronic device and storage medium for a vehicle and the cloud, so as to solve the problems of complex operation, high learning cost and inconvenient communication in the vehicle-cloud communication method in the prior art.
本申请实施例的第一方面,提供了一种用于车辆与云端通信的方法,包括:获取车辆的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到预定的模拟通信工具上;利用模拟通信工具对车端与云端的通信代理服务进行双向证书认证,以便建立车端与通信代理服务之间的对称加密通道;确定车端发送给通信代理服务的通信数据,对通信数据执行序列化操作,得到通信数据对应的字节数组;利用预定的字符数组将字节数组转换成目标格式的文本,将目标格式的文本通过对称加密通道上报给云端。The first aspect of the embodiment of the present application provides a method for communication between the vehicle and the cloud, including: obtaining the digital certificate and the public-private key pair of the vehicle, and configuring the digital certificate and the public-private key pair of the vehicle to a predetermined analog communication tool; using the analog communication tool to perform two-way certificate authentication on the communication proxy service between the vehicle end and the cloud, so as to establish a symmetric encryption channel between the vehicle end and the communication proxy service; determining the communication data sent by the vehicle end to the communication proxy service, performing serialization operations on the communication data to obtain a byte array corresponding to the communication data; using a predetermined character array to convert the byte array into a target format, and report the text in the target format to the cloud through a symmetric encrypted channel.
本申请实施例的第二方面,提供了一种用于车辆与云端的通信装置,包括:配置模块,被配置为获取车辆的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到预定的模拟通信工具上;认证模块,被配置为利用模拟通信工具对车端与云端的通信代理服务进行双向证书认证,以便建立车端与通信代理服务之间的对称加密通道;序列化模块,被配置为确定车端发送给通信代理服务的通信数据,对通信数据执行序列化操作,得到通信数据对应的字节数组;转换模块,被配置为利用预定的字符数组将字节数组转换成目标格式的文本,将目标格式的文本通过对称加密通道上报给云端。The second aspect of the embodiment of the present application provides a communication device for a vehicle and the cloud, including: a configuration module configured to obtain a digital certificate and a public-private key pair of the vehicle, and configure the digital certificate and the public-private key pair of the vehicle to a predetermined analog communication tool; an authentication module configured to use the analog communication tool to perform two-way certificate authentication on the communication agent service between the vehicle end and the cloud, so as to establish a symmetric encrypted channel between the vehicle end and the communication agent service; The byte array corresponding to the communication data is obtained; the conversion module is configured to use a predetermined character array to convert the byte array into a text in a target format, and report the text in the target format to the cloud through a symmetric encrypted channel.
本申请实施例的第三方面,提供了一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现上述方法的步骤。A third aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, and the processor implements the steps of the above method when executing the program.
本申请实施例的第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述方法的步骤。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the foregoing method are implemented.
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:The above at least one technical solution adopted in the embodiment of the present application can achieve the following beneficial effects:
通过获取车辆的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到预定的模拟通信工具上;利用模拟通信工具对车端与云端的通信代理服务进行双向证书认证,以便建立车端与通信代理服务之间的对称加密通道;确定车端发送给通信代理服务的通信数据,对通信数据执行序列化操作,得到通信数据对应的字节数组;利用预定的字符数组将字节数组转换成目标格式的文本,将目标格式的文本通过对称加密通道上报给云端。本申请可以利用模拟通信工具完成车端与云端的双向证书认证,而且能够将通信数据转换成需要的目标格式,并将目标格式的通信数据上报给云端,不仅操作简单,学习成本低,而且易理解,提升车端与云端通信的便捷性。By obtaining the vehicle’s digital certificate and public-private key pair, configure the vehicle’s digital certificate and public-private key pair on the predetermined analog communication tool; use the analog communication tool to perform two-way certificate authentication on the communication agent service between the vehicle end and the cloud, so as to establish a symmetric encrypted channel between the vehicle end and the communication agent service; determine the communication data sent by the vehicle end to the communication agent service, perform serialization operations on the communication data, and obtain the byte array corresponding to the communication data; use the predetermined character array to convert the byte array into text in the target format, and report the text in the target format to the cloud through the symmetric encrypted channel. This application can use analog communication tools to complete the two-way certificate authentication between the car and the cloud, and can convert the communication data into the required target format, and report the communication data in the target format to the cloud. Not only is the operation simple, the learning cost is low, and it is easy to understand.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings used in the embodiments or prior art descriptions. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other accompanying drawings can also be obtained based on these drawings without creative work.
图1是本申请实施例提供的用于车辆与云端通信的方法的流程示意图;FIG. 1 is a schematic flowchart of a method for communicating between a vehicle and a cloud provided by an embodiment of the present application;
图2是本申请实施例提供的实现车云证书认证且模拟protobuf格式的MQTT通信的流程示意图;Fig. 2 is a schematic flow diagram of the MQTT communication that realizes the authentication of the vehicle cloud certificate and simulates the protobuf format provided by the embodiment of the present application;
图3是本申请实施例提供的用于车辆与云端的通信装置的结构示意图;Fig. 3 is a schematic structural diagram of a communication device for a vehicle and a cloud provided by an embodiment of the present application;
图4是本申请实施例提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
一方面,MQTT是一种基于发布/订阅模式的轻量级消息传输协议,专门针对低带宽和不稳定网络环境的物联网应用而设计,可以用极少的代码为联网设备提供实时可靠的消息服务。MQTT具有以下特点:On the one hand, MQTT is a lightweight message transmission protocol based on the publish/subscribe model. It is specially designed for IoT applications in low-bandwidth and unstable network environments. It can provide real-time and reliable message services for networked devices with very little code. MQTT has the following characteristics:
1.轻量高效,节省带宽:MQTT将协议本身占用的额外消耗最小化,消息头部最小只需要占用2个字节,可稳定运行在带宽受限的网络环境下。同时,MQTT客户端只需占用非常小的硬件资源,能运行在各种资源受限的边缘端设备上。1. Lightweight and efficient, saving bandwidth: MQTT minimizes the additional consumption of the protocol itself, and the message header only needs to occupy a minimum of 2 bytes, which can run stably in a network environment with limited bandwidth. At the same time, the MQTT client only needs to occupy very small hardware resources and can run on various resource-constrained edge devices.
2.可靠的消息传递:MQTT协议提供了3种消息服务质量等级(QualityofService),保证了在不同的网络环境下消息传递的可靠性(0-最多一次,1-至少一次,2-恰好一次)。2. Reliable message delivery: The MQTT protocol provides 3 message quality of service levels (Quality of Service), which ensures the reliability of message delivery in different network environments (0-at most once, 1-at least once, 2-exactly once).
3.海量连接支持:MQTT协议从诞生之时便考虑到了日益增长的海量物联网设备,得益于其优秀的设计,基于MQTT的物联网应用及服务可轻松具备高并发、高吞吐、高可扩展能力。3. Mass connection support: The MQTT protocol has taken into account the growing mass of IoT devices since its inception. Thanks to its excellent design, MQTT-based IoT applications and services can easily have high concurrency, high throughput, and high scalability.
4.安全的双向通信:依赖于发布订阅模式,MQTT允许在设备和云之间进行双向消息通信。发布订阅模式的优点在于:发布者与订阅者不需要建立直接连接,也不需要同时在线,而是由消息服务器负责所有消息的路由和分发工作。4. Secure two-way communication: Relying on the publish-subscribe model, MQTT allows two-way message communication between devices and the cloud. The advantage of the publish-subscribe model is that the publisher and the subscriber do not need to establish a direct connection, nor do they need to be online at the same time, but the message server is responsible for the routing and distribution of all messages.
5.在线状态感知:为了应对网络不稳定的情况,MQTT提供了心跳保活(KeepAlive)机制。在客户端与服务端长时间无消息交互的情况下,Keep Alive保持连接不被断开,若一旦断开,客户端可即时感知并立即重连。5. Online status awareness: In order to deal with network instability, MQTT provides a heartbeat keep-alive (KeepAlive) mechanism. When there is no message interaction between the client and the server for a long time, Keep Alive keeps the connection from being disconnected. Once disconnected, the client can immediately perceive and reconnect immediately.
另一方面,protobuf(protocol buffer)是由谷歌开发的一种用于序列化结构化数据的二进制格式。作为一种高效且紧凑的数据交换格式,它旨在实现不同平台和编程语言之间的数据传输和通信。protobuf具有以下特点:On the other hand, protobuf (protocol buffer) is a binary format developed by Google for serializing structured data. As an efficient and compact data exchange format, it is designed to enable data transfer and communication between different platforms and programming languages. protobuf has the following characteristics:
1.语言无关:protobuf支持多种编程语言,如C++、Java、Python等。通过protobuf编译器(protoc),可以根据相应的数据结构定义(.proto文件)生成不同编程语言的代码。1. Language independent: protobuf supports multiple programming languages, such as C++, Java, Python, etc. Through the protobuf compiler (protoc), codes in different programming languages can be generated according to the corresponding data structure definition (.proto file).
2.平台无关:由于protobuf是一种二进制格式,它能够在不同的平台和操作系统之间进行高效地数据交换。2. Platform independent: Since protobuf is a binary format, it can efficiently exchange data between different platforms and operating systems.
3.高性能:相较于XML、JSON等传统的数据交换格式,protobuf具有更小的数据体积和更快的解析速度,从而降低网络传输和解析的性能开销。3. High performance: Compared with traditional data exchange formats such as XML and JSON, protobuf has smaller data volume and faster parsing speed, thereby reducing the performance overhead of network transmission and parsing.
4.可扩展性:在不影响已有数据兼容性的情况下,可以向protobuf数据结构中添加新字段,以支持系统的持续发展。4. Scalability: Without affecting the compatibility of existing data, new fields can be added to the protobuf data structure to support the continuous development of the system.
得益于protobuf高效、紧凑和可扩展的特性,protobuf广泛应用于通信协议、数据存储、RPC(Remote Procedure Call)框架等领域。Thanks to protobuf's efficient, compact and scalable features, protobuf is widely used in communication protocols, data storage, RPC (Remote Procedure Call) framework and other fields.
基于以上优点,在新能源汽车通信技术选型上,通常采用MQTT通信协议,并采用protobuf通信内容进行序列化和反序列化。在没有实车和台架TBOX的情况下,云端OTA升级系统测试时如何模拟车端上报的信息(比如:升级软件包开始下载、下载的结果、开始安装、安装的结果等)成了一个大难题。Based on the above advantages, in the selection of new energy vehicle communication technology, the MQTT communication protocol is usually used, and the protobuf communication content is used for serialization and deserialization. In the absence of a real vehicle and a TBOX platform, how to simulate the information reported by the vehicle during the cloud OTA upgrade system test (for example: the upgrade software package starts to download, the result of the download, the start of installation, the result of the installation, etc.) has become a big problem.
需要说明的是,云端OTA升级系统测试是针对新能源汽车的远程在线升级服务,这项服务允许厂商通过无线网络推送软件更新,无需用户亲自到服务中心进行更新。云端OTA升级系统可以实现新功能的添加、系统缺陷的修复、以及性能优化等。在这个过程中,车端上报的信息对于系统的运行和升级结果至关重要。It should be noted that the cloud OTA upgrade system test is a remote online upgrade service for new energy vehicles. This service allows manufacturers to push software updates through wireless networks without requiring users to go to the service center to update. The cloud OTA upgrade system can realize the addition of new functions, repair of system defects, and performance optimization. In this process, the information reported by the vehicle end is crucial to the operation and upgrade results of the system.
在没有实车和台架TBOX(车载通信模块)的情况下,模拟新能源汽车上报信息确实是一个较大挑战。目前通常可以采用以下两种方式解决这个问题:In the absence of a real vehicle and a TBOX (vehicle communication module), it is indeed a big challenge to simulate new energy vehicles to report information. At present, there are usually two ways to solve this problem:
第一种方式是使用模拟器:可以通过开发一个软件模拟器来模拟车辆和TBOX的通信过程,包括车辆上报的各种信息。这种方法的优点是成本较低,方便快速验证系统功能。然而,模拟器可能无法完全模拟实际环境中的各种异常情况,因此可能会有一定的局限性。The first way is to use a simulator: a software simulator can be developed to simulate the communication process between the vehicle and TBOX, including various information reported by the vehicle. The advantage of this method is that the cost is low, and it is convenient and fast to verify the system function. However, the simulator may not be able to completely simulate various abnormal situations in the actual environment, so there may be certain limitations.
第二种方式是编写代码模拟:通过使用JAVA代码模拟车端上报信息给云端的过程,通过编写代码,可以实现更灵活的控制和定制化需求,而且可以支持protobuf格式的Payload。相较于使用工具,这种方法可能需要更多的开发和维护工作,但在满足特定需求方面具有更高的灵活性。The second way is to write code simulation: by using JAVA code to simulate the process of reporting information from the vehicle to the cloud, by writing code, more flexible control and customization requirements can be achieved, and Payload in protobuf format can be supported. This approach may require more development and maintenance than using tools, but offers more flexibility to meet specific needs.
在解决上述技术问题的过程中又出现了新的问题,在正式生产环境中,为保证车云通信间的安全性,通信前会先进行双向证书认证(SSL),证书认证的步骤通过代码是可以实现的,但编写代码的学习成本和时间成本过大,不适用于特殊环境的一次性验证;根据使用模拟器的技术方案的功能特性,虽然模拟器支持CA、自签名证书,以及单、双向SSL认证,但是Payload格式不支持protobuf。In the process of solving the above technical problems, new problems have emerged. In the formal production environment, in order to ensure the security of the communication between the car and the cloud, two-way certificate authentication (SSL) will be performed before the communication. The steps of certificate authentication can be realized through the code, but the learning cost and time cost of writing the code are too large, and it is not suitable for one-time verification in a special environment. According to the functional characteristics of the technical solution using the simulator, although the simulator supports CA, self-signed certificates, and single and two-way SSL authentication, the Payload format does not support protobuf.
有鉴于此,本申请实施例为解决上述问题,提供了一种实现车云证书认证且模拟protobuf格式MQTT通信的测试方法。本申请通过从车辆上获取证书和公私钥对配置到模拟通信工具上,利用模拟通信工具完成车端到云端的通信代理服务之间的SSL双向证书认证。并且将原有的JAVA代码进行改造,将原本的protobuf格式通信内容直接上报给云端改造为将protobuf格式的通信内容转换成Hex格式输出成文本,然后利用模拟通信工具配置上一辆车辆的证书和密钥与云端建立起SSL通道,再将JAVA代码转换出的Hex格式的文本通过模拟通信工具上报到云端,从而解决正式生产环境中车端与云端通信时存在的问题。In view of this, in order to solve the above problems, the embodiment of the present application provides a test method that realizes the authentication of the vehicle cloud certificate and simulates the MQTT communication in the protobuf format. This application obtains the certificate and public-private key pair from the vehicle and configures them on the simulated communication tool, and uses the simulated communication tool to complete the SSL two-way certificate authentication between the vehicle terminal and the cloud communication proxy service. And the original JAVA code is modified, the original protobuf format communication content is directly reported to the cloud, and the protobuf format communication content is converted into Hex format and output as text, and then the simulation communication tool is used to configure the certificate and key of the previous vehicle to establish an SSL channel with the cloud.
下面结合附图以及具体实施例对本申请技术方案的内容进行详细描述。The content of the technical solution of the present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments.
图1是本申请实施例提供的用于车辆与云端的通信方法的流程示意图。图1的用于车辆与云端通信的方法可以由应用程序来执行。如图1所示,该用于车辆与云端的通信方法具体可以包括:Fig. 1 is a schematic flowchart of a communication method between a vehicle and a cloud provided by an embodiment of the present application. The method for communicating between the vehicle and the cloud in FIG. 1 can be executed by an application program. As shown in Figure 1, the communication method for the vehicle and the cloud may specifically include:
S101,获取车辆的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到预定的模拟通信工具上;S101. Obtain the digital certificate and the public-private key pair of the vehicle, and configure the digital certificate and the public-private key pair of the vehicle to a predetermined analog communication tool;
S102,利用模拟通信工具对车端与云端的通信代理服务进行双向证书认证,以便建立车端与通信代理服务之间的对称加密通道;S102, using the analog communication tool to perform two-way certificate authentication on the communication agent service between the vehicle end and the cloud, so as to establish a symmetric encryption channel between the vehicle end and the communication agent service;
S103,确定车端发送给通信代理服务的通信数据,对通信数据执行序列化操作,得到通信数据对应的字节数组;S103, determine the communication data sent by the vehicle end to the communication agent service, perform a serialization operation on the communication data, and obtain a byte array corresponding to the communication data;
S104,利用预定的字符数组将字节数组转换成目标格式的文本,将目标格式的文本通过对称加密通道上报给云端。S104. Convert the byte array into text in a target format by using a predetermined character array, and report the text in the target format to the cloud through a symmetric encryption channel.
在一些实施例中,获取车辆的数字证书和公私钥对,并将车辆的数字证书和公私钥对配置到预定的模拟通信工具上,包括:In some embodiments, obtaining the digital certificate and the public-private key pair of the vehicle, and configuring the digital certificate and the public-private key pair of the vehicle on a predetermined analog communication tool includes:
获取实际车辆对应的数字证书和公私钥对,将所述车辆的数字证书和公私钥对配置到所述模拟通信工具,其中,所述模拟通信工具采用MQTTX工具,所述模拟通信工具用于完成所述车端与所述云端的通信代理服务之间的双向证书认证以及通信数据传输。Obtain the digital certificate and the public-private key pair corresponding to the actual vehicle, and configure the digital certificate and the public-private key pair of the vehicle to the analog communication tool, wherein the analog communication tool adopts the MQTTX tool, and the analog communication tool is used to complete the two-way certificate authentication and communication data transmission between the vehicle end and the communication proxy service of the cloud.
具体地,在正式生产环境中,为了确保车辆与云端之间通信的安全性,需要进行双向证书认证(SSL)。本申请实施例将从真实车辆上获取车辆的证书和公私钥对,并将车辆的证书和公私钥对配置到模拟通信工具中,从而利用该模拟通信工具完成车端与MQTT代理服务(即通信代理服务)之间的SSL双向证书认证,这样可以保障通信过程中的安全性。Specifically, in a formal production environment, in order to ensure the security of communication between the vehicle and the cloud, mutual certificate authentication (SSL) is required. In the embodiment of the present application, the certificate and the public-private key pair of the vehicle will be obtained from the real vehicle, and the certificate and the public-private key pair of the vehicle will be configured in the simulated communication tool, so that the simulated communication tool can be used to complete the SSL two-way certificate authentication between the vehicle terminal and the MQTT proxy service (ie, the communication proxy service), which can ensure the security in the communication process.
进一步地,双向证书认证(SSL)是指在安全套接层(Secure Socket Layer,SSL)协议中,双方(客户端和服务端)都需要提供数字证书来验证彼此的身份。SSL协议是一种广泛应用于网络通信中的加密协议,它可以确保网络连接中数据的安全和完整性。SSL协议已经被继任者传输层安全(Transport LayerSecurity,TLS)协议所取代,但通常还会被称为SSL/TLS。Further, two-way certificate authentication (SSL) means that in the Secure Socket Layer (Secure Socket Layer, SSL) protocol, both parties (client and server) need to provide digital certificates to verify each other's identities. The SSL protocol is an encryption protocol widely used in network communication, which can ensure the security and integrity of data in network connections. The SSL protocol has been replaced by the successor Transport Layer Security (TLS) protocol, but it is often referred to as SSL/TLS.
在常规的SSL/TLS通信过程中,通常只有服务器端需要提供证书,客户端通过验证服务器证书来确认服务器的身份。这种情况被称为单向证书认证。然而,在某些场景中,需要更高的安全级别,此时双向证书认证便派上了用场。双向证书认证(也称为客户端证书认证、双向SSL/TLS认证)的基本过程和原理如下:In the normal SSL/TLS communication process, usually only the server needs to provide a certificate, and the client confirms the identity of the server by verifying the server certificate. This situation is known as one-way certificate authentication. However, in some scenarios, a higher level of security is required, and two-way certificate authentication comes in handy. The basic process and principles of two-way certificate authentication (also known as client certificate authentication, two-way SSL/TLS authentication) are as follows:
客户端与服务器建立连接,并请求服务器提供证书。The client establishes a connection with the server and requests a certificate from the server.
服务器向客户端发送其数字证书(通常包含公钥)。The server sends its digital certificate (usually containing a public key) to the client.
客户端验证服务器证书的合法性。如果证书有效,客户端将继续通信;否则,通信将终止。The client verifies the legitimacy of the server certificate. If the certificate is valid, the client will continue to communicate; otherwise, the communication will be terminated.
此时,服务器也会要求客户端提供其数字证书。客户端向服务器发送其数字证书。At this time, the server will also ask the client to provide its digital certificate. The client sends its digital certificate to the server.
服务器验证客户端证书的合法性。如果证书有效,服务器将继续通信;否则,通信将终止。The server verifies the legitimacy of the client certificate. If the certificate is valid, the server will continue to communicate; otherwise, the communication will be terminated.
客户端和服务器通过使用公钥加密技术和密钥交换算法,建立一个加密通道。The client and server establish an encrypted channel by using public key cryptography and key exchange algorithms.
需要说明的是,在本申请实施例的场景下,这里的客户端可以认为是车端,服务端可以认为是云端。双向证书认证在需要高度安全的场景中非常重要,例如金融交易、保密通信等。通过双向证书认证,客户端和服务器端都能够确认对方的身份,从而确保通信的安全性。It should be noted that, in the scenario of the embodiment of the present application, the client here can be regarded as the vehicle end, and the server end can be regarded as the cloud. Two-way certificate authentication is very important in scenarios that require high security, such as financial transactions and confidential communications. Through two-way certificate authentication, both the client and the server can confirm each other's identity, thus ensuring the security of communication.
在一个具体示例中,模拟通信工具可以采用MQTTX工具,它是一款跨平台的MQTT5.0桌面客户端,由EMQ开源。通过使用MQTTX,用户可以方便地创建MQTT连接、订阅主题(Topic)并发布消息。MQTTX具有优雅的聊天界面、跨平台支持、多语言支持、多种Payload格式转换等特点。In a specific example, the simulated communication tool can use the MQTTX tool, which is a cross-platform MQTT5.0 desktop client, open sourced by EMQ. By using MQTTX, users can easily create MQTT connections, subscribe topics (Topic) and publish messages. MQTTX has the characteristics of an elegant chat interface, cross-platform support, multi-language support, and conversion of multiple Payload formats.
然而,由于该工具并不支持protobuf格式的Payload,这意味着如果需要使用protobuf格式进行通信数据传输,这种方法无法满足需求。因此,本申请实施例通过改造Java代码并将protobuf格式的通信内容转换为Hex格式的方法,从而使得MQTTX工具能够支持protobuf格式的通信数据传输,解决了Payload格式不支持protobuf的问题。However, since the tool does not support the Payload in protobuf format, this means that if you need to use protobuf format for communication data transmission, this method cannot meet the demand. Therefore, the embodiment of the present application transforms the Java code and converts the communication content in the protobuf format to the Hex format, so that the MQTTX tool can support the communication data transmission in the protobuf format, and solves the problem that the Payload format does not support protobuf.
下面结合附图对本申请实施例使用MQTTX工具进行双向证书认证以及实现protobuf格式的通信内容转换的过程进行详细说明。如图2所示,图2是本申请实施例提供的实现车云证书认证且模拟protobuf格式的MQTT通信的流程示意图。The process of using the MQTTX tool for two-way certificate authentication and realizing the conversion of communication content in protobuf format in the embodiment of the present application will be described in detail below with reference to the accompanying drawings. As shown in Figure 2, Figure 2 is a schematic flow diagram of the MQTT communication that implements the vehicle cloud certificate authentication and simulates the protobuf format provided by the embodiment of the application.
在一些实施例中,利用通信工具对车端与云端的通信代理服务进行双向证书认证,包括:In some embodiments, the two-way certificate authentication is performed on the communication agent service between the vehicle end and the cloud by using the communication tool, including:
利用车端向云端的通信代理服务发送协商通信信息,协商通信信息中包含车端支持的SSL版本和加密套件;Use the car end to send negotiation communication information to the communication proxy service in the cloud, and the negotiation communication information includes the SSL version and encryption suite supported by the car end;
云端的通信代理服务将选择的SSL版本、加密套件、通信代理服务的数字证书、公钥以及随机数返回给车端;The communication proxy service in the cloud will return the selected SSL version, encryption suite, digital certificate, public key and random number of the communication proxy service to the vehicle end;
车端对通信代理服务的数字证书进行校验,当判断通信代理服务的数字证书合法时,使车端继续与云端的通信代理服务进行通信;The car end verifies the digital certificate of the communication proxy service, and when it is judged that the digital certificate of the communication proxy service is legal, the car end continues to communicate with the communication proxy service in the cloud;
车端将数字证书以及公钥发送给通信代理服务,以便通信代理服务对车端的数字证书进行校验,获得车端的公钥;The car end sends the digital certificate and public key to the communication agent service, so that the communication agent service can verify the digital certificate of the car end and obtain the public key of the car end;
确定车端与通信代理服务之间的对称加密方案,并生成随机码作为对称加密密钥;Determine the symmetric encryption scheme between the vehicle end and the communication proxy service, and generate a random code as a symmetric encryption key;
车端使用通信代理服务的公钥对对称加密密钥进行加密,并发送给通信代理服务;The vehicle uses the public key of the communication proxy service to encrypt the symmetric encryption key and sends it to the communication proxy service;
通信代理服务利用私钥对接收的加密信息进行解密,获得对称加密密钥,从而完成车端与云端的通信代理服务之间的双向证书认证,以便建立安全的对称加密通道。The communication agent service uses the private key to decrypt the encrypted information received to obtain the symmetric encryption key, thereby completing the two-way certificate authentication between the vehicle terminal and the cloud communication agent service, so as to establish a secure symmetric encryption channel.
具体地,双向证书认证(SSL)过程中,数字证书、公钥和私钥都起着重要的作用,它们共同确保通信的安全性。下面结合具体实施例对数字证书、公钥和私钥在双向证书认证过程中所起的作用进行介绍,具体可以包括以下内容:Specifically, in the two-way certificate authentication (SSL) process, the digital certificate, the public key and the private key all play an important role, and they jointly ensure the security of communication. The role played by the digital certificate, public key and private key in the two-way certificate authentication process will be introduced below in conjunction with specific embodiments, which may specifically include the following:
证书:数字证书是由受信任的证书颁发机构(Certificate Authority,简称CA)颁发的,用于验证实体(如服务器或客户端)的身份。证书包含公钥、证书持有者的身份信息、颁发者信息以及有效期等。在双向证书认证过程中,证书的主要作用是确认通信双方的身份,防止中间人攻击。Certificate: A digital certificate is issued by a trusted certificate authority (Certificate Authority, or CA) to verify the identity of an entity (such as a server or client). A certificate includes a public key, identity information of the certificate holder, issuer information, and validity period. In the two-way certificate authentication process, the main function of the certificate is to confirm the identities of the two communicating parties and prevent man-in-the-middle attacks.
公钥:公钥是一种加密算法中的关键部分,与之配对的另一部分是私钥。在双向证书认证中,公钥的主要作用是加密数据和验证签名。通信双方可以使用对方的公钥对数据进行加密,从而确保数据在传输过程中的机密性。同时,公钥还可以验证由私钥生成的数字签名,以确保数据的完整性和来源的可靠性。Public key: The public key is a key part of an encryption algorithm, and the other part that is paired with it is the private key. In two-way certificate authentication, the main role of the public key is to encrypt data and verify signatures. Both communicating parties can use the public key of the other party to encrypt the data, thus ensuring the confidentiality of the data during transmission. At the same time, the public key can also verify the digital signature generated by the private key to ensure the integrity of the data and the reliability of the source.
私钥:私钥与公钥配对使用,用于解密数据和生成数字签名。在双向证书认证中,私钥的主要作用是解密数据和签名。私钥必须严格保密,只能由密钥所有者使用。通信双方通过使用自己的私钥解密由对方公钥加密的数据,实现安全的信息传输。同时,私钥还可以生成数字签名,用于证明数据的来源和完整性。Private key: The private key is paired with the public key to decrypt data and generate digital signatures. In two-way certificate authentication, the main function of the private key is to decrypt data and sign. The private key must be kept strictly confidential and can only be used by the key owner. The two communicating parties use their own private keys to decrypt the data encrypted by the other party's public key to achieve secure information transmission. At the same time, the private key can also generate a digital signature to prove the source and integrity of the data.
综上所述,在双向证书认证(SSL)过程中,数字证书用于验证通信双方的身份,确保通信安全;公钥用于加密数据和验证数字签名,确保数据的机密性、完整性和来源的可靠性;私钥用于解密数据和生成数字签名,实现安全的信息传输。这三者共同保障了通信过程中的安全性。To sum up, in the two-way certificate authentication (SSL) process, digital certificates are used to verify the identities of both communicating parties to ensure communication security; public keys are used to encrypt data and verify digital signatures to ensure data confidentiality, integrity and source reliability; private keys are used to decrypt data and generate digital signatures to achieve secure information transmission. These three together guarantee the security in the communication process.
下面结合本申请实施例的应用场景对使用通信工具(即MQTTX工具)实现车端与云端的通信代理服务之间的SSL双向证书认证的过程进行说明,该过程具体可以包括以下步骤:The following describes the process of using a communication tool (i.e. MQTTX tool) to realize the SSL two-way certificate authentication between the vehicle end and the cloud communication proxy service in conjunction with the application scenario of the embodiment of the present application. The process may specifically include the following steps:
步骤1:车端向云端发送车端SSL版本等信息;Step 1: The car end sends information such as the SSL version of the car end to the cloud;
步骤2:云端给车端返回SSL版本、随机数等信息,以及服务器公钥;Step 2: The cloud returns information such as the SSL version, random number, and server public key to the car;
步骤3:车端校验云端证书是否合法,合法继续,否则告警;Step 3: Check whether the cloud certificate is legal on the vehicle side, and continue legally, otherwise it will give an alarm;
步骤4:车端校验通过后,将自己的证书及公钥发送至云端;Step 4: After passing the verification on the vehicle side, send your own certificate and public key to the cloud;
步骤5:对车端证书进行校验,校验结束后获得车端公钥;Step 5: Verify the car-side certificate, and obtain the car-side public key after the verification is completed;
步骤6:车端发送自己可支持的对称加密方案给云端,供其选择;Step 6: The car end sends the symmetric encryption scheme it can support to the cloud for its choice;
步骤7:云端选择加密程度高的加密方式;Step 7: The cloud selects an encryption method with a high degree of encryption;
步骤8:将选择好的加密方案使用车端公钥进行加密后发送给车端;Step 8: Encrypt the selected encryption scheme with the public key of the vehicle and send it to the vehicle;
步骤9:车端收到加密方式后,使用私钥进行解密,产生随机码作为对称加密密钥,使用云端公钥进行加密后,发送给云端;Step 9: After receiving the encryption method, the car terminal uses the private key to decrypt, generates a random code as a symmetric encryption key, encrypts it with the cloud public key, and sends it to the cloud;
步骤10:云端使用私钥对加密信息进行解密,获得对称加密的密钥,对称加密,确保通信安全。Step 10: The cloud uses the private key to decrypt the encrypted information, obtains the key for symmetric encryption, and performs symmetric encryption to ensure communication security.
在一些实施例中,确定车端与通信代理服务之间的对称加密方案,并生成随机码作为对称加密密钥,包括:In some embodiments, determining a symmetric encryption scheme between the vehicle end and the communication proxy service, and generating a random code as a symmetric encryption key includes:
车端将可支持的对称加密方案列表发送给通信代理服务,以使通信代理服务从对称加密方案列表中选择一个对称加密方案;The car end sends the list of supported symmetric encryption schemes to the communication agent service, so that the communication agent service selects a symmetric encryption scheme from the list of symmetric encryption schemes;
通信代理服务将选择好的对称加密方案使用车端的公钥进行加密后发送给车端;The communication agent service will encrypt the selected symmetric encryption scheme with the public key of the vehicle and send it to the vehicle;
车端利用私钥对加密后的对称加密方案进行解密,并生成一个随机码作为对称加密密钥。The car end uses the private key to decrypt the encrypted symmetric encryption scheme, and generates a random code as the symmetric encryption key.
具体地,车端发送自身可支持的对称加密方案给云端服务器(即MQTT代理服务),供云端服务器选择。云端服务器根据车端提供的对称加密方案列表,从中选择一个加密强度较高的加密方式。云端服务器将选择好的加密方案使用车端公钥进行加密后发送给车端。车端收到加密的加密方案后,使用自己的私钥进行解密。随后,车端产生一个随机码作为对称加密密钥,并使用云端服务器的公钥对其进行加密,再发送给云端服务器。云端服务器使用自己的私钥对收到的加密信息进行解密,获得对称加密密钥。从此,双方开始使用对称加密通道进行通信,确保通信过程中数据的安全性。Specifically, the vehicle end sends the symmetric encryption scheme that it can support to the cloud server (that is, the MQTT proxy service), for the cloud server to choose. The cloud server selects an encryption method with higher encryption strength from the list of symmetric encryption schemes provided by the vehicle. The cloud server encrypts the selected encryption scheme with the public key of the car and sends it to the car. After receiving the encrypted encryption scheme, the car terminal uses its own private key to decrypt. Then, the car terminal generates a random code as a symmetric encryption key, encrypts it with the public key of the cloud server, and then sends it to the cloud server. The cloud server uses its own private key to decrypt the received encrypted information to obtain the symmetric encryption key. Since then, the two parties have started to communicate using symmetric encrypted channels to ensure data security during communication.
根据本申请实施例提供的技术方案,车端与云端服务器在建立连接时能够进行身份验证和安全通信参数的协商。在双向证书认证的基础上,通信双方之间可以建立一个安全的对称加密通道,从而确保新能源汽车与云端服务器之间的数据传输安全。这种方法还可以应用于车联网、智能交通系统等场景,提高数据传输的安全性和可靠性。According to the technical solution provided by the embodiment of the present application, the vehicle terminal and the cloud server can perform identity verification and negotiation of secure communication parameters when establishing a connection. On the basis of two-way certificate authentication, a secure symmetric encrypted channel can be established between the communication parties to ensure the security of data transmission between the new energy vehicle and the cloud server. This method can also be applied to scenarios such as the Internet of Vehicles and intelligent transportation systems to improve the security and reliability of data transmission.
以上实施例对车端与云端的MQTT代理服务之间的SSL双向证书认证的过程做了详细说明,下面结合具体实施例对本申请实施例改造Java代码并将protobuf格式的通信内容转换为Hex格式的方法进行详细说明。The above embodiments have described in detail the process of the SSL two-way certificate authentication between the vehicle end and the MQTT proxy service in the cloud. The method for transforming the Java code and converting the communication content in protobuf format to Hex format in the embodiment of the present application will be described in detail below in conjunction with specific embodiments.
下面对protobuf格式与Hex格式的转换过程和原理做概括性描述,将protobuf格式的通信内容转换成Hex格式的具体方法概括如下:The following is a general description of the conversion process and principle between protobuf format and Hex format. The specific method of converting the communication content of protobuf format into Hex format is summarized as follows:
首先,理解byte和Hex之间的关系,在Java中,byte用二进制表示占用8位,而Hex(16进制)的每个字符需要用4位二进制位来表示,所以每个byte可以转换成两个相应的16进制字符,即把byte的高4位和低4位分别转换成相应的16进制字符H和L,并组合起来得到byte转换到16进制字符串的结果,即:new String(H)+new String(L)。First, understand the relationship between byte and Hex. In Java, byte occupies 8 bits in binary representation, and each character in Hex (hexadecimal) needs to be represented by 4 binary bits, so each byte can be converted into two corresponding hexadecimal characters, that is, convert the high 4 bits and low 4 bits of byte into corresponding hexadecimal characters H and L, and combine them to get the result of converting byte to hexadecimal string, namely: new String(H)+new String(L).
组装后的protobuf内容序列化后得到byte[]数组,定义一个长度为byte[]数组2倍的char[]数组,挨个遍历byte[]数组,取出字节的高四位的数值,把高四位向右移四位,&0x0f运算(0x0f的二进制是0000 1111,同时1&运算得出原数,0&运算得出0)得出高四位的数值;取出低四位的数值,直接&0x0f运算得出低四位的数值;将得到的这些数值依次存放到char[]数组中,最后将char[]数组转化成String(),此时String()就是我们期望的Hex格式的内容。The assembled protobuf content is serialized to get a byte[] array, define a char[] array whose length is twice as long as the byte[] array, traverse the byte[] array one by one, take out the value of the high four digits of the byte, shift the high four digits to the right by four digits, and perform &0x0f operation (the binary value of 0x0f is 0000 1111, and at the same time, the 1& operation obtains the original number, and the 0& operation obtains 0) to obtain the high four digit value; take out the low four digit value, directly &0x0 The value of the lower four digits is obtained by the f operation; these values are stored in the char[] array in turn, and finally the char[] array is converted into String(), and String() is the content in the Hex format we expect.
在实际应用中,在将protobuf格式的通信内容转换成Hex格式的通信内容之前,本申请实施例还可以使用JAVA编写模拟车端上报的代码编写,具体可以包括以下步骤:In practical applications, before the communication content in protobuf format is converted into communication content in Hex format, the embodiment of the present application can also use JAVA to write the code for simulating vehicle end reporting, which may specifically include the following steps:
步骤1:确定proto文件。proto文件是用来预先定义消息的数据结构,数据包需要按照proto文件所定义的结构完成二进制码流的编码和解码,车端和OTA后台服务才能读懂彼此发送的信息。该文件一般是由项目组技术人员设计并确定。Step 1: Determine the proto file. The proto file is used to predefine the data structure of the message. The data packet needs to complete the encoding and decoding of the binary stream according to the structure defined by the proto file, so that the car terminal and the OTA background service can understand the information sent by each other. This file is generally designed and determined by the technical staff of the project team.
步骤2:将proto文件编译成JAVA语言类。首先,下载操作系统的指定protobuf版本的protoc编译器——protoc.exe;然后,在编译器所在的路径下打开cmd,执行protoc--java_out=.xx.proto命令(protoc固定触发“proto文件编译”的指令,--java_out=.将生成的文件放在当前路径下,xx.proto指proto文件),回车;最后,编译成功后会在当前路径下生成java类文件。Step 2: Compile the proto file into JAVA language classes. First, download the protoc compiler of the specified protobuf version of the operating system—protoc.exe; then, open cmd in the path where the compiler is located, and execute the protoc --java_out=.
步骤3:组装Payload内容。使用第二步生成的java类,新建对象并对属性进行赋值(这些值组合起来,就是车端要发送给MQTT服务的Payload内容)。Step 3: Assemble the payload content. Use the java class generated in the second step to create a new object and assign values to the properties (the combination of these values is the Payload content to be sent by the car to the MQTT service).
步骤4:将Payload内容序列化,将步骤3中的新建对象进行序列化为字节数组。Step 4: Serialize the Payload content, and serialize the newly created object in step 3 into a byte array.
步骤5:将序列化后的字节数组转换成Hex格式。Step 5: Convert the serialized byte array into Hex format.
在一些实施例中,对通信数据执行序列化操作,得到通信数据对应的字节数组,包括:In some embodiments, the serialization operation is performed on the communication data to obtain a byte array corresponding to the communication data, including:
获取云端OTA升级系统测试过程中车端上报给云端的通信数据,通信数据采用protobuf格式,将protobuf格式的通信数据进行序列化,得到字节数组。Obtain the communication data reported by the vehicle end to the cloud during the test of the cloud OTA upgrade system. The communication data is in the protobuf format, and the communication data in the protobuf format is serialized to obtain a byte array.
具体地,本申请实施例是以云端OTA升级系统测试过程中模拟车端上报给云端的数据内容进行格式转换的过程为例进行说明的。在云端OTA升级系统测试过程中,车端响应于云端推送的软件更新数据,产生上报给云端的数据内容,例如升级软件包开始下载、下载的结果、开始安装、安装的结果等。在将protobuf格式的通信内容转换成Hex格式之前,首先将protobuf格式的通信内容序列化后得到一个byte[]数组(即字节数组)。Specifically, the embodiment of the present application is described by taking the process of simulating the format conversion of the data content reported by the vehicle terminal to the cloud during the test process of the cloud OTA upgrade system as an example. During the testing process of the cloud OTA upgrade system, the car end responds to the software update data pushed by the cloud, and generates data content reported to the cloud, such as the download of the upgrade software package, the result of the download, the start of installation, the result of the installation, etc. Before converting the communication content in the protobuf format into the Hex format, first serialize the communication content in the protobuf format to obtain a byte[] array (that is, a byte array).
在一些实施例中,利用预定的字符数组将字节数组转换成目标格式的文本,包括:In some embodiments, using a predetermined character array to convert the byte array into text in a target format includes:
定义一个长度为字节数组的两倍长度的字符数组,遍历字符数组分别取出每个字节的高四位数值和低四位数值,将高四位数值和低四位数值依次存放到字符数组中,将字符数组转化为字符串类型的对象,得到目标格式的通信内容,其中,目标格式为Hex格式。Define a character array whose length is twice the length of the byte array, traverse the character array to take out the high four-digit value and the low four-digit value of each byte, store the high four-digit value and the low four-digit value in the character array in turn, convert the character array into a string type object, and obtain the communication content in the target format, where the target format is Hex format.
具体地,在将protobuf格式的通信内容序列化得到一个byte[]数组后,本申请实施例还定义一个长度为byte[]数组2倍的char[]数组(即字符数组),char[]数组用于存储转换后的Hex字符。之后,挨个遍历byte[]数组,取出每个字节的高四位数值和低四位数值。Specifically, after serializing the communication content in the protobuf format to obtain a byte[] array, the embodiment of the present application also defines a char[] array (that is, a character array) whose length is twice the byte[] array, and the char[] array is used to store the converted Hex characters. After that, the byte[] array is traversed one by one, and the high four-digit value and low four-digit value of each byte are taken out.
进一步地,将得到的这些数值(即高四位数值和低四位数值)经过相应的运算后依次存放到char[]数组中。最后,将char[]数组转化成String对象(即字符串类型的对象)。此时,这个String对象就是最终期望得到的Hex格式的通信内容。Further, the obtained values (that is, the high four-digit value and the low four-digit value) are sequentially stored in the char[] array after corresponding operations. Finally, convert the char[] array into a String object (that is, an object of type string). At this point, the String object is the communication content in Hex format that is expected to be obtained in the end.
在实际应用中,char[]数组可以表示为“字符数组”。在编程语言中,一个char代表一个字符,通常占用一个或多个字节(取决于编码方式)。一个char数组则是由一系列字符组成的数据结构,可以用来表示字符串或一段文本信息。In practical applications, char[] arrays can be represented as "character arrays". In programming languages, a char represents a character, usually occupying one or more bytes (depending on the encoding). A char array is a data structure composed of a series of characters, which can be used to represent a string or a piece of text information.
在Java中,char类型的数据通常占用两个字节(16位),使用Unicode字符集表示字符。因此,char[]数组可以存储各种语言字符,包括中文。一个char[]数组可以通过遍历和处理来实现字符串的操作,例如分割、拼接、查找等。此外,char[]数组还可以与其他类型的数组(如byte[]数组)进行转换,以便进行数据处理和传输。In Java, data of type char usually occupies two bytes (16 bits), using the Unicode character set to represent characters. Therefore, the char[] array can store various language characters, including Chinese. A char[] array can be traversed and processed to implement string operations, such as splitting, splicing, searching, and so on. In addition, char[] arrays can also be converted with other types of arrays (such as byte[] arrays) for data processing and transmission.
在一些实施例中,遍历字符数组分别取出每个字节的高四位数值和低四位数值,包括:In some embodiments, the high four-digit value and the low four-digit value of each byte are obtained by traversing the character array, including:
在取出高四位数值时,将每个字节向右移四位,并与预定的数值进行按位与运算,得到高四位的数值;When taking out the high four-digit value, shift each byte to the right by four bits, and perform a bitwise AND operation with the predetermined value to obtain the high four-digit value;
在取出低四位数值时,将每个字节直接与预定的数值进行按位与运算,得到低四位的数值。When fetching the lower four-digit value, directly perform a bitwise AND operation on each byte with a predetermined value to obtain the lower four-digit value.
具体地,在挨个遍历byte[]数组,取出每个字节的高四位数值和低四位数值时,对于高四位数值,通过将每个字节向右移四位,然后与0x0f(即预定的数值)进行按位与运算,得到高四位的数值;对于低四位数值,直接与0x0f(即预定的数值)进行按位与运算,得到低四位的数值。其中,0x0f表示十进制数值“15”的十六进制写法,即0x0f表示数值“15”。Specifically, when traversing the byte[] array one by one to take out the high four-digit value and the low four-digit value of each byte, for the high four-digit value, by shifting each byte four bits to the right, and then performing a bitwise AND operation with 0x0f (that is, the predetermined value) to obtain the high four-digit value; for the low four-digit value, directly performing a bitwise AND operation with 0x0f (that is, the predetermined value) to obtain the low four-digit value. Among them, 0x0f represents the hexadecimal notation of the decimal value "15", that is, 0x0f represents the value "15".
本申请实施例的技术方案提供了一种在Java中将protobuf格式的通信内容转换为Hex格式的方法,以便将通信数据在不同的平台和系统中进行传输和处理。在车联网、物联网等场景中,这种方法可以帮助实现多种数据格式之间的兼容和互操作。The technical solution of the embodiment of the present application provides a method for converting communication content in protobuf format into Hex format in Java, so as to transmit and process communication data in different platforms and systems. In scenarios such as the Internet of Vehicles and the Internet of Things, this method can help achieve compatibility and interoperability between multiple data formats.
根据本申请实施例提供的技术方案,本申请实施例通过将真实车辆上获取的证书和公私钥对配置到MQTTX工具上,利用MQTTX工具完成车端到云端的MQTT代理服务之间的SSL双向证书认证。并且通过将原有的JAVA代码进行改造,将原本的protobuf格式通信内容直接上报给云端改造为将protobuf格式的通信内容转换成Hex格式输出,再将转换出的Hex格式的文本通过MQTTX工具上报到云端,解决使用MQTTX工具模拟通信数据传输时,Payload格式不支持protobuf的问题。According to the technical solution provided by the embodiment of the application, the embodiment of the application configures the certificate and public-private key pair obtained on the real vehicle to the MQTTX tool, and uses the MQTTX tool to complete the SSL two-way certificate authentication between the MQTT proxy service from the vehicle end to the cloud. And by transforming the original JAVA code, the original protobuf format communication content is directly reported to the cloud and transformed into converting the protobuf format communication content into Hex format output, and then the converted Hex format text is reported to the cloud through the MQTTX tool to solve the problem that the Payload format does not support protobuf when using the MQTTX tool to simulate communication data transmission.
本申请合理利用代码和工具各自的优点,将原来的代码简单改造,学习成本低,再利用MQTTX工具完成双向证书认证的过程,达到测试这种特殊环境的目的。学习成本低,易理解,简单易上手。本申请充分发挥代码和工具各自的优点,巧妙地利用工具完成证书认证,再利用代码将工具不支持的protobuf格式转换成工具支持的Hex格式,完成测试任务。This application makes reasonable use of the respective advantages of the code and the tool, simply transforms the original code, and has low learning costs, and then uses the MQTTX tool to complete the process of two-way certificate authentication to achieve the purpose of testing this special environment. Low learning cost, easy to understand, easy to use. This application gives full play to the respective advantages of the code and the tool, cleverly uses the tool to complete the certificate authentication, and then uses the code to convert the protobuf format not supported by the tool into the Hex format supported by the tool to complete the test task.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
图3是本申请实施例提供的用于车辆与云端的通信装置的结构示意图。如图3所示,该用于车辆与云端的通信装置包括:Fig. 3 is a schematic structural diagram of a communication device for a vehicle and a cloud provided by an embodiment of the present application. As shown in Figure 3, the communication device for the vehicle and the cloud includes:
配置模块301,被配置为获取车辆的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到预定的模拟通信工具上;The configuration module 301 is configured to obtain the digital certificate and the public-private key pair of the vehicle, and configure the digital certificate and the public-private key pair of the vehicle to a predetermined analog communication tool;
认证模块302,被配置为利用模拟通信工具对车端与云端的通信代理服务进行双向证书认证,以便建立车端与通信代理服务之间的对称加密通道;The authentication module 302 is configured to use an analog communication tool to perform two-way certificate authentication on the communication agent service between the vehicle end and the cloud, so as to establish a symmetric encrypted channel between the vehicle end and the communication agent service;
序列化模块303,被配置为确定车端发送给通信代理服务的通信数据,对通信数据执行序列化操作,得到通信数据对应的字节数组;The serialization module 303 is configured to determine the communication data sent by the vehicle end to the communication proxy service, perform a serialization operation on the communication data, and obtain a byte array corresponding to the communication data;
转换模块304,被配置为利用预定的字符数组将字节数组转换成目标格式的文本,将目标格式的文本通过对称加密通道上报给云端。The conversion module 304 is configured to convert the byte array into a text in a target format by using a predetermined character array, and report the text in the target format to the cloud through a symmetric encrypted channel.
在一些实施例中,图3的配置模块301获取实际车辆对应的数字证书和公私钥对,将车辆的数字证书和公私钥对配置到模拟通信工具,其中,模拟通信工具采用MQTTX工具,模拟通信工具用于完成车端与云端的通信代理服务之间的双向证书认证以及通信数据传输。In some embodiments, the configuration module 301 in FIG. 3 acquires the digital certificate and the public-private key pair corresponding to the actual vehicle, and configures the digital certificate and the public-private key pair of the vehicle to the analog communication tool, wherein the analog communication tool adopts the MQTTX tool, and the analog communication tool is used to complete two-way certificate authentication and communication data transmission between the vehicle end and the communication proxy service of the cloud.
在一些实施例中,图3的认证模块302利用车端向云端的通信代理服务发送协商通信信息,协商通信信息中包含车端支持的SSL版本和加密套件;云端的通信代理服务将选择的SSL版本、加密套件、通信代理服务的数字证书、公钥以及随机数返回给车端;车端对通信代理服务的数字证书进行校验,当判断通信代理服务的数字证书合法时,使车端继续与云端的通信代理服务进行通信;车端将数字证书以及公钥发送给通信代理服务,以便通信代理服务对车端的数字证书进行校验,获得车端的公钥;确定车端与通信代理服务之间的对称加密方案,并生成随机码作为对称加密密钥;车端使用通信代理服务的公钥对对称加密密钥进行加密,并发送给通信代理服务;通信代理服务利用私钥对接收的加密信息进行解密,获得对称加密密钥,从而完成车端与云端的通信代理服务之间的双向证书认证,以便建立安全的对称加密通道。In some embodiments, the authentication module 302 in FIG. 3 uses the vehicle terminal to send negotiation communication information to the communication proxy service in the cloud, and the negotiation communication information includes the SSL version and encryption suite supported by the vehicle terminal; the communication proxy service in the cloud returns the selected SSL version, encryption suite, digital certificate, public key and random number of the communication proxy service to the vehicle terminal; the vehicle terminal verifies the digital certificate of the communication proxy service, and when it is judged that the digital certificate of the communication proxy service is legal, the vehicle terminal continues to communicate with the communication proxy service in the cloud; the vehicle terminal sends the digital certificate and public key to the communication proxy Service, so that the communication agent service can verify the digital certificate of the car end, and obtain the public key of the car end; determine the symmetric encryption scheme between the car end and the communication agent service, and generate a random code as a symmetric encryption key;
在一些实施例中,图3的认证模块302车端将可支持的对称加密方案列表发送给通信代理服务,以使通信代理服务从对称加密方案列表中选择一个对称加密方案;通信代理服务将选择好的对称加密方案使用车端的公钥进行加密后发送给车端;车端利用私钥对加密后的对称加密方案进行解密,并生成一个随机码作为对称加密密钥。In some embodiments, the authentication module 302 of FIG. 3 sends the list of supported symmetric encryption schemes to the communication proxy service, so that the communication proxy service selects a symmetric encryption scheme from the list of symmetric encryption schemes; the communication proxy service encrypts the selected symmetric encryption scheme with the public key of the vehicle terminal and sends it to the vehicle terminal; the vehicle terminal uses the private key to decrypt the encrypted symmetric encryption scheme, and generates a random code as the symmetric encryption key.
在一些实施例中,图3的序列化模块303获取云端OTA升级系统测试过程中车端上报给云端的通信数据,通信数据采用protobuf格式,将protobuf格式的通信数据进行序列化,得到字节数组。In some embodiments, the serialization module 303 in FIG. 3 obtains the communication data reported by the vehicle end to the cloud during the test process of the cloud OTA upgrade system. The communication data adopts the protobuf format, and serializes the communication data in the protobuf format to obtain a byte array.
在一些实施例中,图3的转换模块304定义一个长度为字节数组的两倍长度的字符数组,遍历字符数组分别取出每个字节的高四位数值和低四位数值,将高四位数值和低四位数值依次存放到字符数组中,将字符数组转化为字符串类型的对象,得到目标格式的通信内容,其中,目标格式为Hex格式。In some embodiments, the conversion module 304 in FIG. 3 defines a character array whose length is twice the length of the byte array, traverses the character array to extract the upper four-digit value and the lower four-digit value of each byte, stores the upper four-digit value and the lower four-digit value in the character array in turn, converts the character array into a character string type object, and obtains the communication content in the target format, wherein the target format is Hex format.
在一些实施例中,图3的转换模块304在取出高四位数值时,将每个字节向右移四位,并与预定的数值进行按位与运算,得到高四位的数值;在取出低四位数值时,将每个字节直接与预定的数值进行按位与运算,得到低四位的数值。In some embodiments, the conversion module 304 in FIG. 3 shifts each byte to the right by four bits when taking out the upper four-digit value, and performs a bitwise AND operation with the predetermined value to obtain the upper four-digit value;
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
图4是本申请实施例提供的电子设备4的结构示意图。如图4所示,该实施例的电子设备4包括:处理器401、存储器402以及存储在该存储器402中并且可以在处理器401上运行的计算机程序403。处理器401执行计算机程序403时实现上述各个方法实施例中的步骤。或者,处理器401执行计算机程序403时实现上述各装置实施例中各模块/单元的功能。FIG. 4 is a schematic structural diagram of an electronic device 4 provided by an embodiment of the present application. As shown in FIG. 4 , the electronic device 4 of this embodiment includes: a processor 401 , a memory 402 , and a computer program 403 stored in the memory 402 and capable of running on the processor 401 . When the processor 401 executes the computer program 403, the steps in the foregoing method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules/units in the foregoing device embodiments are realized.
示例性地,计算机程序403可以被分割成一个或多个模块/单元,一个或多个模块/单元被存储在存储器402中,并由处理器401执行,以完成本申请。一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述计算机程序403在电子设备4中的执行过程。Exemplarily, the computer program 403 can be divided into one or more modules/units, and one or more modules/units are stored in the memory 402 and executed by the processor 401 to complete the present application. One or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 403 in the electronic device 4 .
电子设备4可以是桌上型计算机、笔记本、掌上电脑及云端服务器等电子设备。电子设备4可以包括但不仅限于处理器401和存储器402。本领域技术人员可以理解,图4仅仅是电子设备4的示例,并不构成对电子设备4的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如,电子设备还可以包括输入输出设备、网络接入设备、总线等。The electronic device 4 can be electronic devices such as desktop computers, notebooks, palmtop computers, and cloud servers. The electronic device 4 may include but not limited to a processor 401 and a memory 402 . Those skilled in the art can understand that FIG. 4 is only an example of the electronic device 4, and does not constitute a limitation to the electronic device 4. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
处理器401可以是中央处理单元(Central Processing Unit,CPU),也可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 401 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器402可以是电子设备4的内部存储单元,例如,电子设备4的硬盘或内存。存储器402也可以是电子设备4的外部存储设备,例如,电子设备4上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(SecureDigital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器402还可以既包括电子设备4的内部存储单元也包括外部存储设备。存储器402用于存储计算机程序以及电子设备所需的其它程序和数据。存储器402还可以用于暂时地存储已经输出或者将要输出的数据。The storage 402 may be an internal storage unit of the electronic device 4 , for example, a hard disk or a memory of the electronic device 4 . The memory 402 can also be an external storage device of the electronic device 4, for example, a plug-in hard disk equipped on the electronic device 4, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash memory card (Flash Card) and the like. Further, the memory 402 may also include both an internal storage unit of the electronic device 4 and an external storage device. The memory 402 is used to store computer programs and other programs and data required by the electronic device. The memory 402 can also be used to temporarily store data that has been output or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules, so as to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit, and the above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the aforementioned method embodiments, and details will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/计算机设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/计算机设备实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/computer equipment and methods can be implemented in other ways. For example, the device/computer device embodiments described above are only illustrative. For example, the division of modules or units is only a division of logical functions. In actual implementation, there may be other division methods. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part 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 may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,计算机程序可以存储在计算机可读存储介质中,该计算机程序在被处理器执行时,可以实现上述各个方法实施例的步骤。计算机程序可以包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random AccessMemory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如,在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If an integrated module/unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above-mentioned method embodiments. A computer program may include computer program code, which may be in source code form, object code form, executable file, or some intermediate form or the like. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in computer readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer readable media do not include electrical carrier signals and telecommunication signals according to legislation and patent practice.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the various embodiments of the application, and should be included within the scope of protection of the application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310453488.2A CN116489190A (en) | 2023-04-25 | 2023-04-25 | Communication method, device, electronic device and storage medium for vehicle and cloud |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310453488.2A CN116489190A (en) | 2023-04-25 | 2023-04-25 | Communication method, device, electronic device and storage medium for vehicle and cloud |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116489190A true CN116489190A (en) | 2023-07-25 |
Family
ID=87211444
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310453488.2A Pending CN116489190A (en) | 2023-04-25 | 2023-04-25 | Communication method, device, electronic device and storage medium for vehicle and cloud |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116489190A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117499918A (en) * | 2023-09-26 | 2024-02-02 | 重庆赛力斯新能源汽车设计院有限公司 | Methods, devices, electronic equipment and storage media for upgrading equipment access to the cloud |
| CN118368605A (en) * | 2024-03-29 | 2024-07-19 | 重庆赛力斯凤凰智创科技有限公司 | Remote communication method and device, electronic equipment and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113572795A (en) * | 2020-04-28 | 2021-10-29 | 广州汽车集团股份有限公司 | Vehicle safety communication method and system and vehicle-mounted terminal |
| CN115086385A (en) * | 2022-05-12 | 2022-09-20 | 阿里巴巴达摩院(杭州)科技有限公司 | Vehicle-cloud data interaction method and device and computer-readable storage medium |
| CN115189925A (en) * | 2022-06-22 | 2022-10-14 | 一汽奔腾轿车有限公司 | An OTA secure communication method based on TLS mutual authentication |
-
2023
- 2023-04-25 CN CN202310453488.2A patent/CN116489190A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113572795A (en) * | 2020-04-28 | 2021-10-29 | 广州汽车集团股份有限公司 | Vehicle safety communication method and system and vehicle-mounted terminal |
| CN115086385A (en) * | 2022-05-12 | 2022-09-20 | 阿里巴巴达摩院(杭州)科技有限公司 | Vehicle-cloud data interaction method and device and computer-readable storage medium |
| CN115189925A (en) * | 2022-06-22 | 2022-10-14 | 一汽奔腾轿车有限公司 | An OTA secure communication method based on TLS mutual authentication |
Non-Patent Citations (1)
| Title |
|---|
| MQTTX TEAM: "MQTTX v1.3.0 正式发布 - 跨平台MQTT 5.0桌面测试客户端", pages 1 - 2, Retrieved from the Internet <URL:https://www.emqx.com/zh/blog/mqttx-v1-3-0-was-officially-released-an-elegant-cross-platform-mqtt5-desktop-test-client> * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117499918A (en) * | 2023-09-26 | 2024-02-02 | 重庆赛力斯新能源汽车设计院有限公司 | Methods, devices, electronic equipment and storage media for upgrading equipment access to the cloud |
| CN118368605A (en) * | 2024-03-29 | 2024-07-19 | 重庆赛力斯凤凰智创科技有限公司 | Remote communication method and device, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20120210396A1 (en) | Processing extensible markup language security messages using delta parsing technology | |
| CN116489190A (en) | Communication method, device, electronic device and storage medium for vehicle and cloud | |
| CN115174267B (en) | TLS protocol negotiation method, equipment and medium | |
| US12278804B2 (en) | Systems and methods for generating secure, encrypted communications using multi-party computations in order to perform blockchain operations in decentralized applications | |
| CN112689020B (en) | A message transmission method, message middleware, electronic equipment and storage medium | |
| CN109379179B (en) | Method and apparatus for updating digital certificates | |
| CN117650898A (en) | Method and system for combining quantum hybrid certificate and electronic equipment | |
| CN118827648A (en) | Automatic docking method, system, device and medium for Internet of Things devices | |
| CN113378242A (en) | Data verification method and system | |
| US12245034B2 (en) | Secure and trusted peer-to-peer offline communication systems and methods | |
| Kumar et al. | Analysis of api architecture: A detailed report | |
| WO2025016039A1 (en) | Data transmission method and apparatus, and related device | |
| US12244743B2 (en) | Systems and methods for performing blockchain operations using multi-party computation cohort management groupings | |
| US20230421396A1 (en) | Systems and methods for performing two-tiered multi-party computation signing procedures to perform blockchain operations | |
| CN115412280A (en) | Method, device and equipment for establishing data link and storage medium | |
| CN112929453B (en) | Method and device for sharing session data | |
| CN115665239A (en) | Netty framework-based message subscription method, system, electronic device and storage medium | |
| US9288116B2 (en) | System and method for NAS server test load generation | |
| CN111984616B (en) | A method, device and system for updating shared files | |
| CN119276497A (en) | Key generation method and device, computer program product, and electronic device | |
| CN116846625A (en) | Communication method, communication device, electronic apparatus, and computer storage medium | |
| CN116185424A (en) | Signal transmission method, device, electronic device, storage medium, and vehicle | |
| Johnson | The WebSockets Handbook: Seamless Communication for Web, Mobile, and IoT | |
| CN114519026A (en) | Serial port communication method and device | |
| CN113364821A (en) | Functional service access method, device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20240116 Address after: No. 13 Xingxiang Road, Zengjia Town, High tech Zone, Shapingba District, Chongqing, 400039 Applicant after: Chongqing Selis Phoenix Intelligent Innovation Technology Co.,Ltd. Address before: 610095 No. 2901, floor 29, unit 1, building 1, No. 151, Tianfu Second Street, high tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan Province Applicant before: Chengdu Thalys Technology Co.,Ltd. |
|
| TA01 | Transfer of patent application right |