A CAN communication sending timing control method and system based on information security

By prioritizing the initialization of the CAN communication module and sending the first frame message after hardware security module verification, the problem of traditional CAN communication startup delay is solved, enabling rapid information exchange between vehicle controllers and improving code maintainability.

CN122394828APending Publication Date: 2026-07-14CHONGQING TSINGSHAN IND

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING TSINGSHAN IND
Filing Date
2026-01-27
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Traditional CAN communication sends messages only after the vehicle is initialized, resulting in a startup delay and failing to meet the rapid interaction requirements of the vehicle's information security functions.

Method used

After the hardware security module passes the verification, the CAN communication-related modules are initialized first and the first frame message is sent. By reconstructing the initialization order, key status information is sent in advance before the application layer initialization.

Benefits of technology

This technology enables the early transmission of CAN messages without sacrificing information security, improving the efficiency of information exchange between vehicle controllers, reducing software coupling, and enhancing code maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122394828A_ABST
    Figure CN122394828A_ABST
Patent Text Reader

Abstract

The application discloses a CAN communication sending time sequence control method and system based on information security, and the method comprises the following steps: S1, performing security verification based on a hardware security module in the process of starting a motor controller; S2, after the security verification is passed, preferentially performing module initialization related to CAN communication sending, including initialization of a communication management module and a CAN interface module, and switching the state of the communication management module to a state of allowing CAN message sending; S3, before the application layer of the motor controller is completely initialized, calling an interface function of the CAN interface module to send a first CAN message used for representing the state of the motor. By ensuring that the hardware security verification is preferentially completed, reconstructing the software initialization time sequence and directly calling the underlying communication interface, the application solves the technical problem that the CAN communication of the motor controller of the automobile is delayed due to the introduction of the information security function, and realizes the early sending of the key state information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle technology, and in particular to a CAN communication transmission timing control method and system based on information security. Background Technology

[0002] CAN (Controller Area Network) bus is a widely used communication protocol in the automotive electronics field. Due to its unique design and wide applicability, the CAN bus protocol is widely used in industrial control, automotive electronics, medical equipment, and other fields. CAN communication is a crucial component of automobiles, characterized by high reliability, high efficiency, low latency, and flexibility. CAN messages serve as the communication bridge connecting various controllers; without CAN messages, controllers cannot obtain secure information. CAN transmission typically begins only after a complete initialization process. This process usually follows a strict sequence: First, the controller performs low-level hardware and security boot, including Bootloader and Basic Software Module (BSW) driver initialization, as well as key injection and security verification of the Hardware Security Module (HSM); subsequently, the Operating System (OS) starts and initializes each software component of the Application Layer (ASW) in sequence; finally, after the application layer tasks are fully ready, the CAN communication protocol stack is officially activated and begins sending messages through periodic tasks.

[0003] With the development of new energy vehicles, the functions of the entire vehicle are becoming more complex, especially in terms of vehicle safety. This leads to increasingly higher requirements for vehicle information security functions and more stringent requirements for the status management of each controller. After adding information security functions to the motor, a series of verification actions are performed, which inevitably increases the running time of the BM and BootLoader. This results in a longer initialization cycle. However, the traditional message sending method waits until all initialization is complete before sending CAN messages, resulting in a relatively long CAN message transmission time. This no longer meets the requirements of vehicle control. Therefore, it is necessary to consider shortening the CAN message transmission time to improve the efficiency of interaction between controllers.

[0004] Therefore, how to reconstruct the controller initialization sequence without sacrificing information security and functional integrity, so as to send the first application message as early as possible, thereby meeting the vehicle system's need for rapid perception of component status, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] To address the aforementioned shortcomings of existing technologies, this invention provides a CAN communication transmission timing control method and system based on information security. Based on the AUTOSAR (Automotive Open System) architecture, this invention reconstructs the software initialization timing and directly calls the underlying communication interface while ensuring that hardware security verification is completed first. This solves the technical problem of CAN communication startup delay caused by the introduction of information security functions in automotive motor controllers, and enables the early transmission of critical status information.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0007] A CAN communication transmission timing control method based on information security includes the following steps:

[0008] S1. During the motor controller startup process, a security check based on the hardware security module is performed;

[0009] S2. After the security verification is passed, the initialization of modules related to CAN communication transmission is performed first, including the initialization of the communication management module and the CAN interface module, and the state of the communication management module is switched to the state of enabling CAN message transmission.

