Gateway-based vehicle-mounted fragrance control method and system

CN118107349BActive Publication Date: 2026-09-22SHANGHAI BOQI INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410026542.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2026-09-22
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

[0006]针对现有技术中存在的车载香氛系统安全性差的问题,本申请提供了一种基于网关的车载香氛控制方法及系统,通过车载网关与中控的双重验证机制,确保了香氛模块的访问授权,提高了车载香氛控制的安全性

Benefits of technology

[0020]相比于现有技术,本申请的优点在于:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118107349B_ABST
    Figure CN118107349B_ABST
Patent Text Reader

Abstract

The application discloses a gateway-based vehicle-mounted fragrance control method and system, relates to the technical field of Internet of Vehicles, and comprises the following steps: an authentication circuit is arranged in a fragrance module and used for storing an authentication key; after the fragrance module establishes a communication connection with a vehicle-mounted gateway, an authentication request sent by the vehicle-mounted gateway is received, verification is performed according to the stored authentication key, and an authentication result is returned to the vehicle-mounted gateway; the fragrance module receives a control instruction encrypted by the vehicle-mounted gateway using a preset key; the fragrance module decrypts the received control instruction using the preset key, and executes the decrypted control instruction; wherein the control instruction is obtained in the following manner: after receiving a response of authentication passing sent by the fragrance module, the vehicle-mounted gateway sends a request for obtaining a control instruction to a vehicle-mounted central controller, and receives a control instruction returned by the vehicle-mounted central controller. In view of the poor safety of the vehicle-mounted fragrance system in the prior art, the double-verification mechanism of the vehicle-mounted gateway and the central controller is used, so that the safety of vehicle-mounted fragrance control is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle networking technology, and in particular to a gateway-based in-vehicle fragrance control method and system. Background Technology

[0002] With the continuous development of automotive electronics and intelligence, various in-vehicle electronic modules and control systems are rapidly increasing. At the same time, hacker attacks targeting automotive electronic systems are also on the rise, leading to serious cybersecurity vulnerabilities in in-vehicle systems.

[0003] In various in-vehicle electronic systems, ambient scent systems with fragrance release functions have become standard equipment in many high-end cars because they directly affect in-vehicle air quality and passenger comfort. However, existing fragrance control systems generally use a simple wired series connection structure, and the access authorization verification of fragrance modules is not strict. This allows attackers to send illegal control commands to fragrance modules by impersonating them or cracking communication protocols, leading to security vulnerabilities.

[0004] In related technologies, such as Chinese patent document CN112202665A, a vehicle-mounted security gateway is provided, including a first processor module, a second processor module, a first communication module, and a second communication module. The first communication module includes a standard Ethernet module and a first vehicle-mounted Ethernet module, and the second communication module includes a second vehicle-mounted Ethernet module and a CAN module. The first processor module communicates with in-vehicle devices and / or external devices through the first communication module; the second processor module communicates with in-vehicle devices and / or external devices through the second communication module. The first processor module is also connected to the second processor module and a security module to achieve encrypted communication between the first or second processor module and in-vehicle or external devices. However, this solution mainly uses dual processors and dual network interfaces to achieve isolation of in-vehicle communication, allowing any unauthorized module to access the in-vehicle network and send control commands, endangering vehicle safety. Summary of the Invention

[0005] 1. Technical problems to be solved

[0006] To address the issue of poor security in existing in-vehicle fragrance systems, this application provides a gateway-based in-vehicle fragrance control method and system. Through a dual verification mechanism of the in-vehicle gateway and the central control unit, access authorization for the fragrance module is ensured, thereby improving the security of in-vehicle fragrance control.

[0007] 2. Technical Solution

[0008] The purpose of this application is achieved through the following technical solution.

[0009] One aspect of this specification provides a gateway-based in-vehicle fragrance control method, comprising: setting an authentication circuit in a fragrance module for storing authentication keys; after establishing a communication connection between the fragrance module and an in-vehicle gateway, receiving an authentication request sent by the in-vehicle gateway, verifying the authentication based on the stored authentication key, and returning an authentication result to the in-vehicle gateway; the fragrance module receiving a control command encrypted by the in-vehicle gateway using a preset key; the fragrance module decrypting the received control command using the preset key and executing the decrypted control command; wherein, the control command is a request sent by the in-vehicle gateway to obtain a control command after receiving an authentication pass response from the fragrance module, and receiving a control command returned by the in-vehicle central control.

[0010] Furthermore, after the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway also performs the following steps: obtaining the system time of the vehicle gateway as the gateway timestamp, and obtaining the gateway ID of the vehicle gateway; using the obtained gateway timestamp and gateway ID as data to be signed; using the RSA algorithm to sign the data to be signed, and generating a signature value as the first signature value.

[0011] Furthermore, after the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway also performs the following steps: parsing the first signature value to obtain the digital signature algorithm identifier; obtaining the gateway timestamp and gateway ID from the data to be signed; concatenating the obtained digital signature algorithm identifier, gateway timestamp, and gateway ID to generate a reconstructed string; and generating a hash value using SHA-256 hash operation based on the generated reconstructed string, which serves as the first hash digest.

[0012] Furthermore, after the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway performs the following steps: constructing a JSON-formatted message data structure, which includes a message header and a message body; encapsulating the first signature value into the signature value field in the message body; encapsulating the data to be signed into the raw data field in the message body; encapsulating the first hash digest into the hash value field in the message body; generating a JSON-formatted message string containing a message header and a message body according to the JSON algorithm, as the first digital signature; and sending an authentication request containing the first digital signature to the fragrance module for verification.

[0013] Furthermore, the fragrance module receives the authentication request sent by the vehicle gateway and verifies it according to the stored authentication key. The fragrance module also performs the following steps: receiving the first digital signature and retrieving the vehicle gateway digital certificate from the stored authentication key according to the gateway ID; parsing the digital certificate content according to the certificate format to obtain the public key data; performing RSA decryption calculation on the first signature value according to the extracted public key data to obtain the decrypted plaintext; performing SHA-256 hash operation on the data to be signed in the first digital signature to generate a second hash digest; comparing the decrypted plaintext and the second hash digest using a string matching function; when the decrypted plaintext and the second hash digest match, comparing the first hash digest and the second hash digest bit by bit using a hash value comparison function; when all bits of the first hash digest and the second hash digest are completely identical, outputting verification success; otherwise, outputting verification failure.

