Lin diagnostic test method, electronic device, and storage medium
By pre-configuring LIN diagnostic test parameters and methods, fully automated LIN diagnostic testing of domain controllers is achieved, solving the problems of real vehicle resource limitations and time-consuming manual bench testing, and improving testing efficiency and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU AUTOMOBILE GROUP CO LTD
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-05
Smart Images

Figure CN122151816A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle software technology, and in particular to a LIN diagnostic testing method, electronic device, and storage medium. Background Technology
[0002] With the development of vehicle technology, vehicle functions are becoming increasingly diversified. The realization of these functions relies on diagnostic services, and the normality and performance of these services directly affect the overall functionality and performance of the vehicle. Nodes used to implement vehicle functions typically communicate with the domain controller via LIN (Local Interconnect Network). Therefore, LIN diagnostic testing is a crucial part of overall vehicle functional testing.
[0003] The testing methods for LIN diagnostics in related technologies include real vehicle testing and bench manual testing. However, real vehicle testing is easily limited by real vehicle resources, and the test vehicle may not be equipped with all the LIN nodes of the mass-produced vehicle, resulting in some LIN nodes being untestable. Bench manual testing requires a lot of time for debugging and modification of test parameters, and requires manual verification of response messages. Thus, the testing efficiency of LIN diagnostics in related technologies is low. Summary of the Invention
[0004] In view of the above, it is necessary to provide a LIN diagnostic testing method, electronic device and storage medium to solve the problems that the above-mentioned real vehicle testing is easily limited by real vehicle resources, some LIN nodes cannot be tested, and bench manual testing requires a lot of time for debugging and test parameter modification, and requires manual verification of response messages, resulting in low efficiency of LIN diagnostic testing.
[0005] In a first aspect, embodiments of this application provide a LIN diagnostic testing method, the method comprising: The domain controller sends a diagnostic request message to the target LIN node, the diagnostic request message including the node address and data identifier; If the node address is the same as the target node address of the target LIN node, and the data identifier is the same as the target data identifier of the target LIN node, determine whether the LIN controller of the target LIN node supports long frames; If the LIN controller supports long frames, it delays for a first scheduling time and sends the first frame diagnostic response message. The first scheduling time is the preset first frame LIN message diagnostic scheduling time. After a second scheduling time delay, continuous frame diagnostic response messages are sent, where the second scheduling time is the preset scheduling time for subsequent frame LIN message diagnostics. If the data identifier in the diagnostic response message is the same as the target data identifier, and the response value in the diagnostic response message matches the expected LIN diagnostic response value, then the diagnostic service of the domain controller is deemed qualified.
[0006] In one possible implementation, the method further includes: If the diagnostic response message has not been completely sent, determine the protocol control information for the next consecutive frame of diagnostic response messages; After delaying the second scheduling time, the next consecutive frame diagnostic response message is sent based on the protocol control information.
[0007] In one possible implementation, the method further includes: If the LIN controller does not support long frames, the first scheduling time is delayed, and a single-frame diagnostic response message is sent. After delaying the second scheduling time, another single-frame diagnostic response message is sent.
[0008] In one possible implementation, the method further includes: If the diagnostic response message has not been completely sent, determine the data identifier for the next single-frame diagnostic response message; After delaying the second scheduling time, the next single-frame diagnostic response message is sent based on the data identifier of the next single-frame diagnostic response message.
[0009] In one possible implementation, sending a diagnostic request message to the target LIN node via the domain controller includes: If a data identifier is associated with the diagnostic configuration of the diagnostic service, the data identifier is written into the configuration information of the diagnostic service; The domain controller sends the diagnostic request message to the target LIN node based on the data identifier.
[0010] In one possible implementation, the method further includes: Based on the vehicle model and the data type parameters of the LIN controller, configure the data identifiers of multiple LIN nodes that communicate with the domain controller; Configure the first scheduling time and the second scheduling time based on the LIN scheduling table in the LIN application message communication matrix.
[0011] In one possible implementation, the method further includes: Configure the desired LIN diagnostic response value based on the LIN diagnostic message communication matrix; Based on the diagnostic address list, configure the LIN channels and node addresses of multiple LIN nodes that communicate with the domain controller.
[0012] In one possible implementation, the method further includes: Based on the LIN diagnostic message communication matrix, a diagnostic scheduling method, a diagnostic response message sending format, and a check range for the response values of the diagnostic response messages are designed for multiple LIN nodes communicating with the domain controller.
[0013] Secondly, embodiments of this application provide an electronic device, which includes a memory and a processor; wherein the memory is used to store program instructions; and the processor is used to read and execute the program instructions stored in the memory, such that when the program instructions are executed by the processor, the electronic device performs the aforementioned LIN diagnostic test method.
[0014] Thirdly, embodiments of this application provide a LIN diagnostic testing apparatus, the apparatus comprising: a first sending module, configured to send a diagnostic request message to a target LIN node via a domain controller, the diagnostic request message including a node address and a data identifier; a judging module, configured to judge whether the LIN controller of the target LIN node supports long frames if the node address is the same as the target node address of the target LIN node and the data identifier is the same as the target data identifier of the target LIN node; a second sending module, configured to send a first frame diagnostic response message after a first scheduling time if the LIN controller supports long frames, the first scheduling time being a preset first frame LIN message diagnostic scheduling time; the second sending module is further configured to send consecutive frame diagnostic response messages after a second scheduling time, the second scheduling time being a preset subsequent frame LIN message diagnostic scheduling time; and a determining module, configured to determine that the diagnostic service of the domain controller is qualified if, after the diagnostic response message has been sent, the data identifier in the diagnostic response message is the same as the target data identifier and the response value in the diagnostic response message matches the expected LIN diagnostic response value.
[0015] Fourthly, embodiments of this application provide a computer storage medium that, when the program instructions are executed on an electronic device, causes the processor of the electronic device to execute the aforementioned LIN diagnostic test method.
[0016] The LIN diagnostic testing method, apparatus, electronic device, and storage medium provided in this application can achieve fully automated LIN diagnostic testing of domain controllers by pre-configuring LIN diagnostic testing parameters and pre-designing LIN diagnostic testing methods, effectively improving the efficiency and reliability of LIN diagnostic testing. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is a schematic diagram illustrating an application scenario of the LIN diagnostic testing method provided in one embodiment of this application.
[0019] Figure 2 This is a flowchart of a LIN diagnostic test configuration provided in an embodiment of this application.
[0020] Figure 3 This is a flowchart of a LIN diagnostic testing method provided in an embodiment of this application.
[0021] Figure 4 This is a schematic diagram of the structure of a LIN diagnostic testing device provided in an embodiment of this application.
[0022] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] The terms "first" and "second" used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to limit the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" refers to one or more. "More than one" refers to two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. Where there is no conflict, the following embodiments and features described herein can be combined with each other.
[0025] With the development of vehicle technology, vehicle functions are becoming increasingly diversified. The realization of these functions relies on diagnostic services, and the normality and performance of these services directly affect the overall functionality and performance of the vehicle. Nodes used to implement vehicle functions typically communicate with domain controllers via LIN (Linux Instructions). Therefore, LIN diagnostic testing is a crucial part of overall vehicle functional testing.
[0026] Related technologies employ two main testing methods for LIN diagnostics: vehicle testing and bench testing. Vehicle testing involves sending LIN diagnostic commands directly to the actual vehicle and reading the corresponding LIN node data. Bench testing, on the other hand, simulates the LIN node and its diagnostic message when testing the diagnostic data of a specific LIN node. This is achieved by dynamically modifying the LIN_NAD value, LIN diagnostic message content, LIN scheduling method, LIN message frame length, and LIN scheduling time parameters, followed by manual verification of the LIN diagnostic response value. However, vehicle testing is susceptible to resource limitations, and test vehicles may not be equipped with all the LIN nodes found in production vehicles, resulting in some LIN nodes being untestable. Bench testing requires significant time for debugging and parameter modification, and manual verification of response messages. Therefore, the testing efficiency of LIN diagnostics in these technologies is relatively low.
[0027] To address the issues of limited real-vehicle resources in real-vehicle testing, the inability to test some LIN nodes, and the high time consumption for manual bench testing involving debugging and parameter modification, as well as the need for manual verification of response messages, resulting in low efficiency in LIN diagnostic testing, this application provides a LIN diagnostic testing method. By pre-configuring LIN diagnostic testing parameters and pre-designing LIN diagnostic testing methods, fully automated LIN diagnostic testing of domain controllers can be achieved, effectively improving the efficiency and reliability of LIN diagnostic testing.
[0028] See Figure 1 The diagram shown illustrates an application scenario of the LIN diagnostic testing method provided in an embodiment of this application. The LIN diagnostic testing method provided in this embodiment can be applied to… Figure 1 The LIN diagnostic test system 100 shown includes, but is not limited to, an electronic device 1 and a test bench 2, wherein a domain controller 21 and multiple LIN nodes 22 are disposed in the test bench 2. The electronic device 1 is connected to the domain controller 21 via CAN (Controller Area Network), and the domain controller 21 is connected to the multiple LIN nodes 22 via LIN.
[0029] Configure LIN diagnostic testing before performing LIN diagnostics on the domain controller. See [link / reference] Figure 2 The diagram shown is a flowchart of a LIN diagnostic test configuration provided in an embodiment of this application. The method is applied to an electronic device and includes: S101, based on vehicle model and LIN controller data parameter (DPT), configures the data identifiers of multiple LIN nodes that communicate with the domain controller.
[0030] In one embodiment of this application, vehicle functions and the topology of the LIN network can be determined based on the vehicle model. LIN nodes are configured objects, such as window motors and door lock sensors. Data identifiers (DIDs) are used for precise addressing in diagnostic communication. For example, 0xF101 represents "window position," and 0xF102 represents "motor current." Data type parameters are used to define the data type, length, and encoding format.
[0031] In one embodiment of this application, data identifiers (LIN_DID) for multiple LIN nodes are configured based on the mapping table between DID and DPT in the vehicle configuration file.
[0032] S102, based on the LIN scheduling table in the LIN application message communication matrix, configure the first scheduling time and the second scheduling time.
[0033] In one embodiment of this application, the LIN application message communication matrix is used to define detailed information about all messages (frames) in the LIN network, such as frame ID, signals contained in the frame, signal length and location, sender of the frame, receiver of the frame, etc. The LIN scheduling table is used to define the timing of message transmission in the LIN network.
[0034] In one embodiment of this application, the first scheduling time is a preset scheduling time for the diagnosis of the first LIN message, and the second scheduling time is a preset scheduling time for the diagnosis of subsequent LIN messages. When a diagnostic request arrives, the master node inserts the diagnostic frame into the schedule after a very short fixed delay, which is the first scheduling time. For example, the delay is 1-5ms to ensure a fast response to the diagnostic request. After sending the first frame, the master node waits for the LIN node to prepare and reply with data, thus requiring the setting of a delay time for sending subsequent frames. The delay time for subsequent frames is the frame time slot of the LIN message, and the frame time slot is the interval between sending two adjacent frames.
[0035] S103, based on the LIN diagnostic message communication matrix, configure the expected LIN diagnostic response value.
[0036] In one embodiment of this application, the LIN diagnostic message communication matrix includes a diagnostic identifier, node address, service identifier, data identifier, data type parameters, scheduling timing, etc. The expected LIN diagnostic response value is the correct data value that the target LIN node should return upon receiving a diagnostic request.
[0037] S104, based on the diagnostic address list, configures the LIN channels and node addresses for multiple LIN nodes communicating with the domain controller.
[0038] In one embodiment of this application, the domain controller assigns a new target NAD to each LIN node by sending the ssign NAD command.
[0039] S105, based on the LIN diagnostic message communication matrix, designs a diagnostic scheduling method for multiple LIN nodes communicating with the domain controller, a diagnostic response message sending format, and a check range for the response values of the diagnostic response messages.
[0040] In one embodiment of this application, the diagnostic scheduling method can be based on a scheduling table to achieve ordered communication. The domain controller dynamically manages the timing of diagnostic requests and regular communication through the scheduling table to ensure that diagnostic tasks are executed with priority and completeness. Designing the diagnostic scheduling method may include creating a dedicated diagnostic scheduling table, determining the diagnostic scheduling process based on the dedicated diagnostic scheduling table, and the diagnostic scheduling process may include diagnostic triggering timing, frame transmission timing, multi-node processing timing, etc.
[0041] In one embodiment of this application, the sending format of the diagnostic response message is defined based on the LIN diagnostic message communication matrix, including node address, service response identifier, data content, etc. For example, the diagnostic response message is 8 bytes of data, where Byte1 corresponds to the NAD (node address) field, Byte2 corresponds to the DID (data identifier) field, Byte3 corresponds to the PCI (protocol control information) field, Byte4 corresponds to the RSID (response service ID) field, Bytes5-6 correspond to the response value field, and Bytes7-8 correspond to padding bits.
[0042] In one embodiment of this application, the check range of the response value of the diagnostic response message includes the value range, type, invalid value handling, etc., to ensure data validity. For example, the value range is the physical value range, the type is a 16-bit unsigned integer, and the invalid value is identified as 0xFFFF (e.g., representing sensor failure).
[0043] The embodiments described above in this application can achieve fully automated LIN diagnostic testing of domain controllers by pre-configuring LIN diagnostic test parameters and pre-designing LIN diagnostic test methods, effectively improving the efficiency of LIN diagnostic testing.
[0044] See Figure 3 The diagram shows a flowchart of a LIN diagnostic testing method provided in an embodiment of this application. The method is applied to an electronic device and includes: S201, determine whether the data identifier is associated with the diagnostic configuration of the diagnostic service. If the data identifier is associated with the diagnostic configuration of the diagnostic service, the process proceeds to S202; if the data identifier is not associated with the diagnostic configuration of the diagnostic service, the process continues to S201.
[0045] In one embodiment of this application, the system determines whether data identifiers are associated with diagnostic configurations for diagnostic services based on the Software Requirements Specification (SRS). The SRS explicitly specifies the configuration requirements for data identifiers of each node in the LIN network, such as whether certain data identifiers need to be pre-configured before system startup or specific operations.
[0046] S202, Write the data identifier into the configuration information of the diagnostic service.
[0047] S203 sends a diagnostic request message to the target LIN node through the domain controller. The diagnostic request message includes the node address and data identifier.
[0048] In one embodiment of this application, a diagnostic request message is sent to the target LIN node by a domain controller based on a data identifier, wherein the diagnostic request message is a 3C message.
[0049] S204: Determine whether the node address is the same as the target node address of the target LIN node, and determine whether the data identifier is the same as the target data identifier of the target LIN node. If the node address is the same as the target node address of the target LIN node, and the data identifier is the same as the target data identifier of the target LIN node, the process proceeds to S205; if the node address is different from the target node address of the target LIN node, or the data identifier is different from the target data identifier of the target LIN node, the process proceeds to S214.
[0050] S205, determine whether the LIN controller of the target LIN node supports long frames. If the LIN controller supports long frames, proceed to S206; if the LIN controller does not support long frames, proceed to S215.
[0051] In one embodiment of this application, in LIN diagnostic testing, a long frame refers to a multi-frame transmission mechanism used when the amount of data to be transmitted exceeds the payload capacity of a single LIN frame. The data length of a long frame is typically greater than 6 bytes. Protocol units sequentially use the first frame, followed by one or more consecutive frames. The multi-frame transmission process includes: sending the first frame, specifying the total length; the receiver responding with a flow control frame to coordinate transmission; the sender sending multiple consecutive frames in sequence; and the receiver reassembling the data. When the LIN controller does not support long frames, short frames are used. A short frame is a single-frame transmission mechanism with a data length less than or equal to 6 bytes. Protocol units use only a single frame, and the single-frame transmission process involves sending and receiving the data in one go.
[0052] S206, after a first scheduling time delay, send the first frame diagnostic response message. The first scheduling time is the preset first frame LIN message diagnostic scheduling time.
[0053] S207, after a second scheduling time delay, send continuous frame diagnostic response messages. The second scheduling time is the preset scheduling time for subsequent frame LIN message diagnostics.
[0054] S208, determine whether the diagnostic response message has been sent completely. If the diagnostic response message has been sent completely, proceed to S209; if the diagnostic response message has not been sent completely, proceed to S210.
[0055] S209, Monitoring and Diagnostic Response Message.
[0056] S210, PCI+1, then the process returns to S207.
[0057] In one embodiment of this application, if the diagnostic response message has not been completely sent, the protocol control information for the next consecutive frame diagnostic response message is determined, a second scheduling time is delayed, and the next consecutive frame diagnostic response message is sent based on the protocol control information. The protocol control information is an identifier for the consecutive frames.
[0058] S211, determine whether the diagnostic response message is a waiting diagnostic response message. If the diagnostic response message is a waiting diagnostic response message, the process proceeds to S212; if the diagnostic response message is not a waiting diagnostic response message, the process returns to S209.
[0059] S212, determine whether the data identifier in the diagnostic response message is the same as the target data identifier, and determine whether the response value in the diagnostic response message matches the expected LIN diagnostic response value. If the data identifier in the diagnostic response message is the same as the target data identifier, and the response value in the diagnostic response message matches the expected LIN diagnostic response value, the process proceeds to S213; if the data identifier in the diagnostic response message is different from the target data identifier, or the response value in the diagnostic response message does not match the expected LIN diagnostic response value, the process proceeds to S214.
[0060] S213, Determine that the diagnostic service for the domain controller is qualified.
[0061] S214, the diagnostic service for the domain controller is deemed unqualified.
[0062] S215, after a delay of the first scheduling time, sends a single-frame diagnostic response message.
[0063] S216, after a second scheduling time delay, send another single-frame diagnostic response message.
[0064] S217, determine whether the diagnostic response message has been sent completely. If the diagnostic response message has been sent completely, the process proceeds to S209; if the diagnostic response message has not been sent completely, the process proceeds to S218.
[0065] S218, DID+1, then the process returns to S216.
[0066] In one embodiment of this application, if the diagnostic response message has not been completely sent, a data identifier for the next single-frame diagnostic response message is determined, a second scheduling time is delayed, and the next single-frame diagnostic response message is sent based on the data identifier. Here, the data identifier is the identifier of a single frame.
[0067] The embodiments described above perform LIN diagnostic testing of domain controllers based on pre-configured LIN diagnostic test parameters and pre-designed LIN diagnostic test methods. Compared to actual vehicle testing or manual bench testing, these embodiments are not limited by actual vehicle resources or LIN load. Furthermore, they transform the previously fragmented and manually executed LIN diagnostic testing into fully automated testing, eliminating the need for manual modification of test parameters and manual observation of diagnostic response data. This method, through fully automated bench LIN diagnostic testing, significantly improves testing efficiency and offers higher reliability and efficiency compared to manual verification. These embodiments can also configure different message sending methods based on whether the LIN controller supports long frames, effectively improving the adaptability of LIN diagnostic testing.
[0068] See Figure 4 The diagram shown is a structural schematic of a LIN diagnostic testing apparatus provided in one embodiment of this application. In one embodiment of this application, the LIN diagnostic testing apparatus 200 may include multiple functional modules composed of computer program segments. The computer program segments in the LIN diagnostic testing apparatus 200 may be stored in the memory of an electronic device and executed by at least one processor to perform the LIN diagnostic testing method function.
[0069] In one embodiment of this application, the LIN diagnostic testing device 200 can be divided into multiple functional modules according to the functions it performs. The functional modules of the LIN diagnostic testing device 200 may include: a first sending module 201, a judging module 202, a second sending module 203, and a determining module 204. In this embodiment, a module refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, and are stored in memory.
[0070] The first sending module 201 is used to send a diagnostic request message to the target LIN node through the domain controller. The diagnostic request message includes the node address and data identifier.
[0071] The judgment module 202 is used to determine whether the LIN controller of the target LIN node supports long frames if the node address is the same as the target node address of the target LIN node and the data identifier is the same as the target data identifier of the target LIN node.
[0072] The second sending module 203 is used to send the first frame diagnostic response message after a first scheduling time if the LIN controller supports long frames, where the first scheduling time is a preset first frame LIN message diagnostic scheduling time.
[0073] The second sending module 203 is also used to delay the second scheduling time and send continuous frame diagnostic response messages, wherein the second scheduling time is a preset subsequent frame LIN message diagnostic scheduling time.
[0074] The determination module 204 is used to determine that the diagnostic service of the domain controller is qualified if, after the diagnostic response message has been sent, the data identifier in the diagnostic response message is the same as the target data identifier and the response value in the diagnostic response message matches the expected LIN diagnostic response value.
[0075] See Figure 5 The diagram shown is a hardware structure schematic of an electronic device provided in an embodiment of this application. The LIN diagnostic testing method provided in this embodiment can be applied to electronic device 1, which can be a personal computer, server, or other terminal device. Electronic device 1 includes, but is not limited to, a processor 110 and a memory 120 connected via a communication bus 130. Figure 5 This is merely an example of an electronic device and does not constitute a limitation thereof. In other embodiments, the electronic device may include more components than those shown in the figure.
[0076] Memory may include one or more Random Access Memory (RAM) and one or more Non-Volatile Memory (NVM). RAM can be directly read and written by the processor and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data. RAM may include Static Random-Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), and Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), etc.
[0077] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct read and write operations by the processor. Non-volatile memory can include disk storage devices and flash memory.
[0078] The memory is used to store one or more computer programs. These one or more computer programs are configured to be executed by a processor. The one or more computer programs include multiple instructions that, when executed by the processor, enable a LIN diagnostic testing method to be executed on an electronic device.
[0079] In other embodiments, the electronic device further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device.
[0080] A processor may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0081] The processor provides computing and control capabilities; for example, the processor is used to execute computer programs stored in memory to implement the LIN diagnostic testing method described above.
[0082] A communication bus is used at least to provide a channel for communication between memory and processor in an electronic device.
[0083] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0084] This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned related method steps to implement the LIN diagnostic testing method in the above embodiments.
[0085] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the LIN diagnostic testing method described in the above embodiments.
[0086] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein, the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the LIN diagnostic test method in the above method embodiments.
[0087] In this application, the electronic devices, computer storage media, computer program products or chips provided in the embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0088] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0090] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0091] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts or all or part of the technical solutions that contribute to the prior art, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A LIN diagnostic test method, characterized in that, The method includes: The domain controller sends a diagnostic request message to the target LIN node, the diagnostic request message including the node address and data identifier; If the node address is the same as the target node address of the target LIN node, and the data identifier is the same as the target data identifier of the target LIN node, determine whether the LIN controller of the target LIN node supports long frames; If the LIN controller supports long frames, it delays for a first scheduling time and sends the first frame diagnostic response message. The first scheduling time is the preset first frame LIN message diagnostic scheduling time. After a second scheduling time delay, continuous frame diagnostic response messages are sent, where the second scheduling time is the preset scheduling time for subsequent frame LIN message diagnostics. If the data identifier in the diagnostic response message is the same as the target data identifier, and the response value in the diagnostic response message matches the expected LIN diagnostic response value, then the diagnostic service of the domain controller is deemed qualified.
2. The LIN diagnostic testing method according to claim 1, characterized in that, The method further includes: If the diagnostic response message has not been completely sent, determine the protocol control information for the next consecutive frame of diagnostic response messages; After delaying the second scheduling time, the next consecutive frame diagnostic response message is sent based on the protocol control information.
3. The LIN diagnostic testing method according to claim 1, characterized in that, The method further includes: If the LIN controller does not support long frames, the first scheduling time is delayed, and a single-frame diagnostic response message is sent. After delaying the second scheduling time, another single-frame diagnostic response message is sent.
4. The LIN diagnostic testing method according to claim 3, characterized in that, The method further includes: If the diagnostic response message has not been completely sent, determine the data identifier for the next single-frame diagnostic response message; After delaying the second scheduling time, the next single-frame diagnostic response message is sent based on the data identifier of the next single-frame diagnostic response message.
5. The LIN diagnostic testing method according to claim 1, characterized in that, The step of sending a diagnostic request message to the target LIN node through the domain controller includes: If a data identifier is associated with the diagnostic configuration of the diagnostic service, the data identifier is written into the configuration information of the diagnostic service; The domain controller sends the diagnostic request message to the target LIN node based on the data identifier.
6. The LIN diagnostic testing method according to claim 1, characterized in that, The method further includes: Based on the vehicle model and the data type parameters of the LIN controller, configure the data identifiers of multiple LIN nodes that communicate with the domain controller; Configure the first scheduling time and the second scheduling time based on the LIN scheduling table in the LIN application message communication matrix.
7. The LIN diagnostic testing method according to claim 1, characterized in that, The method further includes: Configure the desired LIN diagnostic response value based on the LIN diagnostic message communication matrix; Based on the diagnostic address list, configure the LIN channels and node addresses of multiple LIN nodes that communicate with the domain controller.
8. The LIN diagnostic testing method according to claim 1, characterized in that, The method further includes: Based on the LIN diagnostic message communication matrix, a diagnostic scheduling method, a diagnostic response message sending format, and a check range for the response values of the diagnostic response messages are designed for multiple LIN nodes communicating with the domain controller.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor: The memory is used to store program instructions; The processor is configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, cause the electronic device to perform the LIN diagnostic test method as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The computer storage medium stores program instructions that, when executed on the electronic device, cause the processor of the electronic device to perform the LIN diagnostic test method as described in any one of claims 1 to 8.