[0010] S3. Before the application layer of the motor controller is fully initialized, call the interface function of the CAN interface module to send the first CAN message to characterize the motor status.

[0011] As a preferred embodiment, step S1 specifically includes:

[0012] S101. Complete the initialization of the motor controller's boot manager and Flash Bootloader;

[0013] S102. Complete the security key injection and security verification of the hardware security module;

[0014] S103. Based on the security verification result, obtain the reprogramming request flag and the start valid flag.

[0015] As a preferred embodiment, after performing step S102 and before step S103, the method further includes: performing clock initialization and Flash memory initialization respectively, and initializing the simulated E2PROM to obtain the configuration data stored therein.

[0016] As a preferred embodiment, the flag bits obtained in step S103 also include: the read and write permission flag bits of Flash Bootloader, and the software status flag bits of the application layer APP area.

[0017] As a preferred embodiment, step S2 specifically includes:

[0018] S201. Initialize the operating system task scheduler, peripheral drivers, and ECU status manager to establish the basic software operating environment;

[0019] S202. Start the operating system task scheduler and basic software mode manager in the basic software runtime environment, and complete the CAN driver initialization;

[0020] S203. Under the control of the basic software mode manager, the initialization of the communication service module, CAN interface module and communication management module is completed first.

[0021] As a preferred embodiment, step S2 further includes: after completing the initialization of the communication management module, switching the state of the basic software mode manager to the CAN message transmission enabled state through the basic software mode manager, and requesting CAN communication to enter the full communication state.

[0022] As a preferred embodiment, in step 201, when establishing the basic software operating environment, the initialization tasks are classified, and the initialization tasks related to CAN communication transmission are identified as high-priority tasks and scheduled for execution first.

[0023] As a preferred embodiment, step S3 specifically includes:

[0024] S301. Initialize the CAN communication controller, switch it from sleep mode to normal working state, and open the CAN communication channel;

[0025] S302. Initialize the CAN status manager and set the CAN protocol data unit mode;

[0026] S303. Repeat steps S301 and S302 until the CAN communication channel is successfully opened.

[0027] S304. Define the data group representing the motor controller's start-up status information, as well as the identifier and data length of the CAN message;

[0028] S305. Encapsulate the data group, the identifier, and the data length in a structure to configure the CAN message;

[0029] S306. Call the interface function of the CAN interface module and pass the structure containing the CAN message information as a parameter to trigger the priority transmission of the CAN message.

[0030] As a preferred embodiment, after successfully sending the first CAN message in step S3, the method further includes: continuing to execute the remaining initialization tasks of the application layer, and starting a periodic CAN message sending task after the application layer has fully started.

[0031] A CAN communication transmission timing control system based on information security, comprising:

[0032] The security verification module is used to perform security verification based on the hardware security module during the startup process of the motor controller;

[0033] The communication priority initialization module is used to prioritize the initialization of modules related to CAN communication transmission after the security verification is passed, including the initialization of the communication management module and the CAN interface module, and to switch the state of the communication management module to the CAN message transmission enabled state;

[0034] The pre-send message module is used to call the interface function of the CAN interface module to send the first CAN message that represents the motor status before the application layer of the motor controller is fully initialized.

[0035] Compared with the prior art, the present invention has the following technical effects:

[0036] 1. Traditional technologies require waiting for all initializations, especially the time-consuming APP layer initialization, before messages can be sent. In this invention, the CAN communication ready node is moved to after security verification and before APP initialization, so that messages representing the key status of the motor (such as successful power-on and ready status) can be sent hundreds of milliseconds to several seconds earlier, greatly improving the time of the first CAN message transmission. This allows other controllers in the vehicle to know the motor status earlier and enhances the information interaction efficiency between vehicle controllers.

[0037] 2. This invention optimizes the subsequent initialization sequence by reconstructing the timing, ensuring the integrity of security verification, and enabling communication functions to be ready in advance. This resolves the conflict between security functions and real-time performance during the startup phase, ensuring both secure startup and the early delivery of critical information. Furthermore, this invention leverages the layered and modular characteristics of the AUTOSAR architecture, achieving precise management of communication timing through precise control of the states of the basic software mode manager (BswM) and communication management module (ComM), as well as direct calls to the CAN interface module (CanIf).