[0014] Furthermore, the control command involves the vehicle gateway receiving an authentication pass response from the fragrance module, then sending a request to the vehicle central control unit to obtain a control command, and receiving the control command returned by the vehicle central control unit. The vehicle gateway also performs the following steps: receiving the authentication response message from the fragrance module, which contains an authentication status field; parsing the authentication response message using a message parsing function to extract the authentication status field; encoding the extracted authentication status field using an encoding conversion function to obtain a status identifier code; calculating the CRC checksum of the status identifier code using a CRC-16 check function; and comparing the calculated CRC checksum with the stored CRC checksums sequentially. If identical checksums are found, the comparison is considered successful.

[0015] Furthermore, after the comparison is successful, the vehicle gateway performs the following steps: generating a control command request message containing the fragrance module ID and authentication status fields; and sending the control command request message to the vehicle central control unit via the CAN bus.

[0016] Furthermore, upon receiving the control command request message, the vehicle central control unit performs the following steps: Based on the fragrance module ID, it queries the preset fragrance module ID-public key mapping table to retrieve the RSA public key corresponding to the fragrance module ID; it uses the retrieved RSA public key to perform RSA digital signature verification on the authentication status field in the control command request message; if the verification passes, it obtains the control parameter information corresponding to the fragrance module ID from the preset database; based on the control parameter information, it generates a control command and sends the generated control command to the vehicle gateway.

[0017] Furthermore, before generating control commands, the vehicle gateway performs the following steps: it performs format verification on the acquired control parameter information, including data length and value range; when both data length and value range are within the preset range, the format verification passes; only after the format verification passes does it generate control commands based on the control parameter information.

[0018] Another aspect of the embodiments of this specification also provides a system for a gateway-based in-vehicle fragrance control method based on this application.

[0019] 3. Beneficial effects

[0020] Compared to existing technologies, the advantages of this application are:

[0021] (1) By setting up an authentication circuit in the fragrance module, using an authentication key for verification, and protecting authentication requests and control commands through digital signatures and hash algorithms, the overall technical solution achieves a dual authentication mechanism. This effectively improves the security of the in-vehicle fragrance system, ensuring that only rigorously verified devices can communicate and control the system, preventing unauthorized access and potential security threats;

[0022] (2) Through digital signatures and hash algorithms, the system can verify the integrity of data transmitted from the vehicle gateway to the fragrance module. Even if the data is tampered with during transmission, it can be detected. This helps prevent malicious attacks and information tampering, ensures the accurate execution of control commands, and improves the stability and reliability of the entire vehicle fragrance system;

[0023] (3) By obtaining the system time and ID from the vehicle gateway, generating a digital signature for verification, and performing digital signature verification at the central control terminal, the entire system establishes a real-time control command verification and response mechanism. This helps ensure the timeliness and legality of control commands, improves the real-time control capability of the vehicle fragrance system, and makes the system more flexible and responsive.

[0024] In summary, the dual verification mechanism of the vehicle gateway and the central control unit ensures access authorization for the fragrance module and improves the security of vehicle fragrance control. Attached Figure Description

[0025] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein:

[0026] Figure 1 This is an exemplary flowchart illustrating a gateway-based in-vehicle fragrance control method according to some embodiments of this specification;

[0027] Figure 2 This is an exemplary flowchart of fragrance module certification according to some embodiments of this specification;

[0028] Figure 3 This is an exemplary flowchart illustrating the generation of control instruction request messages according to some embodiments of this specification;

[0029] Figure 4 This is an exemplary flowchart illustrating the generation of control instructions according to some embodiments of this specification. Detailed Implementation

[0030] The methods and systems provided in the embodiments of this specification will now be described in detail with reference to the accompanying drawings.

[0031] Figure 1 This is an exemplary flowchart illustrating a gateway-based in-vehicle fragrance control method according to some embodiments of this specification, such as... Figure 1 As shown, one aspect of the embodiments of this specification provides a gateway-based in-vehicle fragrance control method, comprising: setting an authentication circuit in a fragrance module for storing authentication keys; after establishing a communication connection between the fragrance module and an in-vehicle gateway, receiving an authentication request sent by the in-vehicle gateway, verifying the authentication based on the stored authentication key, and returning an authentication result to the in-vehicle gateway; the fragrance module receiving a control command encrypted by the in-vehicle gateway using a preset key; the fragrance module decrypting the received control command using the preset key and executing the decrypted control command; wherein, the control command is a request sent by the in-vehicle gateway to the in-vehicle central control unit to obtain a control command after receiving an authentication pass response sent by the fragrance module, and receiving a control command returned by the in-vehicle central control unit.

[0032] The authentication circuit refers to the circuit module that implements the identity authentication function. It can be implemented using hardware circuitry or software code. It mainly includes two functions: storing the authentication key and processing the authentication information. In this application, the authentication circuit is located inside the fragrance module to store the authentication key. The authentication key can be a preset symmetric key or a private key from an asymmetric key. After establishing a connection with the gateway, the fragrance module verifies the authentication request sent by the gateway based on the key in the authentication circuit. If the authentication request passes verification, it indicates that the request comes from a legitimate vehicle gateway. Thus, with the support of the authentication circuit, the first layer of verification for access authorization of the fragrance module in the technical solution is achieved.

[0033] The fragrance module refers to an electronic module that enables in-vehicle odor regulation. It includes a fragrance spray device, a fragrance control circuit, and a communication interface. It releases the corresponding fragrance according to control commands. In this application, the fragrance module establishes a communication connection with the vehicle gateway and is responsible for communicating with the gateway. It receives authentication request messages sent by the gateway, which is the first layer of the entire dual authentication process. It verifies the request based on its stored authentication key to determine whether the request comes from a legitimate gateway. If the verification is successful, it returns an authentication response to the gateway. This completes the mutual authentication with the gateway, achieving the first layer of verification communication in the technical solution.

[0034] In this context, the vehicle central control unit (NCU) refers to the core controller in a vehicle responsible for processing information from various electronic modules and sending control commands to the corresponding modules. It connects to a display screen, CAN bus, etc., and can receive information from different modules and send control commands. The vehicle gateway is a gateway module that acts as a data relay in the vehicle network system. It connects two or more vehicle network subsystems, responsible for transmitting information and performing protocol conversion. In this application, the NCU receives a control command acquisition request from the gateway. Based on the dual verification results, it sends a secure and reliable control command to the gateway. As a second verification step, it ensures that the command is sent to a legitimate fragrance module. The vehicle gateway sends an authentication request to the fragrance module, completing the first verification step. It receives control commands from the NCU and sends them to the fragrance module. As a relay gateway connecting the fragrance module and the NCU, it constructs a dual verification mechanism.

