Car lamp control method based on AutoSAR and related device
By adding a new signal processing module to AutoSAR's headlight control system to verify end-to-end data of headlight control messages, the problem of low communication security and reliability of existing systems is solved, and the safety and reliability of vehicle communication is improved.
Patent Information
- Application Number
- CN202510010925.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-15
AI Technical Summary
The existing AutoSAR-based car light control system has low communication safety and reliability, which affects the safety of the vehicle in driving or non-driving states.
A new signal processing module is added to AutoSAR's headlight control system. Through this module, the headlight control message is checked end-to-end data to ensure the accuracy and reliability of the headlight control signal.
It improves the reliability of bidirectional end-to-end headlight control between the headlight control system and the controller, and enhances the safety and reliability of vehicle communication.
Smart Images

Figure CN119835842A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automatic control technology, and in particular to a vehicle light control method based on AutoSAR and related devices. Background Art
[0002] AutoSAR (Automotive Open System Architecture) is an open and standardized software architecture jointly developed by vehicle manufacturers and suppliers in the automotive industry. Using the AUTOSAR standard architecture to define control software is a major trend in the automotive industry. The existing AutoSAR adopts a three-layer architecture, including: basic software layer, operating environment layer, and application layer.
[0003] At present, the communication timeliness and reliability of the AutoSAR-based headlight control system are related to the safety of the vehicle in driving or non-driving state. However, the communication security and reliability of the headlight control system are currently low. Summary of the invention
[0004] In view of the above problems, this application provides a vehicle light control method and related device based on AutoSAR. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a vehicle light control method based on AutoSAR, which is applied to a vehicle light control system based on AutoSAR. The vehicle light control system based on AutoSAR includes a signal processing module. The vehicle light control method based on AutoSAR includes:
[0006] After receiving the headlight control message and the verification instruction, the signal processing module calls a preset message verification function to perform end-to-end data verification on the headlight control message to obtain a verification result; the headlight control message includes a target headlight control signal, a cyclic redundancy check code and a frame counter;
[0007] If the verification result is successful, the signal processing module uses the target vehicle light control signal to update the vehicle light control signal value; if the verification result is failed, the signal processing module maintains the vehicle light control signal value;
[0008] The signal processing module uniformly encapsulates the vehicle light control signal values and sends them to the target application.
[0009] In a possible implementation, the vehicle light control system based on AutoSAR further includes a basic software layer, and the vehicle light control method based on AutoSAR further includes:
[0010] The basic software layer receives the vehicle light control message sent by the target controller;
[0011] The basic software layer determines whether the reception interval of the headlight control message exceeds a preset time threshold, and obtains a timeout judgment result, wherein the reception interval is the interval between the last reception of the headlight control message and the reception of the headlight control message;
[0012] The basic software layer triggers one of a preset message reception timeout callback function or a preset message normal reception function based on the timeout judgment result;
[0013] Wherein, the message reception timeout callback function is used to execute the message timeout logic when the timeout judgment result is timeout, and the message timeout logic includes: setting the message reception flag position to 0, clearing the message reception counter, setting the message reception timeout flag position to 1, and adding 1 to the message timeout counter;
[0014] The message normal reception function is used to execute the message reception logic when the timeout judgment result is no timeout. The message reception logic includes: setting the message reception flag position to 1, adding 1 to the message reception counter, setting the message reception timeout flag position to 0, and clearing the message timeout counter.
[0015] In a possible implementation, after the basic software layer triggers one of a preset message reception timeout callback function or a preset message normal reception function based on the timeout judgment result, the AutoSAR-based vehicle light control method further includes:
[0016] The basic software layer sends the vehicle light control message and the verification instruction to the signal processing module when the timeout flag is not 1 and the message reception flag is 1;
[0017] The basic software layer clears the loss status of the target controller and the loss status of the headlight control message according to the sequence number of the target controller and the identifier of the headlight control message when the message reception counter is not less than a preset reception count threshold;
[0018] When the timeout flag is 1 and the message timeout counter is not less than a preset timeout count threshold, the basic software layer sets the loss status of the target controller and the headlight control message to 1 according to the sequence number of the target controller and the bit identifier of the headlight control message.
[0019] When the timeout flag is 1, the message timeout counter is less than the preset timeout count threshold, and the message timeout counter is not less than the preset timeout check count threshold, the basic software layer sets the end-to-end communication error state to 1 and calls the preset callback function to report the error state.
[0020] In a possible implementation, the signal processing module uniformly encapsulates the vehicle light control signal value and sends it to the target application, including:
[0021] If the verification result is successful, the signal processing module adds 1 to the verification success counter, clears the verification failure counter, and uniformly encapsulates the vehicle light control signal value and sends it to the target application;
[0022] If the verification result is a failure, the signal processing module clears the verification success counter, adds 1 to the verification failure counter, and uniformly encapsulates the vehicle light control signal value and sends it to the target application;
[0023] If the verification failure counter is not less than the preset E2E verification failure counter threshold, the callback function is called to report the error status.
[0024] In a possible implementation, the signal processing module uniformly encapsulates the vehicle light control signal value and sends it to the target application, including:
[0025] The signal processing module uniformly encapsulates the vehicle light control signal value according to the preset vehicle light control signal sending cycle and sends the result to the target application, and then sets the message receiving flag position to 0.
[0026] In a possible implementation, the vehicle light control method based on AutoSAR further includes:
[0027] The signal processing module receives the sending message sequence number of the headlight feedback message sent by the target application, calls a preset sending message function to verify the headlight feedback message, fills the frame count value and the verification value into the headlight feedback message, and then sends the headlight feedback message to the basic software layer;
[0028] The basic software layer determines whether the headlight feedback message has timed out. If so, the basic software layer triggers a preset message sending timeout callback function to enable the target application to resend the headlight feedback message; if not, the headlight feedback message is sent to the target controller.
[0029] A second aspect of the present application provides a vehicle light control system based on AutoSAR, including a signal processing module, wherein the signal processing module is used to:
[0030] After receiving the headlight control message and the verification instruction, calling a preset message verification function to perform end-to-end data verification on the headlight control message to obtain a verification result; the headlight control message includes a target headlight control signal, a cyclic redundancy check code and a frame counter;
[0031] If the verification result is successful, using the target vehicle light control signal to update the vehicle light control signal value;
[0032] If the verification result is failure, the signal processing module maintains the vehicle light control signal value;
[0033] The car light control signal values are uniformly packaged and sent to the target application.
[0034] A third aspect of the present application provides a vehicle, wherein the vehicle is equipped with an electronic device, wherein the electronic device includes a memory and a processor;
[0035] The memory is used to store at least one instruction;
[0036] The processor is used to execute the at least one instruction to implement the vehicle light control method of the first aspect or any implementation manner of the first aspect.
[0037] A fourth aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the vehicle light control method of the first aspect or any implementation of the first aspect.
[0038] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the vehicle light control method of the first aspect or any implementation of the first aspect.
[0039] By means of the above technical scheme, an embodiment of the present application provides a headlight control method and related devices based on AutoSAR. The headlight control system based on AutoSAR includes a signal processing module. After receiving the headlight control message and the verification instruction, the signal processing module calls a preset message verification function to perform end-to-end data verification on the headlight control message to obtain a verification result. The headlight control message includes a target headlight control signal, a cyclic redundancy check code and a frame counter. If the verification result is successful, the signal processing module uses the target headlight control signal to update the headlight control signal value. If the verification result is a failure, the signal processing module maintains the headlight control signal value. The signal processing module uniformly encapsulates the headlight control signal value and sends it to the target application. This scheme implements the verification of the headlight control message through the signal processing module, thereby improving the reliability of the bidirectional end-to-end headlight control between the headlight control system and the controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0041] Figure 1A schematic diagram of the architecture of an AutoSAR-based vehicle light control system provided in this application;
[0042] Figure 2 A schematic flow chart of a vehicle light control method based on AutoSAR provided in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of a data structure of an MP module provided in an embodiment of the present application;
[0044] Figure 4 A signal interaction diagram for end-to-end communication provided in an embodiment of the present application;
[0045] Figure 5 A schematic flow chart of a vehicle light control method based on AutoSAR provided in an embodiment of the present application;
[0046] Figure 6 Another signal interaction diagram for end-to-end communication provided in an embodiment of the present application;
[0047] Figure 7 A schematic flow chart of a vehicle light control method based on AutoSAR provided in an embodiment of the present application;
[0048] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0050] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0051] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0052] The embodiment of the present application provides a vehicle light control system based on AutoSAR, and the vehicle light control system based on AutoSAR includes a signal processing module, Figure 1 The present invention provides a flow chart of a method for controlling vehicle lights based on AutoSAR, which can be applied to the MP module newly added in the AutoSAR vehicle light control system. Figure 1 As shown, the method includes:
[0053] S101. After receiving a headlight control message and a verification instruction, the signal processing module calls a preset message verification function to perform end-to-end data verification on the headlight control message to obtain a verification result.
[0054] In this embodiment, the vehicle light control message includes a target vehicle light control signal, a cyclic redundancy check code and a frame counter.
[0055] S102: If the verification result is successful, the signal processing module uses the target headlight control signal to update the headlight control signal value.
[0056] S103: If the verification result is failure, the signal processing module maintains the vehicle light control signal value.
[0057] S104: The signal processing module uniformly encapsulates the vehicle light control signal values and sends them to the target application.
[0058] It can be seen from the above technical solution that an AutoSAR-based vehicle light control method provided in an embodiment of the present application adds a signal processing module in AutoSAR, implements the inspection of vehicle light control messages through the signal processing module, and improves the reliability of bidirectional end-to-end vehicle light control between the vehicle light control system and the controller.
[0059] Furthermore, the embodiment of the present application provides a specific structure of a vehicle light control system based on AutoSAR. Figure 2 A specific architecture diagram of a vehicle light control system based on AutoSAR provided in an embodiment of the present application, such as Figure 2As shown in the figure, the headlight control system includes an application layer ASW, a runtime environment layer RTE, a signal processing module MP, and a basic software layer BSW. The BSW layer includes CANIf, NM, CANTp, PduR routing module, Com layer, CAN driver layer CAN Driver, and Driver abstraction layer MCAL. Among them, BSW can be configured and form a standard callback interface function. MCAL performs logical abstraction on the CAN driver layer and generates a standard function interface. It can be configured and form a standard callback interface function. The top layer of the headlight control system is the application layer ASW related to the headlight application function. The middle layer is the runtime environment RTE layer and the signal processing module MP. The callback function interface generated by the Com communication layer configuration of the protocol stack first performs E2E verification on the communication data uniformly through the MP module, and then is uniformly encapsulated in the RTE layer into a standard interface for the function module of the ASW layer to call, thereby ensuring the reliability of the bidirectional point-to-point headlight signal communication data between the headlight control system and the microprocessor.
[0060] In this embodiment, the MP module in the headlight control system, the sub-function modules in the ASW layer, and all function interfaces generated by the BSW layer are encapsulated in the RTE layer through secondary standard interface encapsulation. All modules can implement cross-module calls through RTE, thereby realizing software decoupling between the ASW and BSW function modules. To modify the ASW sub-function module, it is only necessary to modify the corresponding functions of the corresponding sub-function modules and MP modules in the ASW layer. The BSW layer and CAN Driver do not need to be modified. Thus, an efficient software development platform architecture with reliable communication is formed, which can perform rapid iterative development according to software changes, improve software development efficiency and improve quality.
[0061] It should be noted that the AutoSAR-based headlight control system provided in the embodiment of the present application improves the reliability and security of communication between smart car communication ECUs. At the same time, the headlight control system greatly reduces the coupling between software and hardware. The ASW layer only needs to adapt the input and output RTE interfaces to realize the update and iteration of the entire software function, which improves the portability of the software, greatly reduces development time, reduces manual code modification, and improves the robustness and quality of the software.
[0062] In one possible implementation, a data structure is pre-constructed in the MP module. The data structure is used to store multiple configuration parameters and parameter values in the form of an array. The data structure can be accessed by various functional modules in the headlight control system. Each functional module can read, modify and assign parameter values of corresponding configuration parameters by calling preset functions.
[0063] Figure 3 A schematic diagram of a data structure of an MP module provided in an embodiment of the present application. Figure 3 As shown, the data structure includes a first structure mp_RdMsgCfgInfo_t and a second structure mp_RxMsgInfo_t for storing received message configuration parameters, a third structure mp_WrMsgCfgInfo_t for storing sent message configuration parameters, and a fourth structure mp_NodeCfgTnfo_t for storing node loss configuration parameters.
[0064] Among them, the received message configuration parameters include message left and right light node attributes, received message initialization, received message, whether to notify message errors, the sequence number of the lost node, the bit identifier BitId of the lost message, the callback function, the message loss count, the message reception count, the message reception flag, the message timeout flag, the message initialization flag, the message initialization completion flag, the message status, the message timeout counter, the message reception counter, the message e2e verification failure counter, and the message e2e verification success counter.
[0065] It should be noted that the network node is a main controller that includes multiple (sending and receiving) CAN messages, such as a CEM (central controller) or a gateway GW. By adding the configuration parameters of the lost node in the data structure of the MP module, the loss status of various main controllers (network nodes) and the loss status of the messages they send are described. In this embodiment, the loss status of the CEM and the loss status of the messages it sends are recorded.
[0066] The message sending configuration parameters include the message sending sequence number, message sending initialization, and message sending function.
[0067] The node loss configuration data parameters include the node loss mask, the DTC error code corresponding to the loss error, and whether to notify the node error.
[0068] It should be noted that the specific data storage form of the data structure can refer to the prior art.
[0069] In this embodiment, the microprocessor that performs end-to-end communication with the vehicle light control system is the vehicle central controller CEM. Figure 4 This is a signal interaction diagram for receiving a vehicle light control signal provided by an embodiment of the present application. This method enables the ASW in the vehicle light control system to receive the vehicle light control signal sent by the vehicle central controller CEM. Figure 4As shown, after the headlight control system receives the communication data carrying the headlight control signal through the CAN driver layer, it sends the communication data to the Com layer for processing through the PduR routing module and sends the processed communication data as communication data to be verified to the MP module. The MP module performs E2E verification on the communication data to be verified. After the verification passes, the communication data is encapsulated through the standard interface of RTE for calling by various functional modules of the ASW layer.
[0070] Correspondingly, Figure 5 A flow chart of a vehicle light control method based on AutoSAR provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the method includes:
[0071] S501. The vehicle central controller CEM sends a headlight control message to a headlight control system according to a preset signal sending cycle.
[0072] In this embodiment, the vehicle central controller CEM sends the headlight control signal according to the control signal sending cycle. Optionally, in response to reaching the signal sending time of the nth control signal sending cycle, the CEM sends a headlight control message to the CAN Driver in the headlight control system. The headlight control message includes the target headlight control signal, a cyclic redundancy check code CRC and a frame counter. The headlight control signal consists of 8 bytes of data. It should be noted that the specific message structure of the headlight control message can be pre-configured.
[0073] In this embodiment, n is an integer greater than 1.
[0074] S502: After receiving the headlight control message, the CAN Driver forwards the headlight control message to the CANIf layer.
[0075] S503, after the headlight control message enters the CANIf layer, the CANIf layer determines whether the headlight control message satisfies: the message attribute is configured as PduR, if so, the headlight control message is routed and sent to the Com layer through the PduR module.
[0076] S504, after receiving the headlight control message, the Com layer determines whether the receiving interval of the headlight control message has timed out, and if so, triggers the preset message receiving timeout callback function to execute the message timeout logic. If not, triggers the preset message normal receiving function to execute the message receiving logic.
[0077] In this embodiment, it is determined whether the reception interval of the vehicle light control message exceeds the preset time threshold. If it exceeds, it indicates a timeout. The first modification method of the parameter values of the message reception flag bit recvFlg, the message reception counter ReceiveCnt, the message reception timeout flag bit timeoutFlg, and the message timeout counter timeOutCnt is predefined in the message reception timeout callback function, so that the message reception timeout callback function is called and the message timeout logic is executed. The message timeout logic is to set the message reception flag bit recvFlg to 0, clear the message reception counter ReceiveCnt, set the message reception timeout flag bit timeoutFlg to 1, and increase the message timeout counter timeOutCnt by 1.
[0078] In this embodiment, a second modification method for the parameter values of the message receiving flag recvFlg, the message receiving counter ReceiveCnt, the message receiving timeout flag timeoutFlg, and the message timeout counter timeOutCnt is predefined in the normal message receiving function, so that the message receiving logic is executed after the normal message receiving function is called. The message receiving logic is to set the message receiving flag recvFlg to 1, add 1 to the message receiving counter ReceiveCnt, set the message receiving timeout flag timeoutFlg to 0, and clear the message timeout counter timeOutCnt.
[0079] In this embodiment, the reception interval of the headlight control message refers to the interval between the current message reception time and the last message reception time, and the timeout period is configured to be 1.5 times the preset message reception period, where the message reception period can be synchronized with the control signal sending period.
[0080] S505. The Com layer determines whether the message receiving counter ReceiveCnt is not less than the preset receiving count threshold recvCnt. If ReceiveCnt≥recvCnt, execute S506 and subsequent steps. If ReceiveCnt<recvCnt, wait for the next reception of the headlight control message and return to execute S504.
[0081] S506. If ReceiveCnt≥recvCnt, the Com layer clears the target network node and target message loss status according to the sequence number nodeId of the target network node and the bit identifier loseBitId of the target message, and updates the target network node status groupSts.
[0082] In this embodiment, the target network node is the vehicle central controller CEM, and the target message is the vehicle light control message.
[0083] S507, the Com layer determines whether the message reception timeout flag timeoutFlg is 1, if timeoutFlg=1, execute S508~S511. If timeoutFlg≠1, execute S512 and subsequent steps.
[0084] S508: If timeoutFlg=1, the Com layer determines whether the message timeout counter timeOutCnt is not less than a preset timeout count threshold lostCnt.
[0085] S509: If timeoutFlg=1 and timeOutCnt≥lostCnt, according to the target network node sequence number nodeId and the bit identifier loseBitId of the target message, the target network node and the target message loss status are set to 1 at the same time, and then the network node status groupSts is updated.
[0086] S510: If timeoutFlg=1 and timeOutCnt<lostCnt, determine whether the message timeout counter timeOutCnt is not less than a preset timeout check count threshold E2E_TIMEOUT_LIMIT_CNT.
[0087] S511. If timeOutCnt≥E2E_TIMEOUT_LIMIT_CNT, set the end-to-end E2E communication error status to 1, and then execute S518.
[0088] S512. If timeoutFlg≠1, the Com layer determines whether the message receiving flag bit recvFlg is 1. If recvFlg=1, execute S513. If recvFlg≠1, execute S520.
[0089] S513. The COM layer sends the vehicle light control message and verification instruction to the MP module.
[0090] S514. After receiving the headlight control message and the verification instruction, the MP module calls the preset message verification function readE2EFunc to perform E2E end-to-end data verification on the headlight control message to obtain the E2E verification result msgSts.
[0091] In this embodiment, the basic logic of E2E is to receive the message first, ensure that it is the latest received message data, that is, recvFlg=1, and then verify the latest received message. This process can ensure that the latest data is involved in the verification, and the E2E verification failure will not be caused by data loss.
[0092] S515. If msgSts is successful, the MP module adds 1 to the E2E verification success counter e2eSucessCnt, clears the E2E verification failure counter e2eFailCnt, and uses the light control message to update the light control signal value, and then executes S520.
[0093] In this embodiment, the target vehicle light control signal in the vehicle light control message is used to update the vehicle light control signal value.
[0094] S516. If msgSts is a failure, the MP module clears e2eSucessCnt, adds 1 to e2eFailCnt, and maintains the vehicle light control signal value.
[0095] S517: The MP module determines whether e2eFailCnt is not less than the preset E2E verification failure counter threshold value E2E_FAIL_LIMIT. If e2eFailCnt≥E2E_FAIL_LIMIT, execute S518; if e2eFailCnt<E2E_FAIL_LIMIT, execute S520.
[0096] S518, the MP module determines whether to report the error status to other modules, if so, execute S519, if not, execute S520.
[0097] Specifically, it is determined whether the notification node error flag isErrNotification is equal to 1. If isErrNotification=1, it is determined that the error status is reported to notify other modules. If isErrNotification≠1, it is determined that there is no need to report the error status to notify other modules.
[0098] S519. After the MP module calls the callback function feedFunc, S520 is executed.
[0099] S520: After the MP module uniformly encapsulates the vehicle light control signal value into Rte, it sets the message receiving flag bit recvFlg to 0.
[0100] S521. The MP module determines whether the node status groupSts is equal to the node loss mask lostMask. If so, the DTC error code corresponding to the loss error is recorded. If not, the DTC error code corresponding to the loss error is recorded.
[0101] In summary, in the process of the headlight control system receiving the headlight control signal sent by the CEM, the MP module performs E2E end-to-end data verification on the headlight control message to improve the security and reliability of the headlight control signal, and the data structure configured in the MP module uniformly manages and processes all message reception, all network node loss status and status processing, message timeout loss status and status processing, and E2E end-to-end communication status and communication status processing. Based on the data structure, each module accesses, calls, modifies, and assigns configuration parameters in the data structure to achieve data sharing, reduce data interaction between modules, reduce communication resource requirements, and avoid data recognition errors caused by differences in data format configurations in different modules.
[0102] Figure 6 This is a signal interaction diagram for sending a vehicle light control signal provided by an embodiment of the present application. Figure 6 As shown, ASW calls RTE to send the headlight feedback message to the MP module. After the MP module performs E2E end-to-end data verification on the headlight feedback message, it feeds back the headlight feedback message to BSW. BSW sends the headlight feedback message to CEM if the headlight feedback message does not time out.
[0103] Correspondingly, Figure 7 A flow chart of a vehicle light control method based on AutoSAR provided in an embodiment of the present application is provided. The method realizes that the vehicle light control system feeds back the vehicle light feedback signal of the ASW layer to the central controller CEM, such as Figure 7 As shown, the method includes:
[0104] S701. The vehicle light control system calls a preset message sending initialization function WriteInitFunc during system initialization to initialize the message to be sent and the third structure mp_WrMsgCfgInfo_t.
[0105] S702. The ASW calls the message sending function WriteE2EFunc according to the preset signal feedback cycle and fills in the vehicle light feedback signal to be sent to generate a vehicle light feedback message.
[0106] In this embodiment, the ASW sends a headlight feedback message filled with the headlight feedback signal according to the feedback signal sending cycle.
[0107] S703, ASW determines whether the headlight feedback message needs E2E end-to-end data verification. If so, ASW sends the headlight feedback message and verification instruction to the MP module to execute S704. If not, ASW sends the headlight feedback message to the COM layer to execute S705.
[0108] S704. The MP module calls the corresponding sending message function WriteE2EFunc according to the sending message sequence number idx of the headlight feedback message, performs E2E check on the headlight feedback message, fills the frame count value and CRC check value into the sending bit position in the headlight feedback message, and sends the headlight feedback message to the COM layer.
[0109] S705. The COM layer determines whether the vehicle light feedback message has timed out.
[0110] In this embodiment, the COM layer calls a preset monitoring function COMbkTxTOut according to a preset period to monitor whether the reception interval of the vehicle light feedback message has timed out.
[0111] The reception interval of the headlight feedback message refers to the interval between the message reception time of the current headlight feedback message and the message reception time of the last headlight feedback message, and the timeout period is configured as a preset message sending cycle.
[0112] S706. If the timeout occurs, the COM layer triggers the preset message sending timeout callback function COMCbkTxTOut, returns to execute S702, and calls the preset message sending function WriteE2EFunc to send the message once.
[0113] S707: If it has not timed out, the PduR routing module routes the headlight feedback message to the CANIf layer, and then the CANIf layer calls the Can_Write callback function preset by the CAN Driver to send the headlight feedback message to the CEM.
[0114] It can be seen from the above technical solution that in the process of the headlight control system sending the headlight feedback signal to the CEM, the headlight feedback message is E2E end-to-end data verified in the MP module and resent when the message times out, thereby improving the security and reliability of the headlight feedback signal.
[0115] In summary, this solution adds an MP module to the standard AUTOSAR architecture, and decouples the ASW module, MP module, and CAN underlying driver related to the headlight function through the RTE module. When the ASW module changes its function, no other module code is required, which greatly improves the work efficiency of software integration development, improves the robustness of software quality, and reduces the development cost of software integration. At the same time, the newly added MP module greatly improves the reliability of point-to-point communication, thereby improving the safety of smart car driving.
[0116] It should be noted that the AutoSAR-based headlight control method provided in the embodiment of the present application can be specifically applied to the periodic end-to-end headlight signal interaction between the vehicle central controller and the headlight control system. Specifically, the vehicle central controller sends a headlight control message to the headlight control system. After receiving the headlight control message, the headlight control system controls the headlight to execute the lighting instruction carried by the headlight control message, and periodically monitors the headlight operating status (normal or faulty), and sends a headlight feedback message carrying the headlight operating status signal to the vehicle central controller.
[0117] The present application also provides a vehicle in an embodiment, wherein the vehicle is equipped with electronic equipment. Figure 8 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0118] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0119] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a memory card, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0120] Also provided in an embodiment of the present application is a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any AutoSAR-based vehicle light control method provided in an embodiment of the present application.
[0121] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any AutoSAR-based vehicle light control method provided in the embodiment of the present application.
[0122] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0123] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0124] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0125] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A vehicle light control method based on AutoSAR, characterized in that: Applied to a vehicle light control system based on AutoSAR, the vehicle light control system based on AutoSAR includes a signal processing module, and the vehicle light control method based on AutoSAR includes: After receiving the headlight control message and the verification instruction, the signal processing module calls a preset message verification function to perform end-to-end data verification on the headlight control message to obtain a verification result; the headlight control message includes a target headlight control signal, a cyclic redundancy check code and a frame counter; If the verification result is successful, the signal processing module uses the target vehicle light control signal to update the vehicle light control signal value; if the verification result is failed, the signal processing module maintains the vehicle light control signal value; The signal processing module uniformly encapsulates the vehicle light control signal values and sends them to the target application.
2. The vehicle light control method based on AutoSAR according to claim 1, characterized in that: The vehicle light control system based on AutoSAR further includes a basic software layer, and the vehicle light control method based on AutoSAR further includes: The basic software layer receives the vehicle light control message sent by the target controller; The basic software layer determines whether the reception interval of the headlight control message exceeds a preset time threshold, and obtains a timeout judgment result, wherein the reception interval is the interval between the last reception of the headlight control message and the reception of the headlight control message; The basic software layer triggers one of a preset message reception timeout callback function or a preset message normal reception function based on the timeout judgment result; Wherein, the message reception timeout callback function is used to execute the message timeout logic when the timeout judgment result is timeout, and the message timeout logic includes: setting the message reception flag position to 0, clearing the message reception counter, setting the message reception timeout flag position to 1, and adding 1 to the message timeout counter; The message normal reception function is used to execute the message reception logic when the timeout judgment result is no timeout. The message reception logic includes: setting the message reception flag position to 1, adding 1 to the message reception counter, setting the message reception timeout flag position to 0, and clearing the message timeout counter.
3. The vehicle light control method based on AutoSAR according to claim 2, characterized in that: After the basic software layer triggers one of a preset message reception timeout callback function or a preset message normal reception function based on the timeout judgment result, the vehicle light control method based on AutoSAR further includes: The basic software layer sends the vehicle light control message and the verification instruction to the signal processing module when the timeout flag is not 1 and the message reception flag is 1; The basic software layer clears the loss status of the target controller and the loss status of the headlight control message according to the sequence number of the target controller and the identifier of the headlight control message when the message reception counter is not less than a preset reception count threshold; The basic software layer sets the loss status of the target controller and the headlight control message to 1 according to the sequence number of the target controller and the bit identifier of the headlight control message when the timeout flag is 1 and the message timeout counter is not less than a preset timeout count threshold; When the timeout flag is 1, the message timeout counter is less than the preset timeout count threshold, and the message timeout counter is not less than the preset timeout check count threshold, the basic software layer sets the end-to-end communication error state to 1 and calls the preset callback function to report the error state.
4. The vehicle light control method based on AutoSAR according to claim 3, characterized in that: The signal processing module uniformly encapsulates the vehicle light control signal value and sends it to the target application, including: If the verification result is successful, the signal processing module adds 1 to the verification success counter, clears the verification failure counter, and uniformly encapsulates the vehicle light control signal value and sends it to the target application; If the verification result is a failure, the signal processing module clears the verification success counter, adds 1 to the verification failure counter, and uniformly encapsulates the vehicle light control signal value and sends it to the target application; If the verification failure counter is not less than the preset E2E verification failure counter threshold, the callback function is called to report the error status.
5. The vehicle light control method based on AutoSAR according to claim 4, characterized in that: The signal processing module uniformly encapsulates the vehicle light control signal value and sends it to the target application, including: The signal processing module uniformly encapsulates the vehicle light control signal value according to the preset vehicle light control signal sending cycle and sends the result to the target application, and then sets the message receiving flag position to 0.
6. The vehicle light control method based on AutoSAR according to claim 2, characterized in that: The AutoSAR-based vehicle light control method further includes: The signal processing module receives the sending message sequence number of the headlight feedback message sent by the target application, calls a preset sending message function to verify the headlight feedback message, fills the frame count value and the verification value into the headlight feedback message, and then sends the headlight feedback message to the basic software layer; The basic software layer determines whether the headlight feedback message has timed out. If so, the basic software layer triggers a preset message sending timeout callback function to enable the target application to resend the headlight feedback message; if not, the headlight feedback message is sent to the target controller.
7. A vehicle light control system based on AutoSAR, characterized in that: A signal processing module is included, wherein the signal processing module is used for: After receiving the headlight control message and the verification instruction, calling a preset message verification function to perform end-to-end data verification on the headlight control message to obtain a verification result; the headlight control message includes a target headlight control signal, a cyclic redundancy check code and a frame counter; If the verification result is successful, using the target vehicle light control signal to update the vehicle light control signal value; If the verification result is failure, the signal processing module maintains the vehicle light control signal value; The car light control signal values are uniformly packaged and sent to the target application.
8. A vehicle, characterized in that: The vehicle is equipped with an electronic device, the electronic device comprising a memory and a processor; The memory is used to store at least one instruction; The processor is used to execute the at least one instruction to implement the AutoSAR-based vehicle light control method according to any one of claims 1 to 6.
9. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the vehicle light control method based on AutoSAR as claimed in any one of claims 1 to 6.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the AutoSAR-based vehicle light control method as described in any one of claims 1 to 6.