[0038] 3. The CAN message sent first in this invention can be customized with its content and identifier according to requirements, so that the solution can be more flexibly adapted to the needs of different vehicle models and different communication protocols; at the same time, the communication initialization and APP initialization are decoupled, making the development and testing of the two modules more independent, reducing software coupling, and improving code maintainability and portability. Attached Figure Description

[0039] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:

[0040] Figure 1 This invention discloses a CAN communication transmission timing control method based on information security.

[0041] Figure 2 This is a schematic diagram of timing control in an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0043] It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the figures, or the orientation or positional relationship commonly used when the product is in use. They are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. In addition, the terms "horizontal," "vertical," etc., do not indicate that the component is required to be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted. In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0044] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0045] With the development of intelligent connected vehicles, vehicle information security has become a rigid requirement of regulations and functions. The introduction of Hardware Security Module (HSM) for secure booting, key management and code verification in motor controllers has become an industry standard practice. However, this enhanced secure boot process inevitably increases the controller's boot time, which significantly lengthens the interval from system power-on to the establishment of effective CAN communication between controllers. This can no longer meet the requirements of vehicle control. Therefore, it is necessary to consider improving the CAN message transmission time to enhance the efficiency of interaction between controllers. To address the aforementioned problems, this invention proposes a CAN communication transmission timing control method and system based on information security. This method, grounded in the AUTOSAR architecture, intelligently identifies and rearranges subsequent initialization tasks while prioritizing security barriers. Specifically, it initializes the CAN communication stack (such as ComM, CanIf, and CanSm) and modules directly related to communication as high-priority tasks and schedules them for execution before the complex initialization of the application layer (APP). Once the communication stack is ready, a predefined critical status message is immediately sent by directly calling the AUTOSAR underlying interface CanIf. Afterward, the system continues to execute non-real-time critical tasks such as APP initialization.

[0046] Specifically, the CAN communication transmission timing control method based on information security proposed in this invention, such as... Figure 1 , Figure 2 As shown, the specific steps include the following:

[0047] S1. During the motor controller startup process, perform a security check based on the Hardware Security Module (HSM);

[0048] S2. After the security verification is passed, the initialization of modules related to CAN communication transmission is performed first, including the initialization of the communication management module (ComM) and the CAN interface module (CanIf), and the state of the communication management module (ComM) is switched to the state that allows CAN message transmission.

[0049] S3. Before the application layer (APP) of the motor controller is fully initialized, call the interface function of the CAN interface module (CanIf) to send the first CAN message to characterize the motor status.

[0050] In practice, the software architecture involved in this embodiment mainly includes the following four layers:

[0051] The first layer includes the Boot Manager (BM) and the Bootloader; these belong to the bottom layer of the controller. Only after both have successfully started and completed the HSM security verification can the system enter the application layer (APP) initialization process.

[0052] The second layer includes the operating system (OS), communication management module (ComM), basic software mode manager (BswM), and CAN status manager (CanSM). This layer is the basic framework for CAN communication transmission. The OS is a multi-core operating system that manages the normal operation between cores and calls interrupts to ensure that tasks can operate normally. The ComM is responsible for hardware initialization and communication status management. The BswM is responsible for coordinating the initialization process of each software module. The CanSM is responsible for managing the CAN communication protocol status.

[0053] The third layer is the CAN controller driver. In this embodiment, it is specifically responsible for initializing CAN transceiver chips such as TPT1145CAN, switching them from sleep mode to normal working mode, and verifying whether the TPT1145CAN chip is abnormal.

[0054] The fourth layer includes the CAN interface module (CanIf) and application layer software. A key point of this embodiment is that by directly calling the sending function of the CanIf layer through handwritten code, some standard AUTOSAR procedures can be bypassed to achieve priority transmission of messages.

[0055] In this embodiment, step S1 specifically includes:

[0056] S101. Complete the initialization of the motor controller's boot manager and Flash Bootloader;

[0057] S102. Complete the security key injection and security verification of the hardware security module;

[0058] After security verification, clock initialization and Flash memory initialization are performed respectively, and the simulated E2PROM is initialized to obtain the configuration data stored therein;

[0059] S103. Based on the security verification result, obtain the reprogramming request flag and the start valid flag.

[0060] The flags also include: Flash Bootloader read and write permission flags, and application layer (APP) area software status flags.

[0061] In this embodiment, step S2 specifically includes:

[0062] S201. Perform the initialization of the operating system (OS) task scheduler, peripheral drivers, and ECU status manager (EcuM) to establish the basic software operating environment;