[0035] Specifically, an authentication circuit is set up in the fragrance module to store authentication keys. The purpose is to pre-configure keys for identity authentication within the fragrance module. This authentication circuit can be implemented using hardware or software code. The circuit primarily handles the secure storage of keys and authentication calculations. Its main purpose is to perform the authentication process, ensuring that only authorized devices can communicate with the fragrance module. The authentication circuit may include a series of electronic components and algorithms for processing authentication requests and verification. In addition to handling the authentication process, the authentication circuit in the fragrance module also includes the function of storing authentication keys. The authentication key is a security parameter used to verify the identity of the vehicle gateway during the authentication process. The authentication key stored in the authentication circuit is pre-configured, typically set by the system administrator or manufacturer. The authentication key stored in the authentication circuit is used to verify the legitimacy of establishing a communication connection with the vehicle gateway. Only when the authentication keys match will the fragrance module confirm the identity of the vehicle gateway, thus allowing subsequent communication and control operations. This step is to ensure system security and prevent unauthorized access.

[0036] Specifically, once the fragrance module and the vehicle gateway establish a communication connection, they can exchange data and control commands. This connection can be a physical connection, such as via cable or wireless. After establishing the connection, the vehicle gateway sends an authentication request to the fragrance module. This request may contain information about the vehicle's identity, communication parameters, and other necessary details to ensure that only authorized fragrance modules can communicate with the vehicle system. Upon receiving the authentication request from the vehicle gateway, the fragrance module uses an authentication key stored internally for verification. This authentication key is a pre-configured security parameter used to ensure that only legitimate vehicle gateways can communicate with the fragrance module. The fragrance module verifies the received authentication request based on the authentication key. The verification result may be successful or failed. If authentication is successful, it indicates that the vehicle gateway is legitimate, allowing subsequent operations. If authentication fails, it indicates an anomaly, and communication may be terminated or other security measures may be taken. Verification using the authentication key ensures the security of the communication connection. This verification mechanism helps prevent unauthorized devices from accessing the vehicle system, improving the overall system's resistance to attacks.

[0037] Specifically, after the vehicle gateway receives the authentication response from the fragrance module, it generates control commands and encrypts them using a preset key. This step helps protect the security of the control commands during transmission, preventing unauthorized access and information leakage. The fragrance module receives the control commands encrypted by the vehicle gateway using the preset key. To decrypt these commands, the fragrance module uses the same preset key. The preset key is a security parameter pre-configured by the system, ensuring that only authorized fragrance modules can correctly decrypt the control commands. After successfully decrypting the control commands, the fragrance module begins to execute them. These commands may involve adjusting, activating, or deactivating the fragrance to meet the user's personalized needs. Encryption and decryption using the preset key ensure the confidentiality and integrity of the commands. The decrypted control commands typically include a request to the vehicle's central control unit (NCU) for more control commands. Upon receiving this request, the NCU generates the corresponding control commands and encrypts them using the same preset key. These encrypted commands are transmitted to the fragrance module, which then decrypts and executes them, completing the entire control process.

[0038] Figure 2 This is an exemplary flowchart of fragrance module authentication according to some embodiments of this specification. After the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway further performs the following steps: obtaining the system time of the vehicle gateway as the gateway timestamp, and obtaining the gateway ID of the vehicle gateway; using the obtained gateway timestamp and gateway ID as data to be signed; using the RSA algorithm to sign the data to be signed, and generating a signature value as the first signature value;

[0039] In this application, the gateway timestamp refers to the time data obtained from the gateway's system time, reflecting the precise time point when the authentication operation was performed. The gateway ID is an identity number or identification code used to uniquely identify a gateway. In this application, the gateway timestamp is obtained to determine the precise time of the authentication request. The timestamp, together with the gateway ID, serves as the data to be signed, preventing replay attacks. The timestamp is also one of the important bases for verifying the signature. The gateway ID uniquely identifies a gateway and is crucial for confirming identity. The ID, together with the timestamp, is used for signing to ensure the identity of the signing object. The fragrance module can also obtain the public key of the corresponding gateway through the ID. In summary, the timestamp and ID are used together in the scheme to construct the signature. Their uniqueness and unforgeability effectively guarantee the reliability of signing and verification, improving the security of authentication.

[0040] RSA is a widely used public-key encryption algorithm that leverages the difficulty of integer factorization to achieve encrypted signing and verification of information. The private key is used to sign or decrypt data, while the public key is used to verify the signature or perform encryption. In this application, the gateway uses the RSA algorithm to generate a signature from a timestamp and ID, which is the first application step. The RSA signature confirms the integrity of the information and the identity of the signer. The fragrance module uses the gateway's public key to verify the signature, achieving identity authentication. The unforgeability of the RSA signature ensures the reliability of the verification. The RSA algorithm supports signing and verification with different key pairs, making it suitable for identity authentication in in-vehicle systems. Compared to symmetric encryption, RSA has stronger resistance to attacks.

[0041] Specifically, once the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway performs steps to obtain its current system time and unique gateway ID. The system time may be used to ensure the timeliness of communication, while the gateway ID is used to uniquely identify the vehicle gateway during communication. The vehicle gateway uses the obtained system time and gateway ID as data to be signed. This data will be used in the subsequent digital signature generation process. The accuracy and integrity of the data to be signed are crucial for the correctness of subsequent verification. The vehicle gateway uses the RSA (Rivest-Shamir-Adleman) algorithm to sign the data to be signed. RSA is an asymmetric encryption algorithm that includes a public key and a private key. Here, the vehicle gateway uses its private key to sign the data to be signed, generating a signature value. This signature value is a numeric string representing a cryptographic digest of the data to be signed. The signature value generated by the RSA algorithm is called the first signature value. This value is a digital signature generated by the vehicle gateway to ensure the integrity and authenticity of the data during communication. The first signature value is an important security measure to prevent information from being tampered with or forged during transmission.

[0042] Specifically, in a specific embodiment of this application, the first signature value is generated using the RSA algorithm: An RSA key pair is set for the gateway: public key (n, e) and private key (n, d). The data to be signed is obtained, assumed to be the string "123456GW1001" combining the timestamp 123456 and the gateway ID "GW1001". The SHA-256 hash function is applied to the data to be signed to obtain the message digest "8563bef8...". An RSA signature operation is then performed on the message digest: sign =

