Automated test method, platform, device, medium, and product
By automatically controlling the switching of ECU scheduling tables through the LIN state management layer and hardware driver layer of the automated test platform, the problem of low efficiency in manual configuration is solved, and efficient and real-time scheduling table switching and testing are achieved, ensuring communication security and data integrity.
Patent Information
- Application Number
- CN202510681585.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2026-11-27
AI Technical Summary
In the prior art, the configuration and switching of vehicle electronic control unit (ECU) scheduling tables require manual operation, resulting in low efficiency and inability to meet real-time requirements.
An automated testing platform is adopted. The LIN state management layer detects the scheduling table to be switched, sends a channel stop command, interrupts the resource access permissions of the current scheduling table, and automatically controls the ECU to switch to the scheduling table to be switched. The LIN interface and hardware driver layer are used to realize the safe switching of scheduling tables and the execution of test cases.
It improves the efficiency of scheduling table switching and configuration, ensures the security of communication status and data integrity, and enhances testing efficiency.
Smart Images

Figure CN123177401A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle technology, and in particular to an automatic testing method, platform, equipment, medium, and product. Background Technology
[0002] During the testing of a vehicle's Electronic Control Unit (ECU), the scheduling table needs to be reconfigured and switched. Current technology requires manual configuration and switching of the scheduling table, resulting in low configuration efficiency and high testing costs; furthermore, it cannot meet real-time requirements. Summary of the Invention
[0003] This invention provides an automated testing method, platform, device, medium, and product, which solves the technical problems of low manual efficiency and real-time performance caused by manual configuration and switching of scheduling tables in the prior art.
[0004] According to one aspect of the present invention, an automated testing method is provided, applied to an automated testing platform; the automated testing platform includes: a LIN interface, a LIN hardware driver layer, and a LIN state management layer; the method includes:
[0005] If the LIN state management layer detects a schedule to be switched, it sends a channel stop command to the LIN hardware driver layer.
[0006] The LIN hardware driver layer interrupts the access permissions of the resources associated with the current scheduling table based on the channel stop instruction;
[0007] The LIN state management layer automatically controls the ECU under test to switch from the current scheduling table to the scheduling table to be switched by calling the switching scheduling table interface.
[0008] The LIN state management layer initiates the switchover schedule table, and the switchover schedule table is used to control the ECU under test to execute test cases and obtain the corresponding test results; wherein, the test cases are received from the application layer through the LIN interface.
[0009] According to another aspect of the present invention, an automated testing platform is provided, the automated testing platform being used to execute the automated testing method described in any of the above embodiments; the automated testing platform includes: a LIN interface, a LIN hardware driver layer, and a LIN state management layer;
[0010] The LIN interface is connected to the application layer, one end of the LIN hardware driver layer is connected to the LIN interface and the LIN state management layer, the other end of the LIN hardware driver layer is connected to one end of an external device, and the other end of the external device is connected to the ECU under test.
[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0012] At least one processor; and
[0013] A memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the automatic testing method described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the automatic testing method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the automatic testing method described in any embodiment of the present invention.
[0017] The technical solution of this invention, by configuring a LIN interface, a LIN hardware driver layer, and a LIN state management layer on an automated test platform, automatically sends a channel stop command to the LIN hardware driver layer when the LIN state management layer detects a scheduling table to be switched. The LIN hardware driver layer then interrupts the resource access permissions associated with the current scheduling table based on the channel stop command, thus avoiding frame timing overlap between the old and new scheduling tables, thereby preventing bus conflicts and ensuring safe switching of communication states and data integrity. Furthermore, the LIN state management layer automatically controls the ECU under test to switch from the current scheduling table to the scheduling table to be switched by calling the scheduling table switching interface, solving the technical problems of low manual efficiency and real-time performance caused by manual configuration and switching of scheduling tables in the prior art, effectively improving the efficiency and real-time performance of scheduling table switching and configuration. Finally, the LIN state management layer starts the scheduling table to be switched and uses it to control the ECU under test to execute test cases and obtain corresponding test results, thereby effectively improving test efficiency.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of an automatic testing method provided in an embodiment of the present invention;
[0021] Figure 2 This is a flowchart of another automatic testing method provided in an embodiment of the present invention;
[0022] Figure 3 This is a flowchart of another automatic testing method provided in an embodiment of the present invention;
[0023] Figure 4 This is a flowchart of another automatic testing method provided in an embodiment of the present invention;
[0024] Figure 5 This is a flowchart of another automatic testing method provided in an embodiment of the present invention;
[0025] Figure 6 This is a structural block diagram of an automatic testing platform provided in an embodiment of the present invention;
[0026] Figure 7 This is a structural block diagram of another automated testing platform provided in an embodiment of the present invention;
[0027] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] In one embodiment, Figure 1 This is a flowchart of an automatic testing method provided by an embodiment of the present invention. This embodiment is applicable to the automatic testing of the communication protocol stack between the upper-layer application and the ECU under test. The method can be executed by an automatic testing platform, which can be implemented in hardware and / or software and can be configured in the vehicle's electronic equipment. In one example, the automatic testing platform includes a LIN interface, a LIN hardware driver layer, and a LIN state management layer. The LIN interface is connected to the application layer, one end of the LIN hardware driver layer is connected to the LIN interface and the LIN state management layer, the other end of the LIN hardware driver layer is connected to one end of an external device, and the other end of the external device is connected to the ECU under test. It should be noted that the automatic testing platform can also be called an intermediate layer, or a LIN communication protocol stack, used to establish a communication connection between the application layer and the external device. It should be noted that in this embodiment of the present invention, the master node is the ECU under test, and the slave node is the external device. The automatic testing platform in this embodiment is developed using the AUTOSAR module layering concept to separate the automatic testing platform from the upper-layer business (i.e., the upper-layer application), so as to support the platformization of upper-layer application test cases and facilitate the updating of the underlying hardware devices.
[0031] like Figure 1 As shown, the method includes:
[0032] S110. If the LIN state management layer detects a schedule to be switched, a channel stop command is sent to the LIN hardware driver layer through the LIN state management layer.
[0033] In one example, the LIN state management layer can also be called LINSM, which is used for state management and scheduler switching; the LIN hardware driver layer can also be called LINHW, which is used to provide a unified register operation interface for connected external devices to shield the underlying hardware differences, thereby isolating hardware differences and facilitating code portability.
[0034] In one example, the schedule table to be switched refers to a schedule table that is ready but not yet activated during the schedule table switching process. In another example, the type of schedule table to be switched can include one of the following: application schedule table; diagnostic schedule table. This can be understood as either an application schedule table to be switched or a diagnostic schedule table to be switched. The application schedule table is used to manage the ECU's regular functional communication and transmits signal frames according to a fixed period; the diagnostic schedule table is used for diagnostic services and supports non-periodic or event-triggered data interaction. In one example, if the schedule table to be switched is an application schedule table, it can be specified by the ECU under test (as the master node), an external device acting as a slave node, or the LIN interface acting as a slave node. In one example, if the schedule table to be switched is a diagnostic schedule table, it can be specified by the ECU under test (as the master node). This avoids potential frame ID or timing conflicts when multiple slave nodes attempt to switch schedule tables. To avoid bus conflicts, the ECU under test (as the master node) triggers the switch operation for the diagnostic schedule table.
[0035] In one example, the channel stop command is used to safely halt data transmission and protocol stack activity on the communication channel associated with the current schedule, preventing out-of-order or lost packets during schedule switching. In one example, the channel stop command can be a software instruction.
[0036] It should be noted that the LIN state management layer can poll to detect if there are any new schedules to be switched. For example, the LinSM_mainfunction in the communication protocol stack can be used to poll to detect if there are any new schedules to be switched. If a new schedule is detected, the LIN state management layer can send a channel stop command to the LIN hardware driver layer.
[0037] S120: Interrupt the access permissions of the resources associated with the current scheduling table through the LIN hardware driver layer based on the channel stop instruction.
[0038] In one example, resource access permissions may include both hardware resource access permissions and software resource access permissions associated with the current schedule. For instance, this may include disabling the LIN bus transceiver bound to the current schedule to avoid message conflicts during handover. In an embodiment, the LIN hardware driver layer can securely stop the physical layer and protocol stack of the communication channel associated with the current schedule based on a channel stop instruction. This means releasing the hardware and software resources of the communication channel associated with the current schedule, and interrupting the access permissions of the hardware resources associated with the software resources of the current schedule.
[0039] S130: Automatically control the ECU under test to switch from the current schedule table to the schedule table to be switched by calling the switching schedule table interface through the LIN state management layer.
[0040] In one example, the ECU under test refers to the ECU that needs to be tested for functional integrity; the switching scheduler interface refers to a pre-configured interface that can automatically interrupt the resource access permissions associated with the current scheduler and enable the resource access permissions associated with the scheduler to be switched. In the embodiment, the process of switching the current scheduler to the scheduler to be switched can be understood as invalidating the configuration file contained in the current scheduler and writing the configuration file contained in the scheduler to be switched to the LIN hardware driver layer.
[0041] In one embodiment, the automatic control of the ECU under test from the current schedule table to the schedule table to be switched through the LIN state management layer includes: automatically writing the configuration file of the schedule table to be switched to the LIN hardware driver layer through the LIN state management layer; sending the configuration file of the schedule table to be switched to the associated external device through the LIN hardware driver layer; and sending the configuration file of the schedule table to be switched to the ECU under test with which a communication connection has been established through the external device.
[0042] In one example, the configuration file for the scheduling table to be switched may include: basic communication configuration information (e.g., LIN frames used for sending or receiving, timing parameters such as frame period and frequency shift, mapping between data fields and physical signals, etc.), and advanced control information (e.g., triggering conditions for diagnostic events, error handling strategies when frame transmission fails, power consumption information caused by frames retained in sleep mode, etc.). In one example, the ECU under test can establish communication connections with various external devices via the LIN bus, and each external device can establish communication connections with the LIN hardware driver layer via a USB interface.
[0043] In this embodiment, the configuration file of the scheduling table to be switched can be automatically written to the LIN hardware driver layer through the LIN state management layer; the configuration file of the scheduling table to be switched can be sent to the associated external device through the LIN hardware driver layer, and after the scheduling table to be switched is started, test cases can be executed in the external device, and the configuration file of the scheduling table to be switched can be sent to the ECU under test through the external device. This allows the ECU under test to accurately use the scheduling table to execute test cases, and the scheduling table can be automatically switched according to the operating status of the ECU under test and the external device, ensuring the matching degree of the communication strategy with the current requirements and realizing dynamic adaptation to the needs of multiple scenarios.
[0044] S140. Start the switching schedule table through the LIN state management layer, and use the switching schedule table to control the ECU under test to execute test cases and obtain the corresponding test results; wherein, the test cases are received from the application layer through the LIN interface.
[0045] In one example, the LIN interface, also known as LINIF or the LIN service layer, provides a unified API for data transmission to different upper-layer applications. In another example, the LIN interface can interact with other upper-layer applications through a runtime environment (RTE), achieving communication decoupling. In yet another example, the application layer refers to the various upper-layer applications that establish communication connections with the LIN interface. These applications may include, but are not limited to, at least one of the following: a vehicle body control module and a seat adjustment system.
[0046] In one example, the process of starting the switch-out schedule table through the LIN state management layer can be understood as the process of starting the relevant configuration files contained in the switch-out schedule table on the external device and the ECU under test through the LIN state management layer.
[0047] Test cases sent by various upper-layer applications in the application layer can be received through the LIN interface. The test cases can be sent to the LIN hardware driver layer through the LIN interface, and then forwarded to the connected external device through the LIN hardware driver layer. The external device then sends the test cases to the ECU under test, so that the ECU under test can execute the test cases and obtain the corresponding test results. The functional integrity and communication performance of the ECU under test can be tested through the test results, thereby ensuring the functional safety of the ECU under test and the safety of the people in the vehicle.
[0048] The technical solution of this embodiment configures a LIN interface, a LIN hardware driver layer, and a LIN state management layer on an automated test platform. When the LIN state management layer detects a scheduling table to be switched, it automatically sends a channel stop command to the LIN hardware driver layer. The LIN hardware driver layer then interrupts the resource access permissions associated with the current scheduling table based on the channel stop command, thus avoiding frame timing overlap between the old and new scheduling tables and preventing bus conflicts. This ensures safe switching of communication states and data integrity. Furthermore, the LIN state management layer automatically controls the ECU under test to switch from the current scheduling table to the scheduling table to be switched by calling the scheduling table switching interface. This solves the technical problems of low manual efficiency and real-time performance caused by manual configuration and switching of scheduling tables in the prior art, effectively improving the efficiency and real-time performance of scheduling table switching and configuration. Moreover, the LIN state management layer starts the scheduling table to be switched and uses it to control the ECU under test to execute test cases and obtain corresponding test results, thereby effectively improving test efficiency.
[0049] In one embodiment, Figure 2This is a flowchart of another automatic testing method provided by an embodiment of the present invention. This embodiment elaborates on the diagnostic message receiving process based on the above embodiments. Figure 2 As shown, the automatic testing method in this embodiment includes the following steps:
[0050] S210. If the LIN state management layer detects a schedule to be switched, a channel stop command is sent to the LIN hardware driver layer through the LIN state management layer.
[0051] S220: Interrupts access permissions to resources associated with the current scheduling table via the LIN hardware driver layer based on channel stop instructions.
[0052] S230: Automatically control the ECU under test to switch from the current schedule table to the schedule table to be switched by calling the switching schedule table interface through the LIN state management layer.
[0053] S240. If a new message is detected through the LIN interface and the new message is a first-type diagnostic message, the associated diagnostic received message data frame is obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface.
[0054] In one example, a new message refers to a communication message newly added to the LIN bus, or a message dynamically injected through other testing tools. In another example, this new message can be a communication message sent from an external device to the ECU under test (ECU) via the LIN interface and LIN hardware driver layer, or a communication message sent from the ECU under test to an external device via the LIN interface and LIN hardware driver layer. In yet another example, the message type can be either an application message or a diagnostic message. Application messages refer to data frames exchanged between ECUs during normal vehicle operation, such as CAN or LIN messages, carrying control commands or status information, such as vehicle speed and throttle opening. Diagnostic messages refer to dedicated messages used for fault detection, calibration, or reprogramming, and can be transmitted via the LIN bus.
[0055] In one example, the first type of diagnostic message refers to the diagnostic message sent by the ECU under test (DUT), acting as the master node, to the external device acting as the slave node via the LIN interface and LIN hardware driver layer. It should be noted that the LIN transport protocol layer cannot directly transmit long data. Therefore, the diagnostic received message data frame can be obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface (for example, the new message can be fragmented using the LIN transport protocol layer's fragmentation function to obtain multiple diagnostic received message data frames). Alternatively, a partial data frame from the new message can be obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface (for example, the required partial data frame can be directly extracted by calculating the memory offset and length of the partial data frame to be transmitted each time in the LIN receive buffer). This partial data frame is then used as the diagnostic received message data frame for a single transmission.
[0056] S250: The diagnostic received message data frames are reassembled through the LIN transport protocol layer to obtain the corresponding diagnostic received message data packets.
[0057] In one example, a diagnostic received message packet refers to the complete message corresponding to a new message; a diagnostic received message packet may include multiple diagnostic received message data frames. In one example, the LIN transport protocol layer, also known as LINTP, is used to manage the transmission of multiple data frames, such as diagnostic message data frames or application message data frames. In one example, the LIN transport protocol layer can reassemble diagnostic received message data frames to obtain a diagnostic received message packet, which serves as the complete message corresponding to the new message.
[0058] S260. The diagnostic message receiving callback interface is called through the LIN transport protocol layer to send the diagnostic message data packet to the upper layer application, so that the upper layer application can use the diagnostic message data packet to perform the corresponding operation and obtain the diagnostic response message data packet.
[0059] In one example, the diagnostic message receive callback interface refers to a function pointer or virtual function provided by the communication protocol stack; the diagnostic response message packet refers to the response message returned by the upper-layer application after performing the corresponding operation using the diagnostic message receive packet. After successfully receiving the diagnostic message receive packet, the LIN transport protocol layer automatically triggers and calls the diagnostic message receive callback interface to send the diagnostic message receive packet to the upper-layer application, so that the upper-layer application can perform the corresponding operation using the diagnostic message receive packet and obtain the diagnostic response message packet.
[0060] S270. The diagnostic response message data packet is unpacked using the LIN transport protocol layer to obtain the corresponding diagnostic response message data frame.
[0061] In one example, the process of unpacking the diagnostic response message data packet can also be understood as framing the diagnostic response message data packet, or fragmenting the diagnostic response message data packet.
[0062] In one example, LINTP can handle long data frame transmission. It can segment diagnostic response message packets through the LIN transport protocol layer, i.e., fragment the long diagnostic response message packets into multiple diagnostic response message data frames. This effectively overcomes the limitations of the LIN protocol itself, achieving efficient and reliable transmission of long data. For example, LINTP can fragment diagnostic response message packets exceeding 8 bytes into multiple corresponding diagnostic response message data frames.
[0063] S280: The first diagnostic response message data frame is filled into the LIN hardware driver layer through the LIN state management layer.
[0064] In one example, the first diagnostic response data frame refers to the first diagnostic response data frame that needs to be filled in the diagnostic response data packet. The first diagnostic response data frame can also be called the first diagnostic response data frame.
[0065] S290: The diagnostic response message data frame is forwarded to the associated external device through the LIN hardware driver layer.
[0066] In one example, the first diagnostic response message data frame is populated into the LIN hardware driver layer through the LIN state management layer, and then forwarded to the associated external device through the LIN hardware driver layer, so that the external device forwards the first diagnostic response message data to the associated ECU under test.
[0067] S2100: The diagnostic scheduling table is started through the LIN state management layer, and the diagnostic scheduling table is used to control the ECU under test to execute test cases and obtain the corresponding test results; wherein, the test cases are received from the application layer through the LIN interface.
[0068] It should be noted that the polling detection process of the schedule table to be switched and the polling detection process of the new message can be executed in parallel, and there is no need for a specific execution order between them. Of course, in one example, the polling detection process of the schedule table to be switched can be executed before or after the polling detection process of the new message, and there is no limitation on this.
[0069] The technical solution of this embodiment, based on the above embodiment, before the LIN state management layer starts the diagnostic scheduling table, utilizes the filling function of the LIN state management layer to obtain the first diagnostic response message data from the LIN transport protocol layer. The first diagnostic response message data frame is filled into the LIN hardware driver layer, so that the first diagnostic response message data frame is forwarded to the ECU under test through the LIN hardware driver layer and external devices. This allows the ECU under test to perform tests based on the diagnostic scheduling table and the first diagnostic response message data frame, obtain the corresponding test results, and forward them to the LIN interface through the LIN hardware driver layer and external devices, thus preventing the occurrence of invalid data corresponding to the first diagnostic response message data frame.
[0070] In one embodiment, Figure 3 This is a flowchart of another automatic testing method provided by an embodiment of the present invention. This embodiment elaborates on the diagnostic message receiving process based on the above embodiments. Figure 3 As shown, the automatic testing method in this embodiment includes the following steps:
[0071] S310. If the LIN state management layer detects a schedule to be switched, it sends a channel stop command to the LIN hardware driver layer through the LIN state management layer.
[0072] S320 interrupts the access permissions of the resources associated with the current scheduling table through the LIN hardware driver layer based on the channel stop instruction.
[0073] S330: Automatically controls the ECU under test to switch from the current schedule table to the schedule table to be switched by calling the switching schedule table interface through the LIN state management layer.
[0074] S340. When a new message is detected through the LIN interface, and the new message is a first-type diagnostic message, the associated diagnostic received message data frame is obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface.
[0075] S350: The diagnostic received message data frames are reassembled through the LIN transport protocol layer to obtain the corresponding diagnostic received message data packets.
[0076] S360: The diagnostic message receiving callback interface is called through the LIN transport protocol layer to send the diagnostic message data packet to the upper layer application, so that the upper layer application can use the diagnostic message data packet to perform the corresponding operation and obtain the diagnostic response message data packet.
[0077] S370. The diagnostic response message data packet is unpacked using the LIN transport protocol layer to obtain the corresponding diagnostic response message data frame.
[0078] S380 populates the first diagnostic response message data frame into the LIN hardware driver layer through the LIN state management layer.
[0079] S390 forwards diagnostic response message data frames to associated external devices through the LIN hardware driver layer.
[0080] S3100: The diagnostic scheduling table is started through the LIN state management layer, and the diagnostic scheduling table is used to control the ECU under test to execute test cases and obtain the corresponding test results; wherein, the test cases are received from the application layer through the LIN interface.
[0081] S3110 receives diagnostic transmission message data frames sent by external devices that match the diagnostic response message data frames through the LIN hardware driver layer.
[0082] In one example, the diagnostic transmission message data frame refers to the data frame obtained by the ECU under test (DUT) based on the diagnostic response message data frame during relevant tests. After receiving the diagnostic transmission message data frame, the DUT sends it to the LIN hardware driver layer via an external device with which it has established LIN communication. In another example, the diagnostic transmission message data frame can also be a diagnostic message data frame unrelated to the diagnostic response message data frame, but rather a diagnostic message data frame actively sent by the DUT to an external device. In this case, the DUT can proactively send the diagnostic transmission message data frame to the external device, which then forwards it to the LIN hardware driver layer.
[0083] S3120. If the diagnostic message data frame is detected as a second type of diagnostic message through the LIN interface and the diagnosis has not been completed, other diagnostic response message data frames are filled into the LIN hardware driver layer through the LIN interface, and the LIN hardware driver layer is returned to forward the diagnostic response message data frame to the associated external device until the diagnosis is completed.
[0084] In one example, other diagnostic response message data frames refer to all diagnostic response message data frames in the diagnostic response message data packet except for the first diagnostic response message data frame; the second type of diagnostic message refers to the diagnostic message sent by the external device as a slave node to the ECU under test as the master node through the LIN interface and LIN hardware driver layer; incomplete diagnosis means that all diagnostic response message data frames in the diagnostic response message data packet have not been transmitted.
[0085] In one example, after receiving a diagnostic transmission message data frame from an external device that matches the diagnostic response message data frame via the LIN hardware driver layer, the LIN interface can be used to determine whether the diagnostic transmission message data frame is a second-type diagnostic message and whether the diagnosis is complete. If the diagnosis is not complete, the second diagnostic response message data frame from the diagnostic response message data packet is filled into the LIN hardware driver layer via the LIN interface. Then, the LIN hardware driver layer forwards the second diagnostic response message data frame to the associated external device. The LIN hardware driver layer then receives a diagnostic transmission message data frame from the external device that matches the second diagnostic response message data frame. If the LIN interface detects that the diagnostic transmission message data frame matching the second diagnostic response message data frame is a second-type diagnostic message and the diagnosis is not complete, the diagnostic response is sent via the LIN interface. The third diagnostic response message data frame in the message data packet is filled into the LIN hardware driver layer; then, the LIN hardware driver layer forwards the third diagnostic response message data frame in the diagnostic response message data packet to the associated external device. Then, the LIN hardware driver layer receives the diagnostic transmission message data frame sent by the external device that matches the third diagnostic response message data frame, and so on, until the last diagnostic response message data frame in the diagnostic response message data packet is filled into the LIN hardware driver layer. The LIN hardware driver layer forwards the last diagnostic response message data frame to the associated external device and receives the diagnostic transmission message data frame sent by the external device that matches the last diagnostic response message data frame. The LIN interface detects that the last transmission message data frame is a second type diagnostic message, and then determines whether the diagnosis is complete. If so, S3130 continues to be executed.
[0086] S3130, switch to the application scheduling table of the previous moment through the LIN state management layer.
[0087] In one example, the application scheduling table of the previous moment refers to the application scheduling table used before the current diagnostic scheduling table was switched. In this embodiment, after completing the diagnosis through the LIN state management layer, the LIN hardware driver layer, and the LIN interface, the LIN state management layer can switch to the application scheduling table of the previous moment and return to perform the process of determining whether a new scheduling table to be switched has been detected.
[0088] The technical solution of this embodiment, based on the above embodiment, receives a diagnostic transmission message data frame sent by an external device that matches the diagnostic response message data frame through the LIN hardware driver layer. If the diagnostic transmission message data frame is detected as a second type of diagnostic message through the LIN interface and the diagnosis is not completed, other diagnostic response message data frames are filled into the LIN hardware driver layer through the LIN interface, and the step of forwarding the diagnostic response message data frame to the associated external device through the LIN hardware driver layer is returned until the diagnosis is completed. Only then is the LIN state management layer switched to the application scheduling table of the previous moment. This effectively ensures the closed-loop operation of the diagnostic process and the validity of the verification operation after the diagnosis is completed, thereby ensuring the integrity of the diagnostic task. Furthermore, it avoids signal conflicts between the application scheduling table and the diagnostic scheduling table, ensuring communication security and resource isolation.
[0089] In one embodiment, Figure 4 This is a flowchart of another automatic testing method provided by an embodiment of the present invention. This embodiment elaborates on the application message receiving process based on the above embodiments. Figure 4 As shown, the automatic testing method in this embodiment includes the following steps:
[0090] S410. If the LIN state management layer detects a schedule to be switched, it sends a channel stop command to the LIN hardware driver layer through the LIN state management layer.
[0091] S420 interrupts the access permissions of the resources associated with the current scheduling table through the LIN hardware driver layer based on the channel stop instruction.
[0092] S430: Automatically controls the ECU under test to switch from the current schedule table to the schedule table to be switched by calling the switching schedule table interface through the LIN state management layer.
[0093] S440. Start the switchover schedule table through the LIN state management layer, and use the switchover schedule table to control the ECU under test to execute test cases and obtain the corresponding test results; wherein, the test cases are received from the application layer through the LIN interface.
[0094] S450: When a new message is detected through the LIN interface, and the new message is an application message, the associated application message data frame is obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface.
[0095] In one example, the receive buffer interface can also be called an Rx Buffer interface; the LIN receive buffer can also be called a LIN Rx Buffer. In one example, the middleware layer can contain one or more LIN Rx Buffers. A LIN Rx Buffer refers to a receive buffer configured for LIN bus communication, used to temporarily buffer message data frames sent by the ECU under test. In one example, the LIN Rx Buffer can be configured via API to decouple the application layer from external devices connected to the LIN hardware driver layer. In one example, the size of the LIN Rx Buffer can be dynamically adjusted adaptively based on the testing requirements of the automated test platform, thus achieving dynamic allocation of the LIN Rx Buffer.
[0096] In one example, after receiving a new message through the LIN interface and the LIN hardware driver layer, the LIN interface is used to check whether the new message is an application message. If the new message is an application message, the LIN interface can be used to directly call the receive buffer interface to obtain the associated application message data frame from the LIN receive buffer.
[0097] S460 backs up application message data frames to the user message array via the LIN interface.
[0098] In one example, the user message array refers to a pre-configured temporary buffer for temporarily storing application message data frames. In practice, there may be situations where multiple upper-layer applications use an automated test platform consisting of a LIN interface, LIN transport protocol layer, LIN state management layer, and LIN hardware driver layer. The original application message data frame data can be backed up to the user message array. Even if one upper-layer application modifies the original application message data frame, other different upper-layer applications can still retrieve the original application message data frame from the user message array at any time. This allows other different upper-layer applications to perform corresponding operations based on the original application message data frame, effectively improving the redundancy design efficiency of the original application message data frame.
[0099] S470: The application message data frame is sent to the application layer by calling the application message reception callback interface through the LIN interface, so that the application layer can perform corresponding operations based on the application message data frame.
[0100] In one example, the application message receive callback interface, also known as the application message Rx callback interface, is a predefined function interface. When the LIN interface receives an application message from the ECU under test through the LIN bus, the LIN interface can automatically call the application message receive callback interface and send the application message data frame to the upper layer application, so that the upper layer application can perform corresponding operations based on the application message data frame, thus realizing real-time response to the application message data frame.
[0101] In one embodiment, before detecting a new message through the LIN interface, the automatic testing method further includes: receiving the new message sent by the ECU under test through the LIN interface; and storing the new message in the LIN receive buffer; wherein the LIN receive buffer is managed using a receive FIFO. In one example, the receive FIFO can also be called an Rx FIFO. In actual operation, the ECU under test can periodically or in real time send new messages to associated external devices, and the external devices send the new messages to the LIN hardware driver layer, which then sends the new messages to the LIN interface. After the LIN interface receives the new message, it can temporarily store the new message in the intermediate LIN receive buffer, effectively avoiding timing conflicts caused by the LIN interface directly operating hardware registers. Simultaneously, using a receive FIFO to manage the new messages buffered in the LIN receive buffer can prevent data frame loss due to processing delays or excessively long interruption times.
[0102] In one embodiment, the automatic testing method further includes: receiving application message receiving callback interfaces and diagnostic message receiving callback interfaces registered by each upper-layer application through a LIN interface, so as to register the application message receiving callback interface and diagnostic message receiving callback interface corresponding to each upper-layer application with the LIN interface.
[0103] In one example, upper-layer applications can define their own application message receiving callback interfaces and diagnostic message receiving callback interfaces according to the AUTOSAR specification, declare messages and signals in the LIN Description File (LDF), and bind PDUs with the application message receiving callback interfaces and diagnostic message receiving callback interfaces in the ARXML configuration. Then, at runtime, the application message receiving callback interfaces and diagnostic message receiving callback interfaces corresponding to each upper-layer application are dynamically registered with LINIF. This achieves the effect of supporting multiple upper-layer applications and multiple application message receiving callback interfaces and diagnostic message receiving callback interfaces. That is, each upper-layer application corresponds to one application message receiving callback interface and one diagnostic message receiving callback interface, thereby ensuring that the LIN interface can support the operation of multiple upper-layer applications, and that multiple scripts can use the automated testing platform at the same time.
[0104] In one example, the input files required for LIN testing (e.g., LDF) can be parsed into CLASS objects, the driver can be abstracted into CLASS objects, and an interface can be provided to the upper-level application. This allows developers to focus only on functionality, effectively improving development efficiency.
[0105] In one embodiment, the automated testing method further includes: initializing the external devices associated with the LIN hardware driver layer upon receiving initialization requests from all upper-layer applications associated with the LIN interface. In one example, the initialization request refers to a request to initialize the channel between all external devices establishing communication connections with the ECU under test and the LIN hardware driver layer. In this example, the LIN interface initializes the external devices associated with the LIN hardware driver layer only after all upper-layer applications associated with the LIN interface send initialization requests. This prevents data transmission interruption in one upper-layer application from occurring while another upper-layer application is using the channel for data transmission, thus effectively preventing data frame loss and ensuring data transmission integrity.
[0106] In one embodiment, the automated testing method further includes: upon receiving resource release requests from all upper-layer applications associated with the LIN interface, releasing resources for external devices associated with the LIN hardware driver layer. In one example, the resource release request refers to a request to release resources for all external devices that have established communication connections with the ECU under test. In one example, the LIN interface only releases resources for external devices associated with the LIN hardware driver layer upon receiving resource release requests from all upper-layer applications associated with the LIN interface, to avoid data loss due to forced resource release caused by some external devices not completing their operations, thus ensuring data integrity.
[0107] In one embodiment, the automated testing method further includes: encapsulating the interfaces of all external devices that establish communication connections with the ECU under test into a LIN hardware driver layer. In one example, the interfaces of the external devices may include, but are not limited to, at least one of the following: communication protocol interfaces of the external devices; storage and expansion interfaces of the external devices; analog and dedicated interfaces of the external devices; register operation interfaces of the external devices, etc. In one example, encapsulating the interfaces of all external devices that establish communication connections with the ECU under test into a LIN hardware driver layer can be understood as providing a unified interface for all external devices connected to the ECU under test, thereby shielding the underlying hardware differences between the various external devices, isolating hardware differences, solving the problems of high learning costs and code migration for user operation scripts, facilitating code portability, and requiring only hardware adaptation when switching external devices or other hardware.
[0108] In one embodiment, Figure 5 This is a flowchart of another automatic testing method provided by an embodiment of the present invention. This embodiment is a preferred embodiment, and the automatic testing process is described below. In this embodiment, the automatic testing process is described using a 3C diagnostic message as the first type of diagnostic message and a 3D diagnostic message as the second type of diagnostic message as an example. Figure 5 As shown, the automated testing process in this embodiment includes the following steps:
[0109] S510, Initialize external devices.
[0110] Based on the mapping relationship between the read LDF and the configuration file, the associated external devices can be initialized, and the mapping relationship between the channel ID and the LDF can be recorded.
[0111] S520, running thread.
[0112] The threading.Thread.run class can be used as the logical entry point for the actual execution after the thread starts.
[0113] S530 and LINSM poll the scheduling table.
[0114] For example, the scheduling table can be polled using LinSM_mainfunction to detect if there are any new scheduling entries.
[0115] If there is a new schedule table for S540 and LINSM, then execute S550.
[0116] S550 and LINSM send a channel stop command to LINHW to stop the channel.
[0117] S560 and LINSM switch the scheduling table.
[0118] S570 If the diagnostic schedule is ready and the data is available, LINSM populates the first diagnostic response message data frame.
[0119] S580, LINSM startup schedule.
[0120] S590 and LINIF poll the messages.
[0121] For example, the messages in the LIN receive buffer can be polled using Linif_To_Asw_Rxindication to determine if a new message has appeared.
[0122] S5100 and LINIF determine if there is a new message; if so, S5110 is executed.
[0123] S5110 and LINIF determine whether it is a 3C diagnostic message. If yes, execute S5120; otherwise, execute S5230.
[0124] S5120: Retrieve the associated diagnostic receive message data frame from the LIN receive buffer.
[0125] For example, the LIN receive buffer can be Lin_Message_List_append, and the LIN interface can be Linif_Rxindication. That is, new messages received from the ECU under test or external devices can be stored in Lin_Message_List_append, and the associated diagnostic received message data frame can be obtained from Lin_Message_List_append through Linif_Rxindication.
[0126] S5130 and LINTP assemble the diagnostic received message data frames into diagnostic received message data packets.
[0127] S5140: Diagnose whether the received message data packet is a complete data packet. If so, execute S5150.
[0128] S5150 calls the diagnostic message receiving callback interface to send the diagnostic message data packet to the upper layer application.
[0129] S5160: The upper-layer application receives diagnostic receive message data packets and performs corresponding operations to obtain diagnostic response message data packets.
[0130] For example, a diagnostic response message packet can be a UDS response message packet.
[0131] S5170. The diagnostic response message data packet is unpacked to obtain the corresponding diagnostic response message data frame.
[0132] S5180, Start the diagnostic scheduling table.
[0133] S5190: Determine whether the diagnostic transmission message data frame is a 3D diagnostic message. If so, execute S5200.
[0134] S5200: Determine whether the diagnosis is complete. If yes, execute S5210; otherwise, execute S5220.
[0135] S5210, Switch to the application scheduling table of the previous moment.
[0136] S5220, fill in other diagnostic response message data frames.
[0137] S5230: Retrieve the associated application message data frame from the LIN receive buffer.
[0138] S5240: Back up the application message data frame to the user message array via the LIN interface.
[0139] For example, the user message array can be User_Message_Callout_List, and the associated application message data frame can be obtained from Lin_Message_List_append through Linif_Rxindication and stored in User_Message_Callout_List.
[0140] S5250 calls the application message receiving callback interface to send the application message data frame to the application layer.
[0141] The technical solution in this embodiment introduces an automated testing platform including LINIF, LINSM, LINTP, and LINHW, and separates the automated testing platform from the upper-layer application. This supports the platformization of test cases for the upper-layer application, facilitating the upgrading of underlying external devices. Furthermore, the automated testing platform automatically configures and schedules the schedule table, solving the technical problems of low manual efficiency and real-time performance, effectively improving the configuration and scheduling efficiency. Each upper-layer application can test multiple test cases, effectively improving the testing efficiency of the ECU under test. Moreover, the use of driver-to-driver isolation and a FIFO mechanism to manage the LIN receive buffer makes the test cases more stable. Finally, by uniformly encapsulating the interfaces of various external devices in LINHW, users only need to focus on functionality, effectively improving development efficiency.
[0142] In one embodiment, Figure 6 This is a structural block diagram of an automated testing platform provided in an embodiment of the present invention. The automated testing platform in this embodiment includes: a LIN interface 610, a LIN hardware driver layer 620, and a LIN state management layer 630;
[0143] The LIN interface 610 is connected to the application layer, one end of the LIN hardware driver layer 620 is connected to the LIN interface and the LIN state management layer 630, the other end of the LIN hardware driver layer 620 is connected to one end of the external device, and the other end of the external device is connected to the ECU under test.
[0144] If the LIN state management layer 630 detects a schedule to be switched, it sends a channel stop command to the LIN hardware driver layer through the LIN state management layer 630.
[0145] The LIN hardware driver layer 620 interrupts the access permissions of the resources associated with the current scheduling table based on the channel stop instruction;
[0146] The LIN state management layer 630 calls the switching schedule table interface to automatically control the ECU under test to switch from the current schedule table to the schedule table to be switched;
[0147] The LIN state management layer 630 starts the switching schedule table and uses the switching schedule table to control the ECU under test to execute test cases and obtain the corresponding test results; the test cases are received from the application layer through the LIN interface 610.
[0148] The technical solution of this embodiment configures a LIN interface, a LIN hardware driver layer, and a LIN state management layer on an automated testing platform. When the LIN state management layer detects a scheduling table to be switched, it automatically sends a channel stop command to the LIN hardware driver layer. The LIN hardware driver layer then interrupts the resource access permissions associated with the current scheduling table based on the channel stop command, thus avoiding frame timing overlap between the old and new scheduling tables and preventing bus conflicts. This ensures safe switching of communication states and data integrity. Furthermore, the LIN state management layer automatically controls the ECU under test to switch from the current scheduling table to the scheduling table to be switched by calling the scheduling table switching interface. This solves the technical problems of low manual efficiency and real-time performance caused by manual configuration and switching of scheduling tables in the prior art, effectively improving the efficiency and real-time performance of scheduling table switching and configuration. Moreover, the LIN state management layer starts the scheduling table to be switched and uses it to control the ECU under test to execute test cases and obtain the corresponding test results, thereby effectively improving testing efficiency.
[0149] In one embodiment, Figure 7 This is a structural block diagram of another automated testing platform provided in this embodiment of the invention. The automated testing platform in this embodiment... Figure 6 Based on the above, the test platform also includes a LIN transport protocol layer. For example... Figure 7 As shown, the automatic test platform in this embodiment includes: a LIN interface 610, a LIN hardware driver layer 620, a LIN state management layer 630, and a LIN transport protocol layer 640.
[0150] The LIN transport protocol layer 640 establishes connections with the LIN interface 610, the LIN hardware driver layer 620, and the LIN state management layer 630, respectively. When a new message is detected through the LIN interface 610, and the new message is a first-type diagnostic message, the LIN interface 610 calls the receive buffer interface to obtain the associated diagnostic receive message data frame from the LIN receive buffer.
[0151] The diagnostic received message data frame is packetized by the LIN transport protocol layer 640 to obtain the corresponding diagnostic received message data packet.
[0152] The diagnostic message receiving callback interface is called through the LIN transport protocol layer 640 to send the diagnostic message receiving data packet to the upper layer application, so that the upper layer application can use the diagnostic message receiving data packet to perform the corresponding operation and obtain the diagnostic response message data packet;
[0153] The diagnostic response message data packets are depacked using the LIN transport protocol layer 640 to obtain the corresponding diagnostic response message data frames.
[0154] In one embodiment, when the schedule to be switched is a diagnostic schedule, before starting the schedule to be switched through the LIN state management layer, the following steps are further included:
[0155] The first diagnostic response message data frame is populated into the LIN hardware driver layer through the LIN state management layer.
[0156] The diagnostic response message data frame is forwarded to the associated external device through the LIN hardware driver layer;
[0157] Accordingly, the LIN state management layer initiates the switchover schedule table, and the switchover schedule table is used to control the ECU under test to execute test cases, obtaining the corresponding test results, including:
[0158] The diagnostic scheduling table is started through the LIN state management layer, and the diagnostic scheduling table is used to control the ECU under test to execute test cases and obtain the corresponding test results.
[0159] In one embodiment, after using a diagnostic scheduling table to control the ECU under test to execute test cases and obtain the corresponding test results, the method further includes:
[0160] The diagnostic response message data frame sent by the external device is received through the LIN hardware driver layer and matches the diagnostic response message data frame.
[0161] If the diagnostic message data frame is detected as a second type of diagnostic message through the LIN interface and the diagnosis has not been completed, other diagnostic response message data frames are filled into the LIN hardware driver layer through the LIN interface, and the process of forwarding the diagnostic response message data frame to the associated external device through the LIN hardware driver layer is returned until the diagnosis is completed.
[0162] Switch to the application scheduling table of the previous moment through the LIN state management layer.
[0163] In one embodiment, when a new message is detected through the LIN interface and the new message is an application message, the associated application message data frame is obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface.
[0164] Application message data frames are backed up to the user message array via the LIN interface;
[0165] The application message data frame is sent to the application layer by calling the application message reception callback interface through the LIN interface, so that the application layer can perform corresponding operations based on the application message data frame.
[0166] In one embodiment, before detecting a new message via the LIN interface, the method further includes:
[0167] Receive new messages sent by the ECU under test via the LIN interface;
[0168] New messages are stored in the LIN receive buffer; the LIN receive buffer is managed using a receive FIFO.
[0169] In one embodiment, automatically controlling the ECU under test to switch from the current scheduling table to the scheduling table to be switched through the LIN state management layer includes:
[0170] The LIN state management layer automatically writes the configuration file of the scheduling table to be switched into the LIN hardware driver layer.
[0171] The configuration file of the scheduling table to be switched is sent to the associated external device through the LIN hardware driver layer;
[0172] The configuration file of the scheduling table to be switched is sent to the ECU under test through an external device to establish a communication connection.
[0173] In one embodiment, the application message receiving callback interface and diagnostic message receiving callback interface registered by each upper-layer application are received through the LIN interface, so as to register the application message receiving callback interface and diagnostic message receiving callback interface corresponding to each upper-layer application with the LIN interface.
[0174] In one embodiment, upon receiving initialization requests from all upper-layer applications associated with the LINIF interface, the external devices associated with the LIN hardware driver layer are initialized.
[0175] In one embodiment, upon receiving resource release requests from all upper-layer applications associated with the LINIF interface, resources are released for external devices associated with the LIN hardware driver layer.
[0176] In one embodiment, the interfaces of all external devices that establish communication connections with the ECU under test are encapsulated in the LIN hardware driver layer.
[0177] It should be noted that the explanation and implementation process of various parameters involved in the application of the automated testing platform, such as the LIN state management layer, LIN hardware driver layer, channel stop command, and resource access permissions, can be found in the description of the corresponding parameters in the automated testing method mentioned above, and will not be repeated here.
[0178] The automatic testing platform provided in this embodiment of the invention can execute the automatic testing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0179] In one embodiment, Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 8 The diagram illustrates a schematic representation of an electronic device 10 that can be used to implement embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0180] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0181] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0182] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as automated testing methods.
[0183] In some embodiments, the automated testing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the automated testing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the automated testing method by any other suitable means (e.g., by means of firmware).
[0184] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0185] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0186] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0187] To provide interaction with a user, the systems and techniques described herein 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 pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; 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 sound input, voice input, or tactile input).
[0188] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0189] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0190] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the automatic testing method provided in any embodiment of this application.
[0191] In the implementation of the computer program product, computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0192] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0193] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An automatic testing method, characterized in that, Applied to automated testing platforms; The automated testing platform includes: a LIN interface, a LIN hardware driver layer, and a LIN state management layer; the method includes: If the LIN state management layer detects a schedule to be switched, it sends a channel stop command to the LIN hardware driver layer. The LIN hardware driver layer interrupts the access permissions of the resources associated with the current scheduling table based on the channel stop instruction; The LIN state management layer automatically controls the ECU under test to switch from the current scheduling table to the scheduling table to be switched by calling the switching scheduling table interface. The LIN state management layer initiates the switchover schedule table, and the switchover schedule table is used to control the ECU under test to execute test cases and obtain the corresponding test results; wherein, the test cases are received from the application layer through the LIN interface.
2. The method according to claim 1, characterized in that, The test platform further includes a LIN transport protocol layer; the method further includes: If a new message is detected through the LIN interface and the new message is a first type diagnostic message, the associated diagnostic received message data frame is obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface. The diagnostic received message data frame is packetized by the LIN transport protocol layer to obtain the corresponding diagnostic received message data packet; The diagnostic message receiving callback interface is called through the LIN transport protocol layer to send the diagnostic message data packet to the upper layer application, so that the upper layer application can use the diagnostic message data packet to perform the corresponding operation and obtain the diagnostic response message data packet; The diagnostic response message data packet is depacked using the LIN transport protocol layer to obtain the corresponding diagnostic response message data frame.
3. The method according to claim 2, characterized in that, If the schedule to be switched is a diagnostic schedule, the process further includes the following steps before starting the schedule to be switched through the LIN state management layer: The first diagnostic response message data frame is filled into the LIN hardware driver layer through the LIN state management layer. The diagnostic response message data frame is forwarded to the associated external device through the LIN hardware driver layer; Accordingly, the LIN state management layer initiates the switchover schedule table, and the switchover schedule table is used to control the ECU under test to execute test cases, obtaining the corresponding test results, including: The diagnostic scheduling table is initiated through the LIN state management layer, and the diagnostic scheduling table is used to control the ECU under test to execute test cases and obtain the corresponding test results.
4. The method according to claim 3, characterized in that, After using the diagnostic scheduling table to control the ECU under test to execute test cases and obtain the corresponding test results, the method further includes: The LIN hardware driver layer receives diagnostic transmission message data frames that match the diagnostic response message data frames sent by the external device. If the diagnostic message data frame is detected as a second type of diagnostic message through the LIN interface and the diagnosis has not been completed, other diagnostic response message data frames are filled into the LIN hardware driver layer through the LIN interface, and the step of forwarding the diagnostic response message data frame to the associated external device through the LIN hardware driver layer is returned until the diagnosis is completed. The LIN state management layer switches to the application scheduling table of the previous moment.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: If a new message is detected through the LIN interface and the new message is an application message, the associated application message data frame is obtained from the LIN receive buffer by calling the receive buffer interface through the LIN interface. The application message data frame is backed up to the user message array via the LIN interface; The application message data frame is sent to the application layer by calling the application message reception callback interface through the LIN interface, so that the application layer can perform corresponding operations based on the application message data frame.
6. The method according to claim 2 or 5, characterized in that, Before a new message is detected through the LIN interface, the process also includes: Receive new messages sent by the ECU under test through the LIN interface; The new message is stored in the LIN receive buffer; wherein the LIN receive buffer is managed using a receive FIFO.
7. The method according to any one of claims 1-6, characterized in that, The step of automatically controlling the ECU under test to switch from the current scheduling table to the scheduling table to be switched through the LIN state management layer includes: The configuration file of the scheduling table to be switched is automatically written into the LIN hardware driver layer through the LIN state management layer; The configuration file of the scheduling table to be switched is sent to the associated external device through the LIN hardware driver layer; The configuration file of the scheduling table to be switched is sent to the ECU under test through the external device to establish a communication connection.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: The application message receiving callback interface and diagnostic message receiving callback interface registered by each upper-layer application are received through the LIN interface, so as to register the application message receiving callback interface and diagnostic message receiving callback interface corresponding to each upper-layer application with the LIN interface.
9. The method according to any one of claims 1-7, characterized in that, The method further includes: Upon receiving initialization requests from all upper-layer applications associated with the LINIF interface, the external devices associated with the LIN hardware driver layer are initialized.
10. The method according to any one of claims 1-7, characterized in that, The method further includes: Upon receiving resource release requests from all upper-layer applications associated with the LINIF interface, resources are released for the external devices associated with the LIN hardware driver layer.
11. The method according to any one of claims 1-7, characterized in that, The method further includes: The interfaces of all external devices that establish communication connections with the ECU under test are encapsulated in the LIN hardware driver layer.
12. An automated testing platform, characterized in that, The automated testing platform is used to execute the automated testing method according to any one of claims 1-11; The automated testing platform includes: a LIN interface, a LIN hardware driver layer, and a LIN state management layer; The LIN interface is connected to the application layer, one end of the LIN hardware driver layer is connected to the LIN interface and the LIN state management layer, the other end of the LIN hardware driver layer is connected to one end of an external device, and the other end of the external device is connected to the ECU under test.
13. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the automatic testing method according to any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the automatic testing method according to any one of claims 1-11.
15. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the automatic testing method according to any one of claims 1-11.