[0063] In practice, when establishing the basic software operating environment, initialization tasks are classified, and initialization tasks related to CAN communication transmission are identified as high-priority tasks and scheduled for execution first.

[0064] S202. Start the operating system (OS) task scheduler and basic software mode manager (BswM) in the basic software runtime environment and complete the CAN driver initialization;

[0065] S203. Under the control of the basic software mode manager (BswM), the initialization of the communication service module (Com), the CAN interface module (CanIf), and the communication management module (ComM) is completed first.

[0066] In specific implementation, after the Communication Management Module (ComM) is initialized, the Basic Software Mode Manager (BswM) is switched to the CAN message transmission enabled state through the Basic Software Mode Manager (BswM), and a full communication state is requested for CAN communication.

[0067] In this embodiment, step S3 specifically includes:

[0068] S301. Initialize the CAN communication controller, switch it from sleep mode to normal working state, and open the CAN communication channel;

[0069] S302. Initialize the CAN status manager and set the CAN protocol data unit mode;

[0070] S303. Repeat steps S301 and S302 until the CAN communication channel is successfully opened.

[0071] S304. Define the data group representing the motor controller's start-up status information, as well as the identifier and data length of the CAN message;

[0072] In specific implementation, the data group can be 8 bytes or 64 bytes. The content of the data group is defined according to the CAN communication requirements and may include information such as motor status and whether the power-on is successful; the message ID to be sent can be defined as 0x400001xx format, message length, hoh arrangement order, etc.

[0073] S305. Encapsulate the data group, the identifier, and the data length in a structure to configure the CAN message;

[0074] S306. Call the interface function of the CAN interface module (CanIf) and pass the structure containing the CAN message information as a parameter to trigger the priority transmission of the CAN message.

[0075] In practice, after the first CAN message is sent, the system continues to execute the previously interrupted or suspended initialization tasks, which mainly complete the initialization of all functions of the application layer (APP). After the APP is fully started, it will switch to the normal periodic task operation and message sending mode.

[0076] This embodiment ensures the reliable readiness of communication hardware by repeatedly calling the CAN channel enable function and sending critical status information before the communication stack is fully loaded. This avoids the risk of status information being silenced due to possible anomalies during the subsequent complex APP initialization process, and guarantees the observability of the status of key nodes in the vehicle network from another dimension.

[0077] Accordingly, this application also provides a CAN communication transmission timing control system based on information security, including:

[0078] The security verification module is used to perform security verification based on the hardware security module during the startup process of the motor controller;

[0079] The communication priority initialization module is used to prioritize the initialization of modules related to CAN communication transmission after the security verification is passed, including the initialization of the communication management module and the CAN interface module, and to switch the state of the communication management module to the CAN message transmission enabled state;

[0080] The pre-send message module is used to call the interface function of the CAN interface module to send the first CAN message that represents the motor status before the application layer of the motor controller is fully initialized.

[0081] This system can implement the steps in any of the foregoing method embodiments and has the corresponding beneficial effects. Since the principle of this system embodiment is similar to that of the method embodiments, it will not be described again here.

[0082] In summary, the CAN communication transmission timing control method and system based on information security proposed in this embodiment, while ensuring the absolute priority of HSM information security verification, significantly advances the timing of sending the first critical CAN status message from the traditional "after the APP is fully started" to "after security verification and before the APP initialization is completed" by reconstructing the initialization timing, prioritizing the configuration of the communication stack, and directly calling the underlying interface. This effectively solves the problem of vehicle network communication delay caused by the increased time consumption of security startup and improves the system power-on coordination efficiency.

[0083] Compared with the prior art, the present invention has the following technical effects:

[0084] Traditional technologies require waiting for all initializations, especially the time-consuming APP layer initialization, before messages can be sent. In this invention, the CAN communication ready node is moved to after security verification and before APP initialization, so that messages representing the key status of the motor (such as successful power-on and ready status) can be sent hundreds of milliseconds to several seconds earlier, greatly improving the time of the first CAN message transmission. This allows other vehicle controllers to know the motor status earlier and enhances the efficiency of information interaction between vehicle controllers.