[0043] The algorithm SHA256Hash(“123456GW1001”)^dmod n, where d is the gateway's private key and n is the modulus, calculates the signature value “357ab…”. The algorithm identifier is set to “RSA”. A digital signature structure is constructed: {“Algorithm”:“RSA”,“Signature”:“357ab…”,“Original Data”:“123456GW1001”}; this digital signature is the first signature value, containing the algorithm identifier, signature value, and original data. The first signature value can be combined with other data to form an authentication request message, which is sent to the fragrance module. The fragrance module uses the gateway's RSA public key to verify the signature value and complete the authentication.

[0044] After the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway also performs the following steps: parsing the first signature value to obtain the digital signature algorithm identifier; obtaining the gateway timestamp and gateway ID from the data to be signed; concatenating the obtained digital signature algorithm identifier, gateway timestamp, and gateway ID to generate a reconstructed string; and generating a hash value using SHA-256 hash operation based on the generated reconstructed string, which serves as the first hash digest.

[0045] The digital signature algorithm identifier refers to the identification information indicating the digital signature algorithm used in the signature. It is typically placed at the beginning or in the header field of the signature data structure to identify the algorithm type of the corresponding signature. In this application, the fragrance module parses the signature value and can extract the digital signature algorithm identifier. This identifier indicates the RSA signature algorithm used by the gateway and serves as the basis for subsequent verification. Based on the identifier, the fragrance module can determine whether to use the RSA public key mechanism for verification. If other signature algorithms are used, the identifier also ensures that the fragrance module selects the correct verification method. The introduction of the algorithm identifier improves the flexibility and scalability of signature verification.

[0046] SHA-256 is a typical hash algorithm that can perform one-way hashing on arbitrary data, generating a unique hash value of 256 bits. It possesses collision resistance and information hiding properties. In this application, the reconstructed string is hashed using SHA-256 to generate a first hash digest. The hash value is unique and can be used to represent the "fingerprint" of the reconstructed string. Comparing it with the original hash value in the signature verifies the authenticity of the signature. Even if the original text is very large, it can be quickly verified through hash comparison. SHA-256 has strong resistance to brute-force attacks.

[0047] Specifically, the first signature value is a digital string generated by the vehicle gateway after signing the data to be signed using the RSA algorithm. Parsing the first signature value involves breaking this string down into its components for further processing. This typically involves parsing the binary or other representation of the digital signature to extract its individual elements. During the parsing process, the vehicle gateway locates and extracts the digital signature algorithm identifier. This identifier indicates the encryption algorithm used to generate the digital signature, such as the RSA algorithm. The extraction of this identifier information usually needs to follow a format defined by a protocol or specification. From the data to be signed, the vehicle gateway extracts the gateway timestamp and gateway ID. These two pieces of data are crucial for generating the digital signature during communication. Typically, the data to be signed contains multiple fields, including the gateway timestamp and gateway ID. The vehicle gateway uses the obtained digital signature algorithm identifier, gateway timestamp, and gateway ID to concatenate them into a string, forming a reconstructed string. This string is constructed according to certain rules and formats to ensure the accuracy and consistency of subsequent hash operations. Typically, the concatenation order and format need to follow the definitions of the protocol or specification. Through these two steps, the vehicle gateway successfully obtains key information from the data to be signed—namely, the gateway timestamp and gateway ID—and concatenates them with the digital signature algorithm identifier into a single string. This reconstructed string will be used in subsequent hash calculations to generate a hash value, which will serve as part of the digital signature. This technical approach helps ensure the consistency of data used during signature verification, thereby improving communication security and data integrity.

[0048] Specifically, the vehicle gateway uses the SHA-256 hash algorithm to hash the generated reconstructed string. SHA-256 is a secure hash algorithm that accepts an input string and generates a 256-bit hash value. This hash value is a unique and fixed-length representation of the input data. The generated hash value is called the first hash digest, which represents the cryptographic digest of the entire data to be signed. This digest is a fixed-length string used to verify the integrity and authenticity of the digital signature. During the digital signature verification process, the recipient will use the same algorithm and the same input data to generate a new hash value through the SHA-256 hash operation, and then compare it with the first hash digest provided by the sender.

[0049] More specifically, in a specific embodiment of this application, generating the reconstructed string includes: placing the algorithm identifier first, indicating the signature algorithm used; placing the timestamp next, reflecting the signing time; and placing the gateway ID last, representing the signing object. The concatenation method can simply join the three items into a single string. Alternatively, special separators can be added between the items for subsequent parsing. The concatenation order must be the same as during signing to reconstruct the original text to be signed. The concatenation result forms the reconstructed string, which contains the core elements of the signature. The reconstructed string is used for subsequent hash operations to verify the correctness of the signature. This reconstruction method ensures the accuracy of verification and improves security.

[0050] More specifically, in a specific embodiment of this application, generating the first hash digest includes: inputting a reconstructed string, which has been previously generated by concatenating a digital signature algorithm identifier, a timestamp, and a gateway ID. The SHA-256 hash algorithm module is invoked, with the reconstructed string passed as input. The module initializes the hash buffer, sets the buffer size, and initializes the hash value according to the SHA-256 algorithm definition. The hash calculation process then begins, grouping the reconstructed string and progressively updating the hash value. This includes message padding, information processing, and compression function calculations. After multiple rounds of iterative calculations, a 256-bit hash value is finally obtained. The calculated hash value is then output as the first hash digest. The first hash digest will be used for subsequent signature verification comparison, and its accuracy is crucial to the reliability of the verification. The entire calculation process must conform to the standard implementation of the SHA-256 algorithm to ensure the uniqueness of the output digest.

[0051] After the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway performs the following steps: constructing a JSON-formatted message data structure, which includes a message header and a message body; encapsulating the first signature value into the signature value field in the message body; encapsulating the data to be signed into the raw data field in the message body; encapsulating the first hash digest into the hash value field in the message body; generating a JSON-formatted message string containing a message header and a message body according to the JSON algorithm, as the first digital signature; and sending an authentication request containing the first digital signature to the fragrance module for verification.

[0052] Specifically, a JSON-formatted message data structure is constructed, comprising a message header and a message body. JSON (JavaScript Object Notation) is a lightweight data-interchange format commonly used for data transmission and storage. The message header and message body together form the entire data structure, providing metadata about the message and the actual data content. The message header typically contains message-related metadata, such as message type, sender information, receiver information, and timestamps. This information helps in message identification and processing. The message body contains the actual transmitted data, which may be sensor data, commands, status updates, etc. The content of the message body varies depending on communication requirements and application scenarios. Integrating the message header and message body together forms a complete JSON-formatted message data structure: this JSON-formatted message data structure can flexibly carry various types of information and is easy to parse and transmit between different systems. The message header provides metadata about the message, while the message body contains the actual data content.

[0053] Specifically, the message adopts a structure including a message header and a message body. The message body defines a signature value field, a raw data field, and a hash value field. The first signature value obtained from the preceding sequence is encapsulated in the signature value field. The raw data to be signed (gateway ID and gateway timestamp) is also encapsulated in the raw data field. The first hash digest is encapsulated in the hash value field. Field encapsulation can be stored using data structures or directly encoded into a bitstream. During encapsulation, it is necessary to ensure the correct correspondence between the relationships and positions of each field. After the message body is encapsulated, it is combined with the message header to form the final authentication request message. When the message is sent to the fragrance module for verification, the required data can be extracted based on the fields. The encapsulation method ensures the transmission and verification of the signature value, raw data, and hash value. In summary, this technical solution, through the standardized encapsulation and assembly of signature-related data, forms a uniformly formatted authentication request message, providing a guarantee for subsequent verification and improving the robustness of the authentication process.

[0054] Specifically, an authentication request containing the first digital signature is sent to the fragrance module for verification. This authentication request includes the generated JSON format message string and the corresponding first digital signature. Upon receiving the authentication request, the fragrance module uses the same digital signature algorithm, public key, or pre-shared key to verify the received message string. The verification process includes the following steps: extracting the first digital signature from the message; regenerating the message string; digitally signing the regenerated message string using the same key and signature algorithm; and comparing the regenerated signature value with the first digital signature provided in the message. If the two signature values ​​match, the fragrance module verifies the message and trusts its content and origin. This verification process ensures the integrity and authenticity of the message during transmission.

[0055] Specifically, in a specific embodiment of this application, the JSON message data structure is defined as: {"Header": {"MsgType": "Auth Request", "Sender": "GW1001", "Receiver": "M001"},

[0056] "Body": {"Signature": "357ab...", "Original Data": "123456GW1001",

[0057] The message header contains the message type, sender, and receiver information. The message body contains the first signature value, the original data, and the first hash digest. Encoding the data structure into JSON yields the following message string: {"Header": {"Msg Type": "Auth Request", "Sender": "GW1001", "Receiver": "M001"}, "Body": {"Signature": "357ab...", "Original Data": "123456GW1001", "HashDigest": "8563bef8..."}}; This JSON string is the first digital signature. It contains complete information such as the signature value, the data to be signed, and the hash value. The first digital signature is transmitted to the fragrance module over the network. The module parses the message and verifies the signature, completing the authentication.

[0058] The fragrance module receives the authentication request sent by the vehicle gateway and verifies it according to the stored authentication key. The fragrance module also performs the following steps: receiving the first digital signature and retrieving the vehicle gateway digital certificate from the stored authentication key according to the gateway ID; parsing the digital certificate content according to the certificate format to obtain the public key data; performing RSA decryption calculation on the first signature value according to the extracted public key data to obtain the decrypted plaintext; performing SHA-256 hash operation on the data to be signed in the first digital signature to generate a second hash digest; comparing the decrypted plaintext and the second hash digest using a string matching function; when the decrypted plaintext and the second hash digest match, comparing the first hash digest and the second hash digest bit by bit using a hash value comparison function; when all bits of the first hash digest and the second hash digest are completely identical, outputting verification success; otherwise, outputting verification failure.

[0059] Specifically, after receiving the first digital signature, the fragrance module uses the gateway ID in the signature as an index key to look up the corresponding gateway digital certificate from the pre-stored authentication keys. The digital certificate is stored in a standardized certificate format, which includes the gateway's RSA public key information. The fragrance module parses the certificate to extract the public key data, including the public key exponent e and the public key modulus n. The extracted public key is applied to the public key parameters of the RSA decryption algorithm to perform RSA decryption calculation on the signature value in the first digital signature: Plain text = Signature^e mod n. This calculation can recover the original text information of the signature, where Plaintext represents the plaintext obtained after decryption, Signature represents the signature value in the digital signature, e represents the public key exponent in the RSA algorithm, n represents the public key modulus in the RSA algorithm, ^ represents exponentiation, and mod represents modulo operation. The RSA decryption process is as follows: take the signature value as input data, raise the signature to the power of e, perform an exponentiation of the RSA public key e to obtain Signature^e, take the modulo n of the result of the previous step, perform a modulo operation, and obtain the final plain text output.

[0060] The decrypted plaintext is compared with the hash value of the original text in the digital signature. If they match, it proves that the signature was generated using the private key of the corresponding gateway, thus verifying the gateway's identity. The method described above, which extracts the public key from the certificate and then performs RSA decryption to verify the signature, effectively prevents man-in-the-middle attacks and improves authentication security. The fragrance module extracts the data to be signed from the first digital signature; this is the original, unencrypted data. A SHA-256 hash operation is performed on this original data to generate a second hash digest. The decrypted plaintext, previously obtained from the signature, should be the hash value of the original data. The decrypted plaintext and the second hash digest are input into a string matching function for comparison. If they match completely, the signature is valid. If they do not match, the signature is considered forged or tampered with. String matching can use simple bit-by-bit comparison, which is highly efficient. More complex hash comparison algorithms can also be used. This comparison method requires no certificates or complex calculations, allowing for rapid verification of signature correctness.

[0061] Specifically, two sets of data, a first hash digest and a second hash digest, have been obtained. First, a preliminary comparison of the plaintext hash and the second hash digest is performed using string matching. If the preliminary comparison passes, a detailed, bit-by-bit comparison is then performed on the two hash digests. A hash value comparison function is designed, taking two hash values ​​as input. Starting from the first bit, the function checks each hash value bit by bit; if they match, the comparison continues; otherwise, it fails. This process iterates through each bit until a complete 256-bit comparison is achieved. If all bits match perfectly, a successful verification result is output. If any bit does not match, a verification failure result is output. This detailed, bit-by-bit comparison effectively prevents hash collisions and improves verification security. A match indicates a correct signature; a mismatch indicates an incorrect signature or that the signature has been tampered with.

[0062] More specifically, the fragrance module generates the second hash digest by: extracting the data to be signed from the first digital signature, for example, "123456GW1001"; importing the SHA-256 hash module and setting the hash algorithm initialization parameters; passing the string of data to be signed as input to the SHA-256 hash operation function; the function receives the input, performs padding, sets the initial hash value, and performs other initialization tasks; entering the calculation process, grouping the message into 512-bit groups and calculating the hash step by step; after 64 rounds of iteration, a 256-bit hash value is finally obtained: 563bef8d6e10d187401446730f66d32ac1a6496; outputting the calculation result as the second hash digest; the second hash digest will be used for subsequent signature comparison and verification; the calculation follows the SHA-256 standard, ensuring the accuracy of the result.

[0063] The control command process involves the vehicle gateway receiving an authentication pass response from the fragrance module, then sending a request to the vehicle's central control unit (NCU) to obtain a control command, and receiving the control command returned by the NCU. The vehicle gateway also performs the following steps: receiving the authentication response message from the fragrance module, which includes an authentication status field; parsing the authentication response message using a message parsing function to extract the authentication status field; encoding the extracted authentication status field using an encoding conversion function to obtain a status identifier code; calculating the CRC checksum of the status identifier code using a CRC-16 check function; and comparing the calculated CRC checksum with the stored CRC checksums sequentially. If identical checksums are found, a successful comparison is returned.

[0064] The CRC-16 check function is a cyclic redundancy check algorithm used for error detection in data. It calculates and generates a 16-bit CRC checksum to verify data integrity and consistency. In this application, the status identifier code is subjected to CRC-16 verification, generating a 16-bit CRC checksum. The CRC-16 check function requires the status identifier code as input and outputs the calculated CRC code. The calculation follows the CRC-16 encoding generator polynomial, ensuring stable and reliable encoding. The generated CRC code is compared bit-by-bit with the stored original code. If they are completely identical, it proves that the status identifier code has not been modified, and the verification passes. CRC-16 encoding is simple and efficient, suitable for verifying authentication status. CRC verification improves the reliability of status data transmission.

[0065] The authentication response message is sent by the fragrance module in response to the authentication request from the vehicle gateway. It contains information indicating the processing result of the authentication request. The authentication status field is a field in the authentication response message used to indicate the final processing status of this authentication request, including success or failure. The authentication response message is a complete message, and the authentication status field is one of its components. The response message contains the status field and other relevant information. The status field represents the final authentication result and is the core information of the response message. The content of the status field can be extracted from the response message. Both are used together to complete a full authentication interaction.

[0066] Specifically, the vehicle gateway receives the authentication response message from the fragrance module. The authentication response message contains a specific message structure, such as JSON or XML. An authentication status field is defined in the message structure to indicate the success or failure of the authentication. The gateway calls a message parsing function to parse the format of the response message. According to the message format specification, it locates and extracts the data from the authentication status field. The message parsing function needs to be consistent with the format of the response message, such as a JSON parser. Alternatively, a general data extraction function can be called to find the authentication status information by keyword. After obtaining the status data, it is converted into the corresponding boolean type authentication result. Based on the parsed result, the gateway completes the authentication of the fragrance module's identity. The parsing method ensures the correctness of the authentication result. In summary, this technical solution, by calling a message parser to parse the response and extract the status, can effectively obtain the authentication result and complete the verification of the fragrance module's identity.

[0067] Specifically, the authentication status field extracted from the authentication response message needs to be encoded. An encoding conversion function can be designed, taking the authentication status data as input and outputting the converted status identifier code. For example, "Succeed" is converted to "1001", and "Failed" is converted to "0100". The encoding conversion function needs to ensure the uniqueness of the mapping relationship between different states. A CRC-16 checksum is performed on the status identifier code to calculate a 16-bit CRC checksum. The CRC-16 algorithm function is called, taking the status identifier code as input and outputting the CRC code. The CRC checksum is appended to the status code to verify the integrity of the bitstream. The receiver can recalculate the checksum based on the CRC code; if they match, it proves that the bitstream has not been tampered with. CRC checksum improves the reliability and anti-interference capability of the status data. In summary, this technical solution, through encoding conversion and CRC checksum, can effectively improve the security and reliability of authentication status data.

[0068] Specifically, the current CRC checksum has been calculated and stored. A CRC checksum comparison function is designed, taking two sets of CRC codes as input. The lengths of the two CRC codes are obtained, such as 16 bits. Starting from the first bit, each bit is compared and judged. If the two CRC codes of the current bit are the same, the next bit is checked. If all bits are completely identical, the comparison passes, and verification is successful. If any bit does not match, the comparison fails, and verification fails. Bit-by-bit comparison of the CRC code can effectively check whether the code stream is complete and consistent. Once the code is modified, the CRC value will also change, which can be detected by the comparison. This ensures the reliability and non-repudiation of the status data. In summary, this bit-by-bit CRC comparison verification technology can effectively verify the reliability of the authentication status and prevent the status from being forged or tampered with.

[0069] Figure 3This is an exemplary flowchart illustrating the generation of a control command request message according to some embodiments of this specification. After successful comparison, the vehicle gateway performs the following steps: generating a control command request message containing the fragrance module ID and authentication status fields; and sending the control command request message to the vehicle central control unit via the CAN bus. Specifically, successful comparison proves the fragrance module's legitimacy. The vehicle gateway needs to generate control commands so that the fragrance module can control the vehicle environment. The message defines a command field containing the fragrance module's ID. It also includes the authentication status information. The message format can use a custom protocol or a standard protocol. The message is encoded and serialized using an encoding / decoding module to generate a byte stream data packet. The CAN bus interface is called to initialize CAN channel parameters, such as baud rate. Data packets are sent to the bus frame by frame according to the CAN communication timing and protocol. The CAN controller hardware sends the frame group to the central control unit to execute the command. The central control unit parses the message and performs operation control according to the command. The CAN bus transmission method ensures that the command arrives at the central control unit safely and reliably.

[0070] Specifically, define the message JSON format, including the module ID and status field, for example: {"Module ID": "M001", "Auth Status": "Success"}, where the fragrance module ID is "M001" and the authentication status is "Success". Construct a JSON object and insert the above field data. Call the JSON encoding function to generate the message string: {"Module ID": "M001", "Auth Status": "Success"}, call the CAN message encapsulation function, and input the JSON string. The encapsulation function generates a CAN data frame and inserts the message data. Add a frame ID and set frame parameters, etc. Send the message frame through the CAN interface. The CAN hardware sends the message to the bus. The central control unit receives the message, parses it, and executes control.

[0071] Figure 4 This is an exemplary flowchart illustrating the generation of control commands according to some embodiments of this specification. After receiving a control command request message, the vehicle central control unit performs the following steps: Based on the fragrance module ID, it queries a preset fragrance module ID-public key mapping table to retrieve the RSA public key corresponding to the fragrance module ID; it uses the retrieved RSA public key to perform RSA digital signature verification on the authentication status field in the control command request message; if the verification is successful, it obtains the control parameter information corresponding to the fragrance module ID in the preset database; based on the control parameter information, it generates a control command and sends the generated control command to the vehicle gateway.

[0072] Specifically, the system pre-establishes a mapping table between fragrance module IDs and public keys. The mapping table uses the fragrance module ID as the key to index the public key. The table stores the ID of each fragrance module and its corresponding RSA public key. The public key contains the two parameters 'n' and 'e' of the module's RSA algorithm. Upon receiving the digital signature of a fragrance module, the module ID is extracted from the signature. This ID is used as the lookup key to search the mapping table. If a matching module ID is found, its mapped public key is returned. If no match is found, the query fails. This mechanism allows for the rapid acquisition of the public key corresponding to a module. The public key will be used for subsequent verification of the module signature. This technical solution achieves an accurate correspondence between module IDs and public keys by establishing an index mapping table.

[0073] More specifically, the IDs of all fragrance modules participating in the communication are determined, such as M001, M002, etc. Each fragrance module generates its own public-private key pair using the RSA algorithm. The RSA public key generated by each module is obtained, including the module number n and the exponent e. A mapping relationship is established, mapping each module's ID to its public key. This mapping table is stored using a data structure such as a dictionary, where the key is the module ID and the value is the public key. Alternatively, it can be stored in a database table, with one column for IDs and another for public keys. This mapping table is imported and stored in the vehicle gateway as the basis for verifying module signatures. When a new module is added, the mapping table needs to be updated to store its ID and public key. The mapping table facilitates quick retrieval of the public key used for signature verification based on the ID, improving the efficiency of signature verification.

[0074] Specifically, the RSA public key for the corresponding fragrance module, containing n and e, has been retrieved. The authentication status field data is extracted from the control command request message. The status data is SHA256 hashed to generate a hash digest of the status. An RSA signature verification operation is performed on the status hash digest using the extracted public key n and e: m = SHA256Hash(status), v = m^e % n, where v represents the calculation result of the signature verification, m represents the hash value of the message, e represents the public exponent in the RSA public key, and n represents the modulus in the RSA public key. ^ represents exponentiation, and % represents modulo operation. The operation process is as follows: hash the message to obtain the hash value m, raise m to the power of e to obtain m^e, and take the modulo n of m^e to obtain the signature verification value v. v is compared with the signature field in the message. If the calculated result v matches the signature value, the verification passes, and the status has not been tampered with. If they do not match, the verification fails, and the message signature is invalid. RSA signature verification ensures the authenticity and integrity of the status field, preventing unauthorized modification of the message during transmission.

[0075] Specifically, after RSA verification is successful, the technical solution for obtaining control parameters and generating control commands based on the module ID includes: pre-storing the ID of each fragrance module and its corresponding control parameters in the database. Control parameters may include fragrance type, spray volume, spray interval, etc. After RSA verification is successful, the module ID is extracted from the message. Using the module ID as a key, the database is queried to obtain matching control parameters. The control parameters of the corresponding module are read, such as fragrance type, timing mode, etc. Based on these control parameters, specific control command data is generated. The commands can use a specific command format and set the values ​​of parameter fields. The generated command data is sent to the vehicle gateway using network communication or serial port. The gateway parses the parameters in the command and transmits them to the fragrance module. The command data follows the communication protocol of the fragrance module.

[0076] Before generating control commands, the vehicle gateway performs the following steps: it performs format verification on the acquired control parameter information, including data length and value range; when both data length and value range are within the preset range, the format verification passes; only after the format verification passes does it generate control commands based on the control parameter information.

[0077] Specifically, the system retrieves the control parameter information for the corresponding module from the database. The parameter data undergoes format validation, including length and value range checks. Length limits are set for each parameter, such as a maximum of 4 bytes for the spray volume. The value range is also set, such as a spray volume value between 0 and 1000. Each parameter is checked sequentially for length exceeding the limits. Simultaneously, the value is checked to ensure it is within the specified range. If the length or value of any parameter exceeds the preset limit, the format validation fails. If all parameters are within the limits, the format validation passes. Only after successful format validation will the subsequent control command generation process begin. Format validation effectively filters out erroneous or illegal parameters, ensuring the correctness of the commands and avoiding potential risks or errors. After successful format validation, the validated control parameter information is obtained. Based on the fragrance module's communication protocol, the message format for the control commands is designed. A command word field is defined in the message to represent the control type. A parameter field is defined to carry the corresponding control parameter values. The retrieved control parameters are filled into the message parameter field. For example, fragrance type and spray volume parameters are filled in. The message encoding function is called to encode the message data according to the protocol format. The encoded binary byte stream forms the final control command data. The encoded control commands are sent through the interface communicating with the fragrance module. Upon receiving the commands, the fragrance module parses and executes the corresponding fragrance control operations.

[0078] More specifically, based on the fragrance module's technical specifications, determine the theoretical range of each control parameter. Considering functional safety factors, set parameter data length limits, such as a spray volume length not exceeding 4 bytes. Set a reasonable control value range, reserving a certain margin. For example, spray volume 0-500. Write the preset length and value range into the parameter configuration file or database. You can define a structure for each parameter, specifying length and value range fields. Alternatively, you can create a database table of parameter ranges for direct querying and setting. Consider the parameter differences between different fragrance modules and dynamically adjust the range. Define a reasonable range to prevent parameter overflow or negative impacts. Ensure parameters change within a safe and controllable range. Call the configured range during format validation to effectively filter abnormal parameters.

[0079] Another aspect of the embodiments of this specification provides a system for a gateway-based in-vehicle fragrance control method based on this application. The system consists of an in-vehicle gateway, a fragrance spraying module, and a CAN bus, enabling precise fragrance control of the in-vehicle environment. The in-vehicle gateway is responsible for processing the authentication of the fragrance module, generating control commands, and sending the control commands to the fragrance spraying module via the CAN bus. It includes an authentication unit, a control unit, and a CAN communication unit. The fragrance spraying module receives the control commands sent by the gateway and, according to the commands, sprays and controls the fragrance in the vehicle. The module and the gateway are connected via the CAN bus. The CAN bus is a communication bus connecting the gateway and the fragrance module, used for transmitting control command data. Workflow: The fragrance module sends an authentication request to the gateway. The gateway authenticates the module, and upon successful authentication, generates control commands. The gateway sends the control commands to the fragrance module via the CAN bus. The module receives the commands and controls the spraying according to the commands to adjust the fragrance. During the process, the commands are reliably transmitted via the CAN bus, achieving accurate and efficient in-vehicle fragrance control.

[0080] The foregoing illustrative description of the invention and its embodiments is not restrictive and can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. The accompanying drawings are only one embodiment of the invention, and the actual structure is not limited thereto. No reference numerals in the claims should limit the scope of the claims. Therefore, if a person skilled in the art, inspired by this description, designs a similar structure and embodiment without departing from the spirit of the invention, such design should fall within the scope of protection of this patent. Furthermore, the word "comprising" does not exclude other elements or steps, and the word "a" preceding an element does not exclude the inclusion of "a plurality" of that element. Multiple elements stated in the product claims can also be implemented by a single element through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

Claims

1. A gateway-based in-vehicle fragrance control method, comprising: An authentication circuit is set up in the fragrance module to store the authentication key; After the fragrance module establishes a communication connection with the vehicle gateway, it receives the authentication request sent by the vehicle gateway, verifies the authentication based on the stored authentication key, and returns the authentication result to the vehicle gateway. The fragrance module receives control commands encrypted using a preset key from the vehicle gateway. The fragrance module uses a preset key to decrypt the received control commands and then executes the decrypted control commands. Among them, the control command is that after the vehicle gateway receives the authentication pass response sent by the fragrance module, it sends a request to the vehicle central control to obtain the control command, and receives the control command returned by the vehicle central control. The control command process involves the vehicle gateway receiving an authentication pass response from the fragrance module, then sending a request to the vehicle's central control unit to obtain the control command, and receiving the control command returned by the central control unit. The vehicle gateway also performs the following steps: Receive the authentication response message from the fragrance module. The authentication response message contains an authentication status field. Parse the authentication response message using the message parsing function and extract the authentication status field; The extracted authentication status field is encoded using an encoding conversion function to obtain a status identifier code; Calculate the CRC checksum of the status identifier using the CRC-16 check function; The calculated CRC checksum is compared sequentially with the stored CRC checksum. If a matching checksum is found, the comparison is considered successful. After the comparison is successful, the vehicle gateway performs the following steps: Generate a control instruction request message containing the fragrance module ID and authentication status fields; Control command request messages are sent to the vehicle's central control unit via the CAN bus.

2. The in-vehicle fragrance control method based on a gateway according to claim 1, characterized in that: After the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway also performs the following steps: Obtain the system time of the vehicle gateway as the gateway timestamp, and obtain the gateway ID of the vehicle gateway; Use the obtained gateway timestamp and gateway ID as the data to be signed; The RSA algorithm is used to sign the data to be signed, and the generated signature value is used as the first signature value.

3. The in-vehicle fragrance control method based on a gateway according to claim 2, characterized in that: After the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway also performs the following steps: Parse the first signature value to obtain the digital signature algorithm identifier; Retrieve the gateway timestamp and gateway ID from the data to be signed; The reconstructed string is generated by concatenating the obtained digital signature algorithm identifier, gateway timestamp, and gateway ID. Based on the generated reconstructed string, a hash value is generated using SHA-256 hashing, which serves as the first hash digest.

4. The in-vehicle fragrance control method based on a gateway according to claim 3, characterized in that: After the fragrance module establishes a communication connection with the vehicle gateway, the vehicle gateway also performs the following steps: Construct a message data structure in JSON format, which includes a message header and a message body; Encapsulate the first signature value into the signature value field in the message body; Encapsulate the data to be signed into the original data fields of the message body; Encapsulate the first hash digest into the hash value field of the message body; Based on the JSON algorithm, a JSON-formatted message string containing a message header and message body is generated as the first digital signature; An authentication request containing the first digital signature is sent to the fragrance module for verification.

5. The in-vehicle fragrance control method based on a gateway according to claim 4, characterized in that: The fragrance module receives an authentication request from the vehicle gateway, verifies the authentication based on the stored authentication key, and then performs the following steps: Receive the first digital signature and retrieve the vehicle gateway digital certificate from the stored authentication key based on the gateway ID; The obtained vehicle gateway digital certificate is parsed according to the certificate format to obtain the public key data; The first signature value is decrypted using RSA based on the extracted public key data to obtain the decrypted plaintext. Perform a SHA-256 hash operation on the data to be signed in the first digital signature to generate a second hash digest; The decrypted plaintext and the second hash digest are compared using a string matching function. Once the decrypted plaintext matches the second hash digest, a bit-by-bit comparison is performed between the first hash digest and the second hash digest using a hash value comparison function. If all bits of the first hash digest and the second hash digest are exactly the same, output "verification successful"; otherwise, output "verification failed".

6. The in-vehicle fragrance control method based on a gateway according to claim 1, characterized in that: Upon receiving a control command request message, the vehicle's central control unit performs the following steps: Based on the fragrance module ID, query the preset fragrance module ID-public key mapping table to find the RSA public key corresponding to the fragrance module ID; The RSA public key obtained from the query is used to perform RSA digital signature verification on the authentication status field in the control instruction request message; If the verification is successful, the control parameter information of the corresponding fragrance module ID in the preset database will be obtained; Based on the control parameter information, control commands are generated and sent to the vehicle gateway.

7. The in-vehicle fragrance control method based on a gateway according to claim 6, characterized in that: Before generating control commands, the vehicle gateway performs the following steps: The acquired control parameter information is format-validated, including data length and value range. The format validation passes when both the data length and value range are within the preset range. Control commands are generated based on control parameter information only after the format verification passes.

8. A system based on the gateway-based in-vehicle fragrance control method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Vehicle-mounted security gateway and data communication method thereof

    CN112202665A

  • Data communication method, intelligent equipment and intelligent gateway

    CN108769009A

  • Fragrance control system and method, readable storage medium and vehicle

    CN116605013A

  • Internet of Things equipment authentication method and equipment based on block chain, and medium

    CN121125277A