Vehicle logical channel communication test method and device, electronic equipment and storage medium
By automating the testing of the LIN bus through initialization and fault injection functions, the problem of low efficiency in vehicle LIN bus communication testing is solved, and fast and accurate test results are achieved.
Patent Information
- Application Number
- CN202310578689.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-05-22
AI Technical Summary
In existing technologies, the communication testing efficiency of vehicle LIN buses is low and the degree of automation is insufficient, which affects the vehicle driving experience.
By initializing the LIN communication test channel, faults are automatically injected using a preset fault injection function, and the communication test results are judged using a detection function, thus achieving automated fault injection and testing.
It improves the automation level and efficiency of LIN channel interference testing, ensures the accuracy and speed of testing, and solves the problems of low automation and low efficiency in existing technologies.
Smart Images

Figure CN116633837B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of vehicle system communication, and in particular to a vehicle logical channel communication test method and device, an electronic equipment and a storage medium. BACKGROUND
[0002] With the development of automobile intelligence, automobile electronic communication is becoming more and more intelligent. As a low-cost vehicle bus, LIN (Local Interconnect Network) bus has the advantages of simplicity, high reliability, flexibility and safety. LIN bus is usually used in network connection of automobile peripheral electronic communication equipment, and can be connected with vehicle lighting system, vehicle window seat, vehicle sunroof, active air intake grille, automatic wiper, etc. LIN bus communicates with each device through LIN frame. When LIN bus is disturbed, the communication obstacle of LIN bus will greatly affect the driving experience of the vehicle. Therefore, when the vehicle is connected, the anti-interference ability of the vehicle LIN bus needs to be tested. In the prior art, the test personnel manually tests the vehicle LIN bus. In the LIN bus test module, the LIN bus is disturbed, and the communication of the LIN bus is observed. The test efficiency is low. SUMMARY
[0003] The present application provides a vehicle logical channel communication test method, device, electronic equipment and storage medium to realize automatic disturbance test of vehicle LIN bus.
[0004] According to an aspect of the present application, a vehicle logical channel communication test method is provided, comprising:
[0005] initializing a LIN communication test channel;
[0006] injecting a to-be-tested fault into the LIN communication test channel according to a preset fault injection function;
[0007] if an error frame is detected in the LIN communication test channel in the case that the first check result bit of the first preset channel detection function is the first preset flag bit, it is determined that the LIN communication test channel passes the communication test.
[0008] According to another aspect of the present application, a vehicle logical channel communication test device is provided, comprising:
[0009] a test initialization module for initializing a LIN communication test channel;
[0010] a fault injection module for injecting a to-be-tested fault into the LIN communication test channel according to a preset fault injection function;
[0011] The test judgment module is configured to, in a case where the first check result bit of the first preset channel detection function is the first preset flag bit, determine that the LIN communication test channel passes the communication test if an error frame is detected to be sent by the LIN communication test channel.
[0012] According to another aspect of the present application, there is provided an electronic device comprising:
[0013] at least one processor; and
[0014] a memory in communication with the at least one processor; wherein
[0015] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the vehicle logical channel communication test method according to any one of the embodiments of the present application.
[0016] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for enabling a processor to perform the vehicle logical channel communication test method according to any one of the embodiments of the present application when executed by the processor.
[0017] The technical solution of the embodiments of the present application initializes the LIN communication test channel, prevents the influence of other communication information on the test, and improves the accuracy of the test. The technical solution of the embodiments of the present application injects the to-be-tested fault into the LIN communication test channel according to the preset fault injection function, automatically injects the to-be-tested fault into the LIN communication test channel through the fault injection function, realizes automatic fault injection, and improves the automation level of the LIN channel interference test. In a case where the first check result bit of the first preset channel detection function is the first preset flag bit, if an error frame is detected to be sent by the LIN communication test channel, it is determined that the LIN communication test channel passes the communication test. In a case where the first check result bit of the first preset channel detection function is the first preset flag bit, if an error frame is detected to be sent by the LIN communication test channel, it is determined that the LIN communication test channel passes the communication test. The first detection result is detected to be the first preset flag bit, and it is determined that the LIN communication test channel is in normal communication. The error frame of the LIN communication test channel is detected, and the test result of the LIN communication test channel is automatically judged. The technical solution of the embodiments of the present application solves the technical problems of low automation and low efficiency of the vehicle logical channel communication test in the prior art, realizes fast test of the vehicle logical channel communication, improves the efficiency of the vehicle logical channel communication test, and verifies the feasibility and accuracy of the vehicle logical channel communication test.
[0018] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to make the technical solutions in the embodiments of the present application clearer, the accompanying drawings needed in the embodiments will be briefly introduced. Obviously, the accompanying drawings in the following description only show some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0020] Figure 1 is a flow chart of a vehicle logical channel communication test method provided by the first embodiment of the present application;
[0021] Figure 2 is a flow chart of another vehicle logical channel communication test method provided by the second embodiment of the present application;
[0022] Figure 3 is a structural schematic diagram of a vehicle logical channel communication test device provided by the third embodiment of the present application;
[0023] Figure 4 is a structural schematic diagram of an electronic device for implementing the vehicle logical channel communication test method of the embodiments of the present application. DETAILED DESCRIPTION
[0024] In order to make the technical solutions in the embodiments of the present application clearer, the accompanying drawings needed in the embodiments will be briefly introduced. Obviously, the accompanying drawings in the following description only show some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0025] Embodiment One
[0026] Figure 1 is a flow chart of a vehicle logical channel communication test method provided by the first embodiment of the present application, and the present embodiment can be applied to the case of performing communication test on a LIN bus channel. The method can be executed by a vehicle logical channel communication test device, which can be realized in the form of hardware and / or software, and can be configured in an electronic device. As shown in the figure, the method comprises the following steps. Figure 1
[0027] S110, initializing a LIN communication test channel.
[0028] The LIN communication test channel can be a test of the influence of the LIN bus channel when being interfered on the communication of the LIN bus channel. The LIN (Local Interconnect Network) can be a bus used for connecting vehicle controllers and sensors.
[0029] Specifically, the tester sets a test flow for testing the LIN communication test channel, and performs test initialization on the LIN communication test channel.
[0030] Optionally, in another optional embodiment of the present application, the initialization of the LIN communication test channel comprises:
[0031] reading a test file of the LIN communication test channel; determining a test log file storage address; and controlling a program-controlled power supply to be powered on.
[0032] The test file can be a document describing test-related information in the LIN channel test process. For example, the test file usually includes test plans, test cases, test record reports, test problem reports, test evaluation reports, and the like.
[0033] The test log file storage address can be a storage address of the test log file. It should be noted that during the test process, the host computer usually generates a test log file for recording the test process, and sends the test log file to the test log file storage address.
[0034] The program-controlled power supply can be a power supply for providing test power.
[0035] Specifically, when the tester starts testing the LIN communication test channel, the tester performs test initialization on the tested controller, reads the test file of the LIN communication test channel, determines the test log file storage address, controls the program-controlled power supply to be powered on, and completes the initialization operation of the LIN communication test channel.
[0036] S120, according to a preset fault injection function, injecting a to-be-tested fault into the LIN communication test channel.
[0037] The fault injection function can be a function preset for injecting a fault into the LIN communication test channel. For example, the fault injection function can be a pre-established linInvertMultipleHeaderBits function.
[0038] The to-be-tested fault can be a preset fault for testing. It should be noted that in the LIN frame, a protected segment (PID segment) of the LIN frame is located at the end of the LIN frame header, wherein the first 6 bits of the PID segment of the LIN frame are Frame Id, the 7th bit P0 and the 8th bit P1 are two parity check bits, and the to-be-tested fault can be verification of the influence of the interference condition on the LIN bus communication of the 7th bit P0 and the 8th bit P1 of the PID segment of the LIN frame.
[0039] Specifically, when starting the test, the preset fault injection function sequentially injects the to-be-tested fault into the LIN communication test channel.
[0040] Optionally, in another optional embodiment of the present application, the to-be-tested fault includes a first fault group, a second fault group, a third fault group and a fourth fault group; and the injection of the to-be-tested fault into the LIN communication test channel according to the preset fault injection function includes:
[0041] injection of the fourth fault group into the LIN communication test channel according to the preset fault injection function to interfere with the first check bit of the LIN frame in the LIN communication test channel;
[0042] injection of the third fault group into the LIN communication test channel according to the preset fault injection function to interfere with the second check bit of the LIN frame in the LIN communication test channel;
[0043] sequential injection of the first fault group, the second fault group, the third fault group and the fourth fault group into the LIN communication test channel according to the preset fault injection function, while interfering with the first check bit and the second check bit.
[0044] The first check bit can be the 7th bit P0 of the PID segment of the LIN frame, and the second check bit can be the 8th bit P1 of the PID segment of the LIN frame.
[0045] The fourth fault group can be a byte array for interfering with the 7th bit P0 of the PID segment of the LIN frame, the third fault group can be a byte array for interfering with the 8th bit P1 of the PID segment of the LIN frame, the second fault group can be a byte array for interfering with the 7th bit P0 and the 8th bit of the PID segment of the LIN frame, and the first fault group can be a byte array for not interfering with the 7th bit P0 and the 8th bit of the PID segment of the LIN frame.
[0046] Optionally, in the interference test on the first check bit of the LIN communication test channel, when the fault injection is performed, the fourth fault group is injected into the LIN communication test channel through the fault injection function to interfere with the first check bit of the LIN frame in the LIN communication test channel; optionally, in the interference test on the second check bit of the LIN communication test channel, when the fault injection is performed, the third fault group is injected into the LIN communication test channel through the fault injection function to interfere with the second check bit of the LIN frame in the LIN communication test channel; optionally, in the interference test on the first check bit and the second check bit of the LIN communication test channel, when the fault injection is performed, the first fault group, the second fault group, the third fault group and the fourth fault group are sequentially injected into the LIN communication test channel through the fault injection function to interfere with the first check bit and the second check bit of the LIN frame in the LIN communication test channel.
[0047] S130, in the case where the first check result bit of the first preset channel detection function is the first preset flag bit, if it is detected that there is an error frame in the LIN communication test channel, it is determined that the LIN communication test channel passes the communication test.
[0048] The first preset channel detection function can be a preset function for detecting the communication of the LIN communication test channel. For example, the first preset channel detection function can be a TestWaitForMessage function.
[0049] The first check result can be a variable that shows the detection result of the LIN communication test channel detected by the first preset channel detection function. For example, the first check result can be a variable msg_return.
[0050] The first preset flag bit can be a preset flag bit that is displayed when the first preset channel detection function detects that the LIN communication test channel is in normal communication. For example, the first preset flag bit can be set to "1", and when the first preset channel detection function detects that the LIN communication test channel is in normal communication, the first check result of the first preset channel detection function is set to "1". For example, when the variable msg_return is equal to 1, it is determined that the LIN communication test channel is in normal communication; when the variable msg_return is equal to 0, it is determined that the LIN communication test channel is not in normal communication.
[0051] The error frame can be a communication frame that can transmit a communication error of the LIN bus.
[0052] Specifically, the LIN communication test channel is detected at a certain time interval by a first preset channel detection function, and a first check result corresponding to the first preset channel detection function is changed according to a detection result obtained by the first preset channel detection function, and in a case where a first check result bit of the first preset channel detection function is a first preset flag bit, it is indicated that the communication of the LIN communication test channel is normal at this time, and if an error frame is detected to be sent out by the LIN communication test channel, it is determined that the LIN communication test channel passes the communication test in a case where the communication of the LIN communication test channel is normal.
[0053] The technical scheme of the embodiment of the application initializes the LIN communication test channel, prevents the influence of other communication information on the test, and improves the accuracy of the test; the preset fault injection function is used to inject a to-be-tested fault into the LIN communication test channel, the fault injection function is used to automatically inject the to-be-tested fault into the LIN communication test channel, automatic fault injection is realized, and the automation level of the LIN channel interference test is improved; in a case where the first check result bit of the first preset channel detection function is the first preset flag bit, if an error frame is detected to be sent out by the LIN communication test channel, it is determined that the LIN communication test channel passes the communication test, the first detection result is detected to be the first preset flag bit, it is determined that the communication of the LIN communication test channel is normal, and the error frame of the LIN communication test channel is detected, which is used to automatically judge the test result of the LIN communication test channel, solves the technical problems of low automation and low efficiency of the vehicle logic channel communication test in the prior art, realizes fast test of the vehicle logic channel communication, improves the efficiency of the vehicle logic channel communication test, and completes the feasibility and accuracy of the vehicle logic channel communication test.
[0054] Embodiment two
[0055] Figure 2 is a flowchart of another vehicle logic channel communication test method provided by the second embodiment of the application, and the relationship between the embodiment and the above-mentioned embodiment is that the specific method for detecting the LIN communication test channel is as shown in Figure 2 The vehicle logic channel communication test method comprises the following steps.
[0056] S210, initializing the LIN communication test channel.
[0057] S220, injecting a to-be-tested fault into the LIN communication test channel according to a preset fault injection function.
[0058] S230, detecting the LIN communication test channel by the first preset channel detection function, and adjusting the first check result bit to the first preset flag bit if the first preset channel detection function detects that the LIN communication test channel exists a communication frame.
[0059] The communication frame can be a LIN frame of normal communication in the LIN communication test channel.
[0060] The first preset flag is used for indicating that the to-be-tested fault injection is ended.
[0061] Specifically, the LIN communication test channel is detected by the first preset channel detection function at a certain time interval, and it is judged whether the first preset channel detection function detects a communication frame of normal communication of the LIN communication test channel. If the first preset channel detection function detects that the LIN communication test channel exists the communication frame, it indicates that the communication of the LIN communication test channel is normal at this time, the to-be-tested fault injection is ended, and the first check result bit is adjusted to the first preset flag bit.
[0062] Optionally, in another optional embodiment of the present application, after the LIN communication test channel is detected by the first preset channel detection function, the following steps are further included:
[0063] If the first preset channel detection function detects that the LIN communication test channel does not exist the communication frame, the first check result bit is adjusted to a second preset flag bit; the second preset flag is used for indicating that the to-be-tested fault injection is not ended.
[0064] The second preset flag bit is preset as a flag bit displayed when the first preset channel detection function detects that the communication of the LIN communication test channel is abnormal; the second preset flag is used for indicating that the to-be-tested fault injection is not ended. For example, the second preset flag bit can be "0"; when the variable msg_return is equal to "0", it is determined that the communication of the LIN communication test channel is abnormal.
[0065] Specifically, the LIN communication test channel is detected by the first preset channel detection function at a certain time interval, and it is judged whether the first preset channel detection function detects a communication frame of normal communication of the LIN communication test channel. If the first preset channel detection function detects that the LIN communication test channel does not exist the communication frame, it indicates that the communication of the LIN communication test channel is abnormal at this time, the to-be-tested fault injection is not ended, and the first check result bit is adjusted to the second preset flag bit.
[0066] S240, detecting the LIN communication test channel by a second preset channel detection function.
[0067] The second preset channel detection function can be a function preset for detecting an error frame of the LIN communication test channel. For example, the second preset channel detection function can be a linReceiveError function
[0068] Specifically, the LIN communication test channel is detected by the second preset channel detection function at a certain time interval to determine whether there is an error frame in the LIN communication test channel.
[0069] S250, if the second preset channel detection function detects that there is an error frame in the LIN communication test channel, the second check result bit of the second preset channel detection function is adjusted to a third preset flag bit.
[0070] The second detection result can be a variable that shows the detection result of the LIN communication test channel detected by the second preset channel detection function. For example, the second check result can be a variable gIDError.
[0071] The third preset flag bit can be a flag bit preset to show when the second preset channel detection function detects that there is an error frame in the LIN communication test channel; the third preset flag bit is used to indicate the communication recovery of the LIN communication test channel. For example, the third preset flag bit can be set to "1".
[0072] Specifically, whether there is an error frame in the LIN communication test channel is determined by the second preset channel detection function. If the second preset channel detection function detects that there is an error frame in the LIN communication test channel, the second check result bit of the second preset channel detection function is adjusted to a third preset flag bit.
[0073] S260, if the second check result bit of the second preset channel detection function is the third preset flag bit, it is determined that the LIN communication test channel passes the communication test.
[0074] Specifically, if the second check result bit of the second preset channel detection function is the third preset flag bit, it means that there is an error frame in the LIN communication test channel after the fault injection ends, the communication of the LIN communication test channel is normal, and it is determined that the LIN communication test channel passes the communication test.
[0075] Optionally, in another optional embodiment of the present application, after the first check result bit of the first preset channel detection function is the first preset flag bit, it further includes:
[0076] If the second preset channel detection function detects that there is no error frame in the LIN communication test channel, the second check result bit of the second preset channel detection function is adjusted to a fourth preset flag bit; the fourth preset flag bit is used to indicate that the communication of the LIN communication test channel is not normal.
[0077] If the second check result bit of the second preset channel detection function is the fourth preset flag bit, it is determined that the LIN communication test channel fails the communication test.
[0078] The fourth preset flag bit can be a flag bit preset in the second preset channel detection function when the LIN communication test channel does not send out an error frame. The fourth preset flag bit is used to indicate that the LIN communication test channel is not normal. For example, the third preset flag bit can be set to "0".
[0079] Specifically, whether an error frame is sent out in the LIN communication test channel is determined by the preset second preset channel detection function. If the second preset channel detection function detects that there is no error frame in the LIN communication test channel, the second check result bit of the second preset channel detection function is adjusted to the fourth preset flag bit. If the second check result bit of the second preset channel detection function is the fourth preset flag bit, it indicates that no error frame is sent out in the LIN communication test channel after the end of fault injection, the LIN communication test channel is not normal, the test of the LIN communication test channel is determined to fail, and the communication test is not passed.
[0080] The technical scheme of the embodiment of the application initializes the LIN communication test channel, injects a fault to be tested into the LIN communication test channel according to a preset fault injection function, detects the LIN communication test channel by the first preset channel detection function, adjusts the first check result bit to the first preset flag bit if the first preset channel detection function detects that there is a communication frame in the LIN communication test channel, and the communication frame can be used to identify that the LIN communication test channel is normal. In the case of normal communication, it is indicated that the fault injection is completed, and manual detection of the LIN communication channel is not needed, thereby improving the test efficiency. The LIN communication test channel is detected by the second preset channel detection function. If the second preset channel detection function detects that there is an error frame in the LIN communication test channel, the second check result bit of the second preset channel detection function is adjusted to the third preset flag bit. If the second check result bit of the second preset channel detection function is the third preset flag bit, it is determined that the LIN communication test channel passes the communication test. In the case that the first detection result is the first preset flag bit, it is determined that the LIN communication test channel is normal. The error frame of the LIN communication test channel is detected by setting the second preset channel detection function. When it is detected that the LIN communication test channel sends out an error frame, the second check result bit is changed to the third preset flag bit, the LIN communication test channel is automatically determined to be normal, the test result of the LIN bus is determined, the technical problems of low automation and low efficiency of vehicle logic channel communication test in the prior art are solved, the vehicle logic channel communication is quickly tested, the efficiency of vehicle logic channel communication test is improved, and the feasibility and accuracy of vehicle logic channel communication test are completed.
[0081] Figure 3is a structural schematic diagram of a vehicle logical channel communication test device provided by embodiment three of the present application. As shown in the figure, the device comprises a test initialization module 310, a fault injection module 320 and a test judgment module 330, wherein, Figure 3
[0082] The test initialization module 310 is configured to initialize the LIN communication test channel.
[0083] The fault injection module 320 is configured to inject the to-be-tested fault into the LIN communication test channel according to a preset fault injection function.
[0084] The test judgment module 330 is configured to, in a case where the first check result bit of the first preset channel detection function is a first preset flag bit, determine that the LIN communication test channel passes the communication test if an error frame is detected to be sent by the LIN communication test channel.
[0085] The technical scheme of the embodiment of the present application can initialize the LIN communication test channel, prevent the influence of other communication information on the test, and improve the accuracy of the test. The to-be-tested fault is injected into the LIN communication test channel according to the preset fault injection function, the to-be-tested fault is automatically injected into the LIN communication test channel through the fault injection function, the automatic fault injection is realized, and the automation level of the LIN channel interference test is improved. In a case where the first check result bit of the first preset channel detection function is a first preset flag bit, if an error frame is detected to be sent by the LIN communication test channel, it is determined that the LIN communication test channel passes the communication test. In a case where the first detection result is the first preset flag bit, it is determined that the LIN communication test channel is in normal communication, the error frame of the LIN communication test channel is detected, and the test result of the LIN communication test channel is automatically judged. The technical problems of low automation and low efficiency of the vehicle logical channel communication test in the prior art are solved, the vehicle logical channel communication test is quickly realized, the efficiency of the vehicle logical channel communication test is improved, and the feasibility and accuracy of the vehicle logical channel communication test are realized.
[0086] Optionally, the test judgment module is specifically configured to:
[0087] detect the LIN communication test channel through the first preset channel detection function;
[0088] if the first preset channel detection function detects that the LIN communication test channel exists, the first check result bit is adjusted to be the first preset flag bit; wherein the first preset flag is used to indicate that the to-be-tested fault injection is completed.
[0089] Optionally, the test judgment module is specifically further configured to:
[0090] If the first preset channel detection function detects that the LIN communication test channel does not exist a communication frame, the first check result bit is adjusted to a second preset flag bit; wherein the second preset flag is used to indicate that the to-be-tested fault injection is not ended.
[0091] Optionally, the test judgment module is specifically used for:
[0092] detecting the LIN communication test channel through a second preset channel detection function;
[0093] If the second preset channel detection function detects that the LIN communication test channel exists an error frame, a second check result bit of the second preset channel detection function is adjusted to a third preset flag bit; wherein the third preset flag bit is used to indicate that the communication of the LIN communication test channel is recovered;
[0094] If the second check result bit of the second preset channel detection function is the third preset flag bit, it is determined that the LIN communication test channel passes the communication test.
[0095] Optionally, the test judgment module is specifically used for:
[0096] If the second preset channel detection function detects that the LIN communication test channel does not exist an error frame, the second check result bit of the second preset channel detection function is adjusted to a fourth preset flag bit; wherein the fourth preset flag bit is used to indicate that the communication of the LIN communication test channel is not normal;
[0097] If the second check result bit of the second preset channel detection function is the fourth preset flag bit, it is determined that the LIN communication test channel does not pass the communication test.
[0098] Optionally, the fault injection module is specifically used for:
[0099] injecting the fourth fault group into the LIN communication test channel according to a preset fault injection function, and interfering with a first check bit of a LIN frame in the LIN communication test channel;
[0100] injecting the third fault group into the LIN communication test channel according to a preset fault injection function, and interfering with a second check bit of a LIN frame in the LIN communication test channel;
[0101] sequentially injecting the first fault group, the second fault group, the third fault group and the fourth fault group into the LIN communication test channel according to a preset fault injection function, and interfering with the first check bit and the second check bit.
[0102] Optionally, the test initialization module is specifically used for:
[0103] reading a test file of the LIN communication test channel;
[0104] determining a test log file storage address;
[0105] controlling the programmable power supply to power on.
[0106] The vehicle logical channel communication test device provided by the embodiment of the application can execute the vehicle logical channel communication test method provided by any embodiment of the application, and has the corresponding function modules and beneficial effects of the execution method.
[0107] Embodiment four
[0108] Figure 4 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the applications described and / or claimed in this document.
[0109] As shown in Figure 4 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0110] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, a speaker, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.
[0111] The processor 11 can be various general and / or special purpose processing components having processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the vehicle logical channel communication test method.
[0112] In some embodiments, the vehicle logical channel communication test method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the vehicle logical channel communication test method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the vehicle logical channel communication test method by any other suitable means, such as by means of firmware.
[0113] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0114] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0115] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0117] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), blockchain network, and the Internet.
[0118] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0119] It should be understood that the various forms of flow shown above can be reordered, additional steps added, or steps deleted. For example, the steps described in the present application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0120] Embodiment five
[0121] The embodiment provides a computer readable storage medium, which stores a computer program, the program is executed by a processor to realize steps of a vehicle logical channel communication test method provided by any embodiment of the present application, the method comprises the following steps:
[0122] Initializing a LIN communication test channel;
[0123] According to a preset fault injection function, injecting a to-be-tested fault into the LIN communication test channel;
[0124] If the first check result bit of the first preset channel detection function is a first preset flag bit, and if an error frame of the LIN communication test channel is detected, it is determined that the LIN communication test channel passes the communication test.
[0125] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.
[0126] Computer readable signal media can include a propagated data signal with computer readable program code embodied therein. For example, a propagated signal can be an electromagnetic signal, an optical signal, and / or any other suitable type of signal. Such a propagated signal can carry computer readable program code in the form of electrical signals, optical signals, and / or magnetic
[0127] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0128] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). These network connections are
[0129] Those skilled in the art will appreciate that the modules or steps of the present application described above can be implemented in a general purpose computer, and they can be centralized in a single computer or distributed over a network of multiple computers, and optionally, they can be implemented by computer executable program code, which can be stored in a storage device and executed by a computer, or they can be implemented by individual integrated circuit modules, or a plurality of modules or steps can be implemented by a single integrated circuit module. Thus, the present application is not limited to any particular combination of hardware and software.
[0130] It should be understood that the various forms of flow shown in the figures can be re-ordered, added to, or deleted from without departing from the spirit of the present application. For example, the steps recited in the present application can be performed in parallel, in series, or in different orders, and the present application is not limited in this regard.
[0131] The above detailed description does not limit the scope of the application. Various modifications, combinations, sub-combinations and alternatives can be made to the detailed description. Any modification, equivalent replacement and improvement etc. made within the spirit and principle of the application shall be included in the scope of the application.
Claims
1. A method of testing a vehicle logical channel communication, characterized by, The method comprises the following steps: initializing a LIN communication test channel; injecting a to-be-tested fault into the LIN communication test channel according to a preset fault injection function; if an error frame is detected in the LIN communication test channel when a first check result bit of a first preset channel detection function is a first preset flag bit, determining that the LIN communication test channel passes the communication test; the first check result bit of the first preset channel detection function is the first preset flag bit, comprising: detecting the LIN communication test channel by the first preset channel detection function; if the first preset channel detection function detects that the LIN communication test channel has a communication frame, adjusting the first check result bit to the first preset flag bit; wherein the communication frame is a normal communication LIN frame in the LIN communication test channel, and the first preset flag is used to indicate that the to-be-tested fault injection ends; if the first preset channel detection function detects that the LIN communication test channel has no communication frame, adjusting the first check result bit to a second preset flag bit; wherein the second preset flag is used to indicate that the to-be-tested fault injection does not end; if an error frame is detected in the LIN communication test channel, the method further comprises the following steps: detecting the LIN communication test channel by a second preset channel detection function; if the second preset channel detection function detects that the LIN communication test channel has an error frame, adjusting a second check result bit of the second preset channel detection function to a third preset flag bit; wherein the third preset flag bit is used to indicate that the communication of the LIN communication test channel is restored; if the second check result bit of the second preset channel detection function is the third preset flag bit, determining that the LIN communication test channel passes the communication test.
2. The method according to claim 1, characterized in that, after the first check result bit of the first preset channel detection function is the first preset flag bit, the method further comprises the following steps: if the second preset channel detection function detects that the LIN communication test channel has no error frame, adjusting a second check result bit of the second preset channel detection function to a fourth preset flag bit; wherein the fourth preset flag bit is used to indicate that the communication of the LIN communication test channel is abnormal; if the second check result bit of the second preset channel detection function is the fourth preset flag bit, determining that the LIN communication test channel does not pass the communication test.
3. The method according to claim 1, characterized in that, the to-be-tested fault comprises a first fault group, a second fault group, a third fault group and a fourth fault group; the method of injecting the to-be-tested fault into the LIN communication test channel according to the preset fault injection function comprises the following steps: injecting the fourth fault group into the LIN communication test channel according to the preset fault injection function, and interfering with a first check bit of a LIN frame in the LIN communication test channel; injecting the third fault group into the LIN communication test channel according to the preset fault injection function, and interfering with a second check bit of a LIN frame in the LIN communication test channel; The first fault group, the second fault group, the third fault group and the fourth fault group are sequentially injected into the LIN communication test channel according to a preset fault injection function, and the first check bit and the second check bit are interfered.
4. The method according to claim 1, characterized by, The initialization of the LIN communication test channel comprises: reading a test file of the LIN communication test channel; determining a test log file storage address; controlling a program-controlled power supply to be powered on.
5. A vehicle logical channel communication test apparatus characterized by comprising: Comprise: a test initialization module configured to initialize the LIN communication test channel; a fault injection module configured to inject a to-be-tested fault into the LIN communication test channel according to a preset fault injection function; a test judgment module configured to, in a case where a first check result bit of a first preset channel detection function is a first preset flag bit, determine that the LIN communication test channel passes the communication test if an error frame is detected to be sent by the LIN communication test channel. The test judgment module is specifically configured to: detect the LIN communication test channel through the first preset channel detection function; if the first preset channel detection function detects that the LIN communication test channel exists a communication frame, adjust the first check result bit to the first preset flag bit; wherein the communication frame is a normal communication LIN frame in the LIN communication test channel, and the first preset flag is used to indicate that the to-be-tested fault injection ends; if the first preset channel detection function detects that the LIN communication test channel does not exist a communication frame, adjust the first check result bit to a second preset flag bit; wherein the second preset flag is used to indicate that the to-be-tested fault injection does not end. The test judgment module is specifically further configured to: detect the LIN communication test channel through a second preset channel detection function; if the second preset channel detection function detects that the LIN communication test channel exists an error frame, adjust a second check result bit of the second preset channel detection function to a third preset flag bit; wherein the third preset flag bit is used to indicate that the communication of the LIN communication test channel is restored; if the second check result bit of the second preset channel detection function is the third preset flag bit, determine that the LIN communication test channel passes the communication test.
6. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the vehicle logical channel communication test method of any one of claims 1-4.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to execute the vehicle logical channel communication test method of any one of claims 1-4 when executed.
Citation Information
Patent Citations
Fault injection system, automatic test system and method of automobile hybrid bus integrated rack
CN114756008A