[0085] This invention optimizes the subsequent initialization sequence by reconstructing the timing, ensuring the integrity of security checks, and enabling communication functions to be ready in advance. This resolves the conflict between security functions and real-time performance during the startup phase, ensuring both secure startup and the early delivery of critical information. Furthermore, this invention leverages the layered and modular characteristics of the AUTOSAR architecture, achieving precise management of communication timing through precise control of the states of the basic software mode manager (BswM) and communication management module (ComM), as well as direct calls to the CAN interface module (CanIf).

[0086] The CAN messages sent first in this invention can be customized in terms of content and identifiers as needed, making the solution more flexible to adapt to the needs of different vehicle models and different communication protocols. At the same time, the communication initialization and APP initialization are decoupled, making the development and testing of the two modules more independent, reducing software coupling, and improving code maintainability and portability.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the technical solutions. Those skilled in the art should understand that any modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.

Claims

1. A CAN communication transmission timing control method based on information security, characterized in that, Includes the following steps: S1. During the motor controller startup process, a security check based on the hardware security module is performed; S2. After the security verification is passed, the initialization of modules related to CAN communication transmission is performed first, including the initialization of the communication management module and the CAN interface module, and the state of the communication management module is switched to the state of enabling CAN message transmission. S3. Before the application layer of the motor controller is fully initialized, call the interface function of the CAN interface module to send the first CAN message to characterize the motor status.

2. The CAN communication transmission timing control method based on information security according to claim 1, characterized in that, Step S1 specifically includes: S101. Complete the initialization of the motor controller's boot manager and Flash Bootloader; S102. Complete the security key injection and security verification of the hardware security module; S103. Based on the security verification result, obtain the reprogramming request flag and the start valid flag.

3. The CAN communication transmission timing control method based on information security according to claim 2, characterized in that, After step S102 and before step S103, the process further includes: initializing the clock and the Flash memory respectively, initializing the simulated E2PROM, and obtaining the configuration data stored therein.

4. The CAN communication transmission timing control method based on information security according to claim 2, characterized in that, The flags obtained in step S103 also include: the read and write permission flags of the Flash Bootloader, and the software status flags of the application layer APP area.

5. The CAN communication transmission timing control method based on information security according to claim 1, characterized in that, Step S2 specifically includes: S201. Initialize the operating system task scheduler, peripheral drivers, and ECU status manager to establish the basic software operating environment; S202. Start the operating system task scheduler and basic software mode manager in the basic software runtime environment, and complete the CAN driver initialization; S203. Under the control of the basic software mode manager, the initialization of the communication service module, CAN interface module and communication management module is completed first.

6. The CAN communication transmission timing control method based on information security according to claim 5, characterized in that, Step S2 further includes: after completing the initialization of the communication management module, switching the state of the basic software mode manager to the CAN message sending state through the basic software mode manager, and requesting CAN communication to enter the full communication state.

7. The CAN communication transmission timing control method based on information security according to claim 5, characterized in that, In step 201, when establishing the basic software operating environment, the initialization tasks are classified, and the initialization tasks related to CAN communication transmission are identified as high-priority tasks and scheduled for execution first.

8. The CAN communication transmission timing control method based on information security according to claim 1, characterized in that, Step S3 specifically includes: S301. Initialize the CAN communication controller, switch it from sleep mode to normal working state, and open the CAN communication channel; S302. Initialize the CAN status manager and set the CAN protocol data unit mode; S303. Repeat steps S301 and S302 until the CAN communication channel is successfully opened. S304. Define the data group representing the motor controller's start-up status information, as well as the identifier and data length of the CAN message; S305. Encapsulate the data group, the identifier, and the data length in a structure to configure the CAN message; S306. Call the interface function of the CAN interface module and pass the structure containing the CAN message information as a parameter to trigger the priority transmission of the CAN message.

9. The CAN communication transmission timing control method based on information security according to claim 1, characterized in that, After successfully sending the first CAN message in step S3, the process further includes: continuing to execute the remaining initialization tasks of the application layer, and starting a periodic CAN message sending task after the application layer has fully started.

10. A CAN communication transmission timing control system based on information security, characterized in that, include: The security verification module is used to perform security verification based on the hardware security module during the startup process of the motor controller; The communication priority initialization module is used to prioritize the initialization of modules related to CAN communication transmission after the security verification is passed, including the initialization of the communication management module and the CAN interface module, and to switch the state of the communication management module to the CAN message transmission enabled state; The pre-send message module is used to call the interface function of the CAN interface module to send the first CAN message that represents the motor status before the application layer of the motor controller is fully initialized.