Data transmission method and device
By using the target application's public and private keys on the security service platform to digitally sign and decrypt the control instructions, the problem of data transmission security risks between the vehicle and the cloud server is solved, and the integrity and confidentiality of the data during the transmission process is achieved.
Patent Information
- Application Number
- CN202411894559.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-25
AI Technical Summary
Data transmission between vehicles and cloud servers poses a security risk of data leakage and tampering, endangering the safety of vehicles and passengers.
On the security service platform, the control instructions are digitally signed and encrypted and decrypted using the public and private keys of the target application to ensure the integrity and confidentiality of the data during transmission.
Through digital signature and encryption and decryption processing, data leakage and tampering can be effectively prevented, the integrity and confidentiality of control instructions during transmission are ensured, and the safety of vehicles and passengers is ensured.
Smart Images

Figure CN119696908A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data transmission. Background Art
[0002] As the application of Internet technology in the automotive field continues to deepen, most of the various functional modules and electronic control systems on the vehicle need to interact with the cloud server in real time to achieve intelligent data distribution, resource sharing, fault collection and other functions. Therefore, the communication security between the vehicle and the cloud server has also received more and more attention.
[0003] At present, most of the data transmission methods between vehicles and cloud servers have low confidentiality, and there is a high possibility of data leakage, data tampering and other security risks during the data transmission process, which may cause the vehicle to lose control or be attacked, thus endangering the safety of the vehicle and passengers.
[0004] Therefore, how to ensure the integrity and confidentiality of data during transmission is an urgent problem to be solved. Summary of the invention
[0005] This specification provides a data transmission method, device, storage medium and electronic device to ensure the integrity and confidentiality of data during transmission.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a method for data transmission, which is applied to a security service platform; the method includes:
[0008] Obtaining a control instruction sent to the vehicle terminal by a target application in at least one application;
[0009] In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally sign the control instruction to obtain the digital signature of the control instruction, and encrypt the control instruction to obtain the encrypted control instruction;
[0010] The digital signature of the control instruction and the encrypted control instruction are written into a message queue, so that the vehicle-mounted terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application to obtain the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
[0011] Optionally, before obtaining the control instruction issued to the vehicle-mounted terminal by the target application in the at least one application, the method further includes:
[0012] Acquire service data corresponding to a target application in the at least one application and a first hash value written by the vehicle terminal into the message queue, where the first hash value is obtained by performing a hash calculation on the service data by the vehicle terminal based on a preset hash algorithm;
[0013] Performing hash calculation on the service data based on the hash algorithm to obtain a second hash value;
[0014] Verifying whether the first Hash value and the second Hash value are the same;
[0015] If yes, the service data is analyzed to obtain an analysis result, so that the target application sends a control instruction to the vehicle-mounted terminal based on the analysis result.
[0016] Optionally, the security service platform deploys at least one application; the security service platform maintains an association relationship between the at least one application and the interface call permission of at least one interface corresponding thereto;
[0017] In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally signing the control instruction to obtain the digital signature of the control instruction, and encrypting the control instruction to obtain the encrypted control instruction, the method further includes:
[0018] receiving an interface call request sent by the target application, and determining at least one interface required by the target application;
[0019] Querying an association relationship between at least one application and the interface calling permission of at least one interface corresponding to the target application, and determining the interface calling permission of at least one interface corresponding to the target application based on the application name of the target application;
[0020] In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally signing the control instruction to obtain the digital signature of the control instruction, and encrypting the control instruction to obtain the encrypted control instruction, including:
[0021] Determine whether the target application has interface calling authority for the signature interface and the encryption interface; if so, call the signature interface, perform digital signature processing on the control instruction based on the maintained private key corresponding to the target application, and obtain the digital signature of the control instruction; and call the encryption interface, perform encryption processing on the control instruction based on the maintained private key corresponding to the target application, and obtain the encrypted control instruction.
[0022] Optionally, the Internet of Vehicles service provider deploys at least one application; the Internet of Vehicles service provider maintains an association relationship between the at least one application and the interface call permission of at least one interface corresponding to the at least one application;
[0023] In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally signing the control instruction to obtain the digital signature of the control instruction, and encrypting the control instruction to obtain the encrypted control instruction, including:
[0024] If the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the signed interface, receiving the signed interface calling request for the target application sent by the Internet of Vehicles service provider, and performing digital signature processing on the control instruction based on the maintained private key corresponding to the target application to obtain the digital signature of the control instruction;
[0025] If the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the encrypted interface, an encrypted interface calling request for the target application sent by the Internet of Vehicles service provider is received, and based on the maintained private key corresponding to the target application, the control instruction is encrypted to obtain the encrypted control instruction.
[0026] Optionally, the method further comprises:
[0027] Obtain the interface call log of at least one interface;
[0028] Collecting statistics on the interface call log of the at least one interface to determine at least one call parameter;
[0029] Determine whether at least one call parameter is greater than a set parameter threshold, and if so, send an alarm message to the user.
[0030] Optionally, the method further comprises:
[0031] Obtaining the operation log and the fault log corresponding to the vehicle written into the message queue by the vehicle terminal;
[0032] The operation log and the fault log are analyzed to obtain analysis results, and the analysis results are displayed to the user.
[0033] Optionally, the method further comprises:
[0034] According to the preset security rules, the service data is detected for abnormality to determine whether there is abnormal data in the service data. If so, an alarm message is sent to the user.
[0035] Optionally, the method further comprises:
[0036] Receiving an interface call request sent by at least one electronic controller ECU in the vehicle;
[0037] Calling a signature interface, performing digital signature processing on the ECU identifier of the ECU based on the maintained private key corresponding to the target application, and obtaining a digital signature of the ECU;
[0038] The digital signature of the ECU and the public key corresponding to the target application are sent to the ECU, so that when the vehicle is started, the ECU verifies the digital signature of the ECU based on the public key corresponding to the target application, and completes the startup of the vehicle after the digital signature is verified.
[0039] Optionally, the security service platform is a service platform adopting a microservice architecture; the application is a distributed application in which at least part of the services are deployed on different service devices on the service platform.
[0040] This specification provides a data transmission device, which is applied to a security service platform; the device includes:
[0041] An acquisition module, used to acquire a control instruction sent to the vehicle terminal by a target application in at least one application;
[0042] a response module, configured to respond to the acquired control instruction, perform digital signature processing on the control instruction based on the maintained private key corresponding to the target application to obtain the digital signature of the control instruction, and perform encryption processing on the control instruction to obtain the encrypted control instruction;
[0043] An execution module is used to write the digital signature of the control instruction and the encrypted control instruction into a message queue, so that the vehicle-mounted terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application to obtain the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
[0044] This specification provides an electronic device, including a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;
[0045] The memory stores machine-readable instructions, and the processor executes the above-mentioned data transmission method by calling the machine-readable instructions.
[0046] This specification provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above-mentioned data transmission method is implemented.
[0047] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0048] In this specification, in response to the acquired control instruction, the security service platform performs digital signature processing on the control instruction based on the private key corresponding to the target application maintained to obtain the digital signature of the control instruction, and performs encryption processing on the control instruction to obtain the encrypted control instruction.
[0049] Then, the digital signature of the control instruction and the encrypted control instruction are written into the message queue, so that the vehicle terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application, obtains the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
[0050] Therefore, on the security service platform, the control instructions are digitally signed and encrypted and decrypted through the public and private key pairs corresponding to the target application, ensuring the integrity and confidentiality of the control instructions during transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0052] Figure 1 is a flow chart of a data transmission method shown in an exemplary embodiment;
[0053] Figure 2 is a schematic diagram of data transmission shown in an exemplary embodiment;
[0054] Figure 3 is a schematic diagram of another data transmission shown in an exemplary embodiment;
[0055] Figure 4 It is a structural diagram of an electronic device where a data transmission device is located, shown in an exemplary embodiment;
[0056] Figure 5 It is a structural diagram of a data transmission device shown in an exemplary embodiment. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0058] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0059] At present, most of the data transmission methods between vehicles and cloud servers have low confidentiality, and there is a high possibility of data leakage, data tampering and other security risks during the data transmission process, which may cause the vehicle to lose control or be attacked, thus endangering the safety of the vehicle and passengers.
[0060] Based on this, this specification proposes a technical solution for digitally signing and encrypting and decrypting control instructions on a security service platform using a public-private key pair corresponding to a target application, thereby ensuring the integrity and confidentiality of control instructions during transmission.
[0061] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0062] Figure 1 This is a flow chart of a data transmission method shown in an exemplary embodiment, and the method specifically includes the following steps:
[0063] S100: Obtain a control instruction sent to the vehicle terminal by a target application in at least one application.
[0064] S102: In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally sign the control instruction to obtain the digital signature of the control instruction, and encrypt the control instruction to obtain the encrypted control instruction.
[0065] S104: Write the digital signature of the control instruction and the encrypted control instruction into the message queue, so that the vehicle terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application to obtain the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
[0066] In actual applications, the data transmission methods between vehicles and cloud servers are mostly of low confidentiality. In the process of cloud servers sending control instructions to vehicles, there is a high possibility of data leakage, data tampering and other security risks. As a result, the vehicle may receive incorrect control instructions, which in turn endangers the safety of the vehicle and passengers.
[0067] In the embodiment of the present specification, the security service platform may obtain a control instruction sent to the vehicle terminal by a target application in at least one application.
[0068] In response to the acquired control instruction, the security service platform can perform digital signature processing on the control instruction based on the private key corresponding to the target application, obtain the digital signature of the control instruction, and encrypt the control instruction to obtain the encrypted control instruction. Among them, the security service platform maintains the public and private key pairs of each application.
[0069] Then, the security service platform can write the digital signature of the control instruction and the encrypted control instruction into the message queue, so that the vehicle terminal can obtain the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypt the encrypted control instruction based on the public key corresponding to the target application, obtain the control instruction, and verify the digital signature of the control instruction, and further execute the control instruction after the digital signature verification is passed.
[0070] As can be seen from the above embodiments, the control instructions are digitally signed and encrypted and decrypted on the security service platform using the public and private key pairs corresponding to the target application, thereby ensuring the integrity and confidentiality of the control instructions during transmission.
[0071] In actual applications, when the vehicle uploads service data to the cloud server, there may be a security risk that the service data may be tampered with, resulting in the cloud server receiving data that is no longer original and authentic. Furthermore, after receiving the tampered service data, the cloud server may issue an erroneous control instruction. As a result, the normal operation of the vehicle is disrupted, which in turn endangers the safety of the vehicle and passengers.
[0072] In the embodiment of this specification, the security service platform can obtain the service data and the first hash value sent by the target application in at least one application written into the message queue by the vehicle terminal. The first hash value mentioned here is obtained by the vehicle terminal performing hash calculation on the service data based on a preset hash algorithm.
[0073] Then, the security service platform can perform hash calculation on the service data based on the hash algorithm to obtain a second hash value.
[0074] Next, the security service platform may verify whether the first hash value and the second hash value are the same.
[0075] If so, the security service platform can analyze the service data to obtain analysis results, so that the target application can send control instructions to the vehicle terminal based on the analysis results.
[0076] It can be seen from the above embodiments that the service data is digitally signed using a preset hash algorithm on the security service platform, thereby ensuring the integrity of the service data during transmission.
[0077] Furthermore, the vehicle terminal can also encrypt the service data based on the public key corresponding to the target application to obtain the encrypted service data, and write the encrypted service data into the message queue. The security service platform can obtain the encrypted service data written into the message queue by the vehicle terminal, and decrypt the encrypted service data based on the public key corresponding to the target application to obtain the service data. Thus, the confidentiality of the service data during transmission is guaranteed.
[0078] In actual applications, most security service platforms adopt the traditional monolithic architecture. However, the traditional monolithic architecture applications are large and bloated, highly coupled, inflexible, and difficult to reuse, which leads to many problems such as long R&D cycle, high R&D cost, and difficulty in quickly responding to user needs.
[0079] In the embodiments of this specification, the security service platform may be a service platform using a microservice architecture. The security service platform deploys at least one application. The application is a distributed application in which at least some services are deployed on different service devices on the service platform. In other words, the service platform using a microservice architecture may split the application into many microservices, and each microservice runs the application together to realize specific application functions.
[0080] Furthermore, the security service platform can dynamically increase or decrease the number of service instances according to real-time service demand and load conditions to expand or reduce the processing capacity of the application. For example, during peak hours when user traffic surges, the number of service instances of the microservice with the surge in traffic can be increased to cope with traffic pressure and ensure service stability and response speed.
[0081] It can be seen that the security service platform using microservice architecture not only improves the efficiency of development and deployment, reduces maintenance costs, but also improves reliability.
[0082] Since most security service platforms adopt the traditional monolithic architecture, the security service platform and the vehicle terminal usually communicate data through the HTTP protocol. However, the HTTP protocol itself does not support asynchronous communication mechanism and cannot handle more concurrent operations, and is not suitable for security service platforms that adopt a microservice structure.
[0083] Therefore, the security service platform and the vehicle terminal can communicate data based on the message queue protocol, thereby providing asynchronous processing capabilities for data transmission and handling more concurrent operations.
[0084] It should be noted that the message queue protocol may include: MQTT protocol, Kafka protocol, etc. This specification does not limit the message queue protocol.
[0085] In actual applications, in order to ensure the integrity and authenticity of data during data transmission, each application usually needs to invest additional resources to develop its own data integrity verification method. However, this approach has high development costs and low development efficiency.
[0086] In the embodiment of the present specification, the security service platform maintains an association relationship between at least one application and the interface calling permission of at least one interface corresponding to the application.
[0087] The security service platform may receive an interface call request sent by a target application and determine at least one interface required by the target application.
[0088] Then, the security service platform can query the association relationship between at least one application and the interface calling permission of at least one interface corresponding thereto, and determine the interface calling permission of at least one interface corresponding to the target application based on the application name of the target application.
[0089] Determine whether the target application has the interface call authority for the signature interface and the encryption interface. If so, call the signature interface, perform digital signature processing on the control instruction based on the private key corresponding to the target application, and obtain the digital signature of the control instruction; and call the encryption interface, perform encryption processing on the control instruction based on the private key corresponding to the target application, and obtain the encrypted control instruction. Figure 2 shown.
[0090] Figure 2 It is a schematic diagram of data transmission shown in an exemplary embodiment.
[0091] exist Figure 2 In the process, the vehicle terminal writes the service data of application A and the first hash value corresponding to application A into the message queue.
[0092] Then, the security service platform obtains the service data of application A and the first hash value corresponding to application A from the message queue, and performs hash calculation on the service data of application A based on the hash algorithm to obtain the second hash value corresponding to application A. It is checked whether the first hash value corresponding to application A is the same as the second hash value.
[0093] If yes, the service data of application A is analyzed to obtain the analysis result of application A.
[0094] Next, based on the analysis results of application A, application A generates a control instruction corresponding to application A, calls the signature interface, performs digital signature processing on the control instruction corresponding to application A based on the private key corresponding to application A, and obtains the digital signature of the control instruction corresponding to application A, and calls the encryption interface, performs encryption processing on the control instruction corresponding to application A based on the private key corresponding to application A, and obtains the encrypted control instruction corresponding to application A, and sends the encrypted control instruction corresponding to application A to the vehicle-mounted terminal.
[0095] Finally, the vehicle terminal obtains the digital signature of the control instruction corresponding to application A and the encrypted control instruction corresponding to application A from the message queue, decrypts the encrypted control instruction corresponding to application A based on the public key corresponding to application A, obtains the control instruction corresponding to application A, verifies the digital signature of the control instruction corresponding to application A, and further executes the control instruction corresponding to application A after the digital signature verification is passed.
[0096] It can be seen from the above embodiments that when an application sends a control instruction to a vehicle terminal, it can call the interface on the security service platform to perform encryption, generate signatures, etc., without the need for each application to repeatedly develop these functions. In addition, the security service platform centrally manages the interface permissions of each application, simplifies the complexity of permission control, and facilitates maintenance and monitoring. It can also effectively prevent unauthorized access through precise permission verification, thereby significantly reducing security risks.
[0097] It should be noted that the interface also includes: public key acquisition interface, signature verification interface, etc. This specification does not limit the type of interface.
[0098] In the embodiments of this specification, each application can also be deployed in a telematics service provider (TSP). The telematics service provider can maintain an association relationship between at least one application and the interface call permissions of at least one interface corresponding to it. When the telematics service provider sends a control instruction to the vehicle terminal, it is necessary to call the signature interface, signature verification interface, encryption interface, decryption interface and other interfaces to the security service platform to ensure the integrity and authenticity of the control instructions during data transmission. In addition, the public and private key pairs of each application can be encrypted and stored in the Nacos configuration center. After the application is started, the security service platform obtains the public and private key pairs of the application from the Nacos configuration center.
[0099] If the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the signed interface, it receives the signed interface calling request for the target application sent by the Internet of Vehicles service provider, and digitally signs the control instruction based on the maintained private key corresponding to the target application to obtain the digital signature of the control instruction.
[0100] If the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface call permission of the encrypted interface, it receives the encrypted interface call request for the target application sent by the Internet of Vehicles service provider, and encrypts the control instruction based on the private key corresponding to the target application to obtain the encrypted control instruction. Figure 3 shown.
[0101] Figure 3 It is a schematic diagram showing another data transmission according to an exemplary embodiment.
[0102] exist Figure 3 In the process, the vehicle terminal writes the service data of application A and the first hash value corresponding to application A into the message queue.
[0103] Then, the Internet of Vehicles service provider obtains the service data of application A and the first hash value corresponding to application A from the message queue, and performs hash calculation on the service data of application A based on the hash algorithm to obtain the second hash value corresponding to application A. It is checked whether the first hash value corresponding to application A is the same as the second hash value.
[0104] If yes, the service data of application A is analyzed to obtain the analysis result of application A.
[0105] Next, the Internet of Vehicles service provider generates a control instruction corresponding to application A based on the analysis result of application A.
[0106] Then, the Internet of Vehicles service provider sends a signature interface call request for the target application to the security service platform, and calls the signature interface from the security service platform. The security service platform performs digital signature processing on the control instruction corresponding to application A based on the private key corresponding to application A obtained from the Nacos configuration center, and obtains the digital signature of the control instruction corresponding to application A.
[0107] In addition, the Internet of Vehicles service provider sends an encrypted interface call request for the target application to the security service platform, calls the encrypted interface from the security service platform, and the security service platform encrypts the control instructions corresponding to application A based on the private key corresponding to application A obtained from the Nacos configuration center, obtains the encrypted control instructions corresponding to application A, and sends the encrypted control instructions corresponding to application A to the vehicle terminal.
[0108] Finally, the vehicle terminal obtains the digital signature of the control instruction corresponding to application A and the encrypted control instruction corresponding to application A from the message queue, decrypts the encrypted control instruction corresponding to application A based on the public key corresponding to application A, obtains the control instruction corresponding to application A, verifies the digital signature of the control instruction corresponding to application A, and further executes the control instruction corresponding to application A after the digital signature verification is passed.
[0109] In actual applications, during certain events (such as promotions, app updates), the number of users may increase dramatically, causing the number of calls to the corresponding target application call interface to increase significantly in a short period of time. This will cause server resources to be strained, the time required to process each request will increase, and the response time will be slower. In extreme cases, if the server cannot withstand the sudden increase in load, it may cause the system to crash.
[0110] In the embodiment of the present specification, the security service platform can obtain the interface call log of at least one interface.
[0111] Then, the security service platform may collect statistics on the interface call log of at least one interface to determine at least one call parameter.
[0112] Determine whether at least one call parameter is greater than a set parameter threshold, and if so, send an alarm message to the user. The sending of alarm messages to the user mentioned here may include: sending email notifications, SMS notifications, phone notifications, application message notifications, etc. to the user. Furthermore, the security service platform may periodically query whether there is an alarm message, and if so, send the alarm message to the user.
[0113] Among them, the call parameters may include: the number of calls to the interface, the number of calls to the application, the duration of the interface call, etc. For example, the security service platform can count the interface call logs of at least one interface to determine the number of calls to at least one interface. Determine whether the number of calls to at least one interface is greater than the set number. If so, send an alarm message for at least one interface to the user. For another example, the security service platform can count the interface call logs of at least one interface to determine the number of calls to at least one application. Determine whether the number of calls to at least one application is greater than the set number. If so, send an alarm message for at least one application to the user. This specification does not limit the call parameters.
[0114] It should be noted that the security service platform can also collect statistics on interface call logs by hour, day, week, etc., and provide visual statistical results (such as reports, statistical charts, etc.) to provide data support for subsequent interface optimization.
[0115] It can be seen from the above embodiments that by sending warning information to users, users can evaluate risks and formulate corresponding strategies, such as flow control, service degradation or emergency repair.
[0116] In practical applications, vehicle logs are raw data that can record vehicle operation conditions. By consulting vehicle logs, potential safety hazards can be discovered in a timely manner, which can improve the safety awareness of drivers and crew members. The current method of obtaining vehicle logs is usually for R&D personnel to use special diagnostic equipment on site to extract vehicle logs. During the log acquisition process, the vehicle must be started. However, this type of equipment is expensive, and the manual process of obtaining vehicle logs is cumbersome, which increases manpower and equipment costs, and also reduces the speed of obtaining vehicle logs.
[0117] In the embodiment of the present specification, the security service platform can obtain the operation log and fault log corresponding to the vehicle written into the message queue by the vehicle terminal.
[0118] Then, the security service platform can analyze the operation log and the fault log, obtain the analysis results, and display the analysis results to the user. The log file in the target vehicle can refer to the file that records the vehicle's operating time, mileage, driver information, maintenance records, repair records, etc.
[0119] As can be seen from the above embodiments, by establishing data communication with the security service platform, the log file is sent to the security service platform, so that the security service platform obtains the log file in the target vehicle, thereby realizing remote and rapid acquisition of vehicle logs, reducing manpower and equipment costs. In addition, remote and secure transmission of vehicle logs is realized.
[0120] In the embodiments of this specification, during the data transmission process, software defects, hardware failures or configuration errors may cause the system to generate or record abnormal data.
[0121] The security service platform can perform anomaly detection on the service data according to the preset security rules, determine whether there is abnormal data in the service data, and if so, send an alarm message to the user. The security rules mentioned here can refer to whether the service data conforms to the predetermined format and type.
[0122] It can be seen from the above embodiments that by implementing the anomaly detection mechanism, the system can promptly detect these abnormal data, trigger the alarm process, and notify relevant personnel to conduct inspection and processing, thereby reducing potential risks and ensuring the stability of the system and the accuracy of the data.
[0123] In actual applications, the ECU in the vehicle may be illegally replaced. For example, during vehicle maintenance, if the original ECU is damaged, some repair shops may use a non-original or illegal ECU as a replacement. For another example, in order to improve vehicle performance, the ECU may be illegally replaced or flashed to adjust parameters such as intake, fuel injection, and ignition in order to achieve the purpose of improving power. This may cause various problems in the vehicle, such as unstable performance, fault lights on, engine problems, etc., and in serious cases may even affect driving safety.
[0124] In the embodiment of the present specification, the security service platform may receive an interface call request sent by at least one ECU in the vehicle.
[0125] Then, the security service platform can call the signature interface, perform digital signature processing on the ECU identifier of the ECU based on the maintained private key corresponding to the target application, and obtain the digital signature of the ECU.
[0126] Next, the security service platform can send the digital signature of the ECU and the public key corresponding to the target application to the ECU, so that when the vehicle is started, the ECU verifies the digital signature of the ECU based on the public key corresponding to the target application, and completes the startup of the vehicle after the digital signature verification is passed.
[0127] It can be seen from the above embodiments that by introducing a digital signature verification mechanism during the vehicle startup process, the security of vehicle startup is ensured.
[0128] It can be seen from the above method that the control instructions are digitally signed and encrypted and decrypted on the security service platform through the public and private key pairs corresponding to the target application, thereby ensuring the integrity and confidentiality of the control instructions during transmission.
[0129] Furthermore, when an application sends a control command to the vehicle terminal, it can call the interface on the security service platform to perform encryption, generate signatures, etc., without the need for each application to repeatedly develop these functions. In addition, the security service platform centrally manages the interface permissions of each application, simplifies the complexity of permission control, and facilitates maintenance and monitoring. It can also effectively prevent unauthorized access through precise permission verification, thereby significantly reducing security risks.
[0130] Corresponding to the above-mentioned embodiment of the method for data transmission, this specification also provides an embodiment of a device for data transmission.
[0131] See also Figure 4 , Figure 4 It is a structural diagram of an electronic device in which a data transmission device is located, which is shown in an exemplary embodiment. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and of course may also include other required hardware. One or more embodiments of this specification can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0132] See also Figure 5 , Figure 5 FIG. 1 is a structural diagram of a data transmission device according to an exemplary embodiment. The data transmission device can be applied to Figure 4 In the electronic device shown in the figure, the technical solution of this specification is implemented. The device may include:
[0133] An acquisition module 500 is used to acquire a control instruction sent to the vehicle terminal by a target application in at least one application;
[0134] The response module 502 is used to respond to the acquired control instruction, perform digital signature processing on the control instruction based on the maintained private key corresponding to the target application to obtain the digital signature of the control instruction, and perform encryption processing on the control instruction to obtain the encrypted control instruction;
[0135] The execution module 504 is used to write the digital signature of the control instruction and the encrypted control instruction into the message queue, so that the vehicle-mounted terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application to obtain the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
[0136] Optionally, the acquisition module 500 is further specifically used to obtain service data corresponding to a target application in the at least one application written into the message queue by the vehicle terminal and a first hash value, wherein the first hash value is obtained by the vehicle terminal performing hash calculation on the service data based on a preset hash algorithm; performing hash calculation on the service data based on the hash algorithm to obtain a second hash value; verifying whether the first hash value and the second hash value are the same; if so, analyzing the service data to obtain an analysis result, so that the target application sends a control instruction to the vehicle terminal based on the analysis result.
[0137] Optionally, the security service platform deploys at least one application; the security service platform maintains an association relationship between at least one application and the interface call permission of at least one interface corresponding to it; the response module 502 is further specifically used to receive an interface call request sent by the target application, and determine at least one interface required by the target application; query the association relationship between at least one application and the interface call permission of at least one interface corresponding to it, and determine the interface call permission of at least one interface corresponding to the target application based on the application name of the target application; determine whether the target application has interface call permissions for the signature interface and the encryption interface, and if so, call the signature interface, digitally sign the control instruction based on the maintained private key corresponding to the target application, and obtain the digital signature of the control instruction, and call the encryption interface, encrypt the control instruction based on the maintained private key corresponding to the target application, and obtain the encrypted control instruction.
[0138] Optionally, the Internet of Vehicles service provider has deployed at least one application; the Internet of Vehicles service provider maintains an association relationship between at least one application and the interface calling authority of at least one interface corresponding to the application; the response module 502 is further specifically used to receive a signed interface calling request for the target application sent by the Internet of Vehicles service provider if the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the signed interface, and based on the maintained private key corresponding to the target application, perform digital signature processing on the control instruction to obtain the digital signature of the control instruction; if the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the encrypted interface, receive an encrypted interface calling request for the target application sent by the Internet of Vehicles service provider, and based on the maintained private key corresponding to the target application, perform encryption processing on the control instruction to obtain the encrypted control instruction.
[0139] Optionally, the execution module 504 is further specifically used to obtain the interface call log of at least one interface; to perform statistics on the interface call log of the at least one interface to determine at least one call parameter; to determine whether at least one call parameter is greater than a set parameter threshold, and if so, to send an alarm message to the user.
[0140] Optionally, the execution module 504 is further specifically used to obtain the operation log and fault log corresponding to the vehicle written into the message queue by the vehicle-mounted terminal; analyze the operation log and the fault log to obtain analysis results, and display the analysis results to the user.
[0141] Optionally, the execution module 504 is further configured to perform anomaly detection on the service data according to preset security rules, determine whether there is abnormal data in the service data, and if so, send an alarm message to the user.
[0142] Optionally, the execution module 504 is further specifically used to receive an interface call request sent by at least one electronic controller ECU in the vehicle; call the signature interface, and based on the maintained private key corresponding to the target application, perform digital signature processing on the ECU identifier of the ECU to obtain the digital signature of the ECU; send the digital signature of the ECU and the public key corresponding to the target application to the ECU, so that the ECU verifies the digital signature of the ECU based on the public key corresponding to the target application when the vehicle is started, and completes the startup of the vehicle after the digital signature verification is passed.
[0143] Optionally, the security service platform is a service platform adopting a microservice architecture; the application is a distributed application in which at least part of the services are deployed on different service devices on the service platform.
[0144] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0145] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.
[0146] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0147] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.
[0148] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0149] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A method for data transmission, characterized in that: The method is applied to a security service platform; the method comprises: Obtaining a control instruction sent to the vehicle terminal by a target application in at least one application; In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally sign the control instruction to obtain the digital signature of the control instruction, and encrypt the control instruction to obtain the encrypted control instruction; The digital signature of the control instruction and the encrypted control instruction are written into a message queue, so that the vehicle-mounted terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application to obtain the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
2. The method according to claim 1, characterized in that Before obtaining the control instruction issued to the vehicle-mounted terminal by the target application in the at least one application, the method further includes: Acquire service data corresponding to a target application in the at least one application and a first hash value written by the vehicle terminal into the message queue, where the first hash value is obtained by performing a hash calculation on the service data by the vehicle terminal based on a preset hash algorithm; Performing hash calculation on the service data based on the hash algorithm to obtain a second hash value; Verifying whether the first Hash value and the second Hash value are the same; If yes, the service data is analyzed to obtain an analysis result, so that the target application sends a control instruction to the vehicle-mounted terminal based on the analysis result.
3. The method according to claim 1, characterized in that The security service platform deploys at least one application; the security service platform maintains an association relationship between the at least one application and the interface call permission of at least one interface corresponding to the application; In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally signing the control instruction to obtain the digital signature of the control instruction, and encrypting the control instruction to obtain the encrypted control instruction, the method further includes: receiving an interface call request sent by the target application, and determining at least one interface required by the target application; Querying an association relationship between at least one application and the interface calling permission of at least one interface corresponding to the target application, and determining the interface calling permission of at least one interface corresponding to the target application based on the application name of the target application; In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally signing the control instruction to obtain the digital signature of the control instruction, and encrypting the control instruction to obtain the encrypted control instruction, including: Determine whether the target application has interface calling authority for the signature interface and the encryption interface; if so, call the signature interface, perform digital signature processing on the control instruction based on the maintained private key corresponding to the target application, and obtain the digital signature of the control instruction; and call the encryption interface, perform encryption processing on the control instruction based on the maintained private key corresponding to the target application, and obtain the encrypted control instruction.
4. The method according to claim 1, characterized in that The Internet of Vehicles service provider deploys at least one application; the Internet of Vehicles service provider maintains an association relationship between the at least one application and the interface call permission of at least one interface corresponding to the at least one application; In response to the acquired control instruction, based on the maintained private key corresponding to the target application, digitally signing the control instruction to obtain the digital signature of the control instruction, and encrypting the control instruction to obtain the encrypted control instruction, including: If the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the signed interface, receiving the signed interface calling request for the target application sent by the Internet of Vehicles service provider, and performing digital signature processing on the control instruction based on the maintained private key corresponding to the target application to obtain the digital signature of the control instruction; If the Internet of Vehicles service provider queries the association relationship to determine that the target application has the interface calling authority of the encrypted interface, an encrypted interface calling request for the target application sent by the Internet of Vehicles service provider is received, and based on the maintained private key corresponding to the target application, the control instruction is encrypted to obtain the encrypted control instruction.
5. The method according to claim 1, characterized in that The method further comprises: Obtain the interface call log of at least one interface; Collecting statistics on the interface call log of the at least one interface to determine at least one call parameter; Determine whether at least one call parameter is greater than a set parameter threshold, and if so, send an alarm message to the user.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining the operation log and the fault log corresponding to the vehicle written into the message queue by the vehicle terminal; The operation log and the fault log are analyzed to obtain analysis results, and the analysis results are displayed to the user.
7. The method according to claim 1, characterized in that The method further comprises: According to the preset security rules, the service data is detected for abnormalities to determine whether there is abnormal data in the service data. If so, an alarm message is sent to the user.
8. The method according to claim 1, characterized in that The method further comprises: Receiving an interface call request sent by at least one electronic controller ECU in the vehicle; Calling a signature interface, performing digital signature processing on the ECU identifier of the ECU based on the maintained private key corresponding to the target application, and obtaining a digital signature of the ECU; The digital signature of the ECU and the public key corresponding to the target application are sent to the ECU, so that when the vehicle is started, the ECU verifies the digital signature of the ECU based on the public key corresponding to the target application, and completes the startup of the vehicle after the digital signature is verified.
9. The method according to claim 1, characterized in that The security service platform is a service platform that adopts a microservice architecture; the application is a distributed application in which at least part of the services are deployed on different service devices on the service platform.
10. A data transmission device, characterized in that: The device is applied to a security service platform; the device comprises: An acquisition module, used to acquire a control instruction sent to the vehicle terminal by a target application in at least one application; a response module, configured to respond to the acquired control instruction, perform digital signature processing on the control instruction based on the maintained private key corresponding to the target application to obtain the digital signature of the control instruction, and perform encryption processing on the control instruction to obtain the encrypted control instruction; An execution module is used to write the digital signature of the control instruction and the encrypted control instruction into a message queue, so that the vehicle-mounted terminal obtains the digital signature of the control instruction and the encrypted control instruction from the message queue, decrypts the encrypted control instruction based on the public key corresponding to the target application to obtain the control instruction, verifies the digital signature of the control instruction, and further executes the control instruction after the digital signature verification is passed.
11. An electronic device, characterized in that: It includes a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 9 by calling the machine-readable instructions.
12. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the method according to any one of claims 1 to 9 is implemented.