PMS signal test method, device, equipment, medium and program product
Through a predefined test program, the test packets are automatically sent and received, and the software signal mapping logic is used to compare variable values, which solves the problem of low PMS signal testing efficiency in the HIL test solution, and achieves the efficiency and accuracy of PMS signal testing.
Patent Information
- Application Number
- CN202411033154.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
The existing HIL testing schemes have shortcomings in PMS signal testing efficiency, especially because the number of PMS software signals is huge and complex, resulting in low testing efficiency, complex operation and high cost, and the need to manually send test messages, which reduces the testing efficiency.
Automatically send and receive test messages through predefined test programs, use software signal mapping logic to obtain test result messages after a preset time, and compare the first variable value and the second variable value to determine whether the software signal is abnormal, realizing automation PMS signal test.
It significantly improves the efficiency and accuracy of PMS signal testing, reduces dependence on hardware equipment, reduces testing costs, and realizes the automation and efficiency of signal testing.
Smart Images

Figure CN118962395A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle testing technology, and in particular to a signal testing method, device, equipment, medium and program product for a PMS. Background Art
[0002] With the rapid development of new energy vehicle technology, the development speed of vehicle powertrain management system (PMS) has been significantly accelerated. However, after the development of PMS is completed, it is necessary to perform software signal testing on it.
[0003] At present, Hardware-in-the-Loop (HIL) testing can be used as a feasible solution. Specifically, first conduct demand analysis and test requirements, then develop simulation models and conduct preliminary verification, then select and configure the HIL test platform, integrate the PMS under test with the platform and verify the connection, design detailed test cases, run tests and record the power domain controller response, and finally collect and analyze test data, verify the results and write a report.
[0004] However, due to the large number and complexity of PMS software signals, the above HIL test solution has shortcomings in test efficiency. Summary of the invention
[0005] The present application provides a PMS signal testing method, device, equipment, medium and program product to solve the problem of insufficient efficiency in the prior art in the PMS signal testing.
[0006] In a first aspect, the present application provides a signal testing method for a PMS, the method comprising:
[0007] In response to the user's operation, a predefined test program is run to send a test message to a power domain controller PMS of the vehicle, wherein the test message includes a first variable value set for the target variable;
[0008] After a preset time, based on the software signal mapping logic in the test program, a test result message is obtained from the PMS, wherein the test result message includes a second variable value of the target variable configured by the PMS according to the test message;
[0009] Based on the first variable value and the second variable value, it is determined whether the software signal in the PMS is abnormal.
[0010] In a possible design of the first aspect, sending the test message to the power domain controller PMS of the vehicle includes: sending the test message to the PMS through a universal measurement and calibration protocol XCP;
[0011] Accordingly, obtaining the test result message from the PMS based on the software signal mapping logic in the test program includes:
[0012] Based on the software signal mapping logic in the test program, the test result message is obtained from the underlying software of the PMS via a controller area network (CAN) message.
[0013] In a possible design of the first aspect, sending a test message to a power domain controller PMS of the vehicle further includes:
[0014] Sending the test message to the PMS via the controller area network (CAN) protocol;
[0015] Accordingly, obtaining the test result message from the PMS based on the software signal mapping logic in the test program includes:
[0016] Based on the software signal mapping logic in the test program, the test result message is obtained from the application layer software of the PMS through the universal measurement and calibration protocol XCP message.
[0017] In a possible design of the first aspect, determining whether the software signal in the PMS is abnormal based on the first variable value and the second variable value includes:
[0018] If the first variable value is consistent with the second variable value, it is determined that there is no abnormality in the software signal in the PMS;
[0019] If the first variable value is inconsistent with the second variable value, it is determined that the software signal in the PMS is abnormal.
[0020] In a possible design of the first aspect, in response to the user's operation, before running the predefined test program and sending the test message to the power domain controller PMS of the vehicle, the method further includes:
[0021] The test program is generated based on a pre-written software program and a predefined software signal interface information table, wherein the software signal interface information table is used to define the interface information of the application layer software and the underlying software of the PMS, and the test program includes a system variable definition unit, a signal mapping unit, a system variable assignment unit, a system variable value acquisition unit, and a result comparison and output unit.
[0022] In a possible design of the first aspect, the method further includes:
[0023] The test results of the software signal in the PMS are recorded in the software signal interface information table.
[0024] In a possible design of the first aspect, the test program is written in C language;
[0025] Accordingly, the running of the predefined test program includes:
[0026] The test program is run through the Tsmaster software platform.
[0027] In a second aspect, the present application provides a signal testing device for a PMS, comprising:
[0028] A sending module, configured to run a predefined test program in response to a user's operation, and send a test message to a power domain controller PMS of the vehicle, wherein the test message includes a first variable value set for a target variable;
[0029] an acquisition module, configured to acquire a test result message from the PMS after a preset time period based on the software signal mapping logic in the test program, wherein the test result message includes a second variable value of the target variable configured by the PMS according to the test message;
[0030] A processing module is used to determine whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0031] In a third aspect, the present application provides a computer device, comprising: a transceiver, a processor, and a memory communicatively connected to the processor;
[0032] The memory stores computer-executable instructions;
[0033] The processor executes the computer-executable instructions stored in the memory to implement the signal testing method for the PMS as described in any one of the first aspects.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the signal testing method of the PMS as described in any one of the first aspects.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the signal testing method of the PMS as described in any one of the first aspects.
[0036] The signal testing method, device, equipment, medium and program product of the PMS provided in the present application relate to the field of vehicle testing technology. First, based on a predefined test program, a test message is sent to the PMS of the vehicle. Then, after a preset period of time, according to the software signal mapping logic in the test program, the test message is obtained from the PMS, thereby ensuring that the PMS has enough time to process the test message and generate corresponding test results. Finally, based on the test message and the test result message, it is determined whether there is an abnormality in the software signal in the PMS. Among them, the test message includes a first variable value set for the target variable, and the test result message includes a second variable value of the target variable after the PMS is configured according to the test message. This method can effectively start the response mechanism of the PMS and accurately verify the response behavior of the PMS, thereby improving the signal testing efficiency of the PMS. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] Figure 1 A schematic diagram of an application scenario of a signal testing method for a PMS provided in this application;
[0039] Figure 2 A schematic diagram of a flow chart of a first embodiment of a signal testing method for a PMS provided in the present application;
[0040] Figure 3 A schematic diagram of a flow chart of a second embodiment of a signal testing method for a PMS provided in the present application;
[0041] Figure 4 A schematic diagram of a flow chart of a third embodiment of a signal testing method for a PMS provided in the present application;
[0042] Figure 5 A schematic diagram of a flow chart of a fourth embodiment of a signal testing method for a PMS provided in the present application;
[0043] Figure 6 A flowchart of a fifth embodiment of a signal testing method for a PMS provided in the present application;
[0044] Figure 7 A schematic diagram of the construction process of a test program provided for this application;
[0045] Figure 8 A schematic diagram of a signal transmission test process framework of a PMS provided in this application;
[0046] Fig. 9 A schematic diagram of a signal reception test process framework of a PMS provided in this application;
[0047] Fig.10 A schematic diagram of the structure of a signal testing device for a PMS according to a first embodiment of the present invention;
[0048] Fig.11 A schematic diagram of the structure of a computer device provided for application.
[0049] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0051] First, let’s explain the terms involved in this application:
[0052] Transport (abbreviated as Tx): In electronic communications and network technology, it is used to mark and describe the direction in which a signal is sent;
[0053] Rx (Receive, abbreviated as: Rx): In electronic communications and network technology, it is used to mark and describe the direction of signal reception;
[0054] C language: It is a general-purpose, process-oriented and abstract programming language;
[0055] Tsmaster: It is a virtual instrument software platform that can connect, configure and control all Tongxing hardware tools and devices to achieve functions such as vehicle bus embedded code generation, monitoring, simulation, development, diagnosis, and calibration;
[0056] Controller Area Network (CAN) protocol: a serial communication protocol used for real-time communication, mainly used in the automotive industry and the control of various equipment. It is an open local area network communication standard;
[0057] Universal Measurement and Calibration Protocol (XCP): A standardized communication protocol used to access and modify data in automotive electronic control units in real time, supporting multiple transport layer protocols;
[0058] Hardware-in-the-Loop (HIL): By combining actual hardware components (such as electronic control units) with a virtual simulation environment, real operating conditions are simulated to verify and optimize system performance;
[0059] Powertrain Management System (PMS) is a key component in the vehicle responsible for managing and controlling the powertrain system, which includes multiple sets of signals.
[0060] With the rapid development of new energy vehicle technology, the development speed of PMS has significantly accelerated, and the content of changes has increased. Porting code is often used for modification during the development process. However, after the development of PMS is completed, it must be subjected to comprehensive software signal testing to ensure the correctness and reliability of its functions. These tests include verifying the controller's response to various input signals, ensuring the accuracy of signal processing, and detecting potential abnormal situations. Through software signal testing, the performance stability of PMS can be improved, ensuring its safety and efficiency in practical applications.
[0061] At this stage, HIL testing can provide a feasible solution for signal testing of PMS, realizing the path of message signals, underlying software signals, and application layer software signals. In the HIL test solution, firstly, based on the demand analysis and test requirements, the test objectives and scope are clarified, and a simulation model is developed for preliminary verification to ensure its accuracy and stability. Then, a suitable HIL test platform is selected and configured, and the PMS under test is integrated with the platform to verify the reliability of the connection. Next, detailed test cases are designed to cover various functions and work scenarios, and the tests are run and the response data of the PMS is recorded. Finally, the test data is collected and analyzed, the results are verified, and a report is written.
[0062] However, due to the large number and complexity of PMS software signals, the above HIL test scheme still has shortcomings in test efficiency. Specifically, designing and managing a large number of test cases becomes cumbersome, test execution time and resource consumption increase significantly, test data collection and analysis become more complicated, and verification of test results and report writing require more time and effort. Therefore, although the HIL test scheme has improved the efficiency of PMS signal testing to a certain extent, in the face of complex signal environments, it still needs further optimization and improvement to better meet actual test needs.
[0063] In view of the above problems, the inventors found in the process of studying the signal testing method of PMS that in the HIL test scheme, the operation of the HIL equipment is relatively complicated and costly, and the test message needs to be sent manually, which significantly reduces the efficiency of the PMS signal test to a certain extent. Based on this, the inventors considered whether it is possible to pre-write a test program according to the logic of the PMS signal test to perform the PMS signal test process in an automated form. Specifically, after the test program is successfully started, a test message is sent to the vehicle's PMS. To ensure that the PMS has enough time to process the test message, the test result message will be obtained from the PMS after a preset time based on the software signal mapping logic in the test program. In order to determine whether the software signal in the PMS is abnormal, the size relationship between the first variable value in the test message and the second variable value in the test result message will be automatically compared. Compared with the HIL test scheme, this scheme can automatically send test messages and receive test result messages, thereby significantly improving the efficiency of PMS signal testing.
[0064] Figure 1 This is a schematic diagram of an application scenario of a PMS signal testing method provided in this application. Figure 1 As shown, the application scenario of the solution provided by the present application is configured with a server 101, a signal transceiver hardware 102 and a PMS 103. Among them, the server 101 is configured with a test program 1011. The signal transceiver hardware 102 is used to connect the server 101 and the PMS 103. Specifically, the signal transceiver hardware 102 links the server 101 to several CAN channels of the PMS 103 and links the XCP calibration channel.
[0065] PMS103 is a key component in the vehicle responsible for managing and controlling the power system, and it includes multiple sets of signals.
[0066] Specifically, after the test program 1011 in the server 101 is successfully started, a test message is first sent to the PMS 103 through the signal transceiver hardware 102. Then, after a preset time, the test result message is obtained from the PMS 103 according to the software signal mapping logic in the test program 1011. Finally, the test program 1011 compares the magnitude relationship between the first variable value in the test message and the second variable value in the test result message, thereby determining whether there is an abnormality in the software signal in the PMS 103.
[0067] although Figure 1 Only one server 101 and PMS 102 are shown in FIG. 1 , but it should be understood that two or more server 101 and PMS 102 may exist.
[0068] It is worth noting that in the application scenario of the present application, taking the detection of whether there is an abnormality in the signal in the PMS as an example, the signal detection of other controllers of the vehicle is also applicable to the signal testing method proposed in the present application, which will not be repeated here.
[0069] The technical solutions shown in the present application are described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0070] Figure 2 This is a flow chart of a signal testing method for a PMS provided in this application. Figure 2 As shown, the process of the signal testing method of the PMS may include:
[0071] S201: In response to a user operation, a predefined test program is run to send a test message to a PMS of a vehicle, where the test message includes a first variable value set for a target variable.
[0072] In this step, based on the signal test requirements of the PMS, the predefined test program responds to the user's operation and sends a test message to the vehicle's PMS.
[0073] Specifically, the predefined test program is used to test and determine whether the PMS signal of the vehicle is abnormal, and is usually deployed in software with compilation and running functions. The predefined test program can be written in a variety of programming languages, including but not limited to C, C++, Python, MATLAB, and Java.
[0074] After the test program is successfully started, the software running the test program will generate and send a test message to the vehicle's PMS. The test message includes but is not limited to control instructions, the first variable value set for the target variable, a status query command, a timestamp, a data check code, etc. It is worth noting that the content included in the test message is determined according to the specific test content.
[0075] Specifically, the control instructions are used to control different functional modules of the PMS, which may include operations such as start, stop, and reset.
[0076] The first variable value set for the target variable is a specific variable value for testing, used to simulate different operating conditions.
[0077] The status query command is used to request the PMS to return the current status information for status monitoring and anomaly detection.
[0078] The timestamp is used to record the time when the test message is sent to facilitate timing analysis.
[0079] The data check code is used to ensure that the test message has not been tampered with during transmission, thereby ensuring the integrity and reliability of the test data.
[0080] It is worth noting that due to the wide variety of signals in the PMS, the predefined test program needs to continuously send test messages to the vehicle's PMS to ensure that all signal test requirements are fully covered. To achieve this goal, the test message sending time is determined according to a predefined time period, that is, the test program will continuously generate and send test messages to the PMS at set time intervals. Each test message contains different control instructions and target variable values to simulate various operating conditions and environments, so as to comprehensively determine whether there are signal anomalies in the PMS.
[0081] It is worth noting that when testing the same signal, the first variable value set for the target variable in the test message is usually 0 and 1.
[0082] S202: After a preset time, based on the software signal mapping logic in the test program, a test result message is obtained from the PMS, where the test result message includes a second variable value of the target variable configured by the PMS according to the test message.
[0083] In this step, according to step S201, when the software running the test program detects that the time for sending the test message reaches a preset time length, the test result message is obtained from the PMS according to the software signal mapping logic in the test program.
[0084] The preset duration is a predefined time interval used to ensure that the PMS has enough time to process the test message and perform corresponding configuration and operations. The preset duration can be adjusted according to different test requirements and may range from a few seconds to a few minutes. It needs to be set according to the actual test requirements and is not limited here.
[0085] It is worth noting that the predefined time period mentioned in step S201 needs to be greater than the preset duration to ensure that the test result message can be correctly received. Specifically, the predefined time period refers to the time interval at which the test program continuously sends test messages to the vehicle's PMS at a set time interval, and the preset duration refers to the time the test program waits for the PMS to process and return the test result message after sending the test message. In order to ensure that the test result message can be correctly received, the predefined time period must be greater than the preset duration, thereby ensuring that within each test cycle, the PMS has enough time to process the test message and generate a test result message, so that the software running the test program can accurately obtain and analyze the response of the PMS.
[0086] Software signal mapping logic is a mechanism for associating and mapping PMS signals with variables in the test program, which ensures that the test program can accurately obtain and interpret the test results returned by the PMS.
[0087] The test result message includes but is not limited to the second variable value of the target variable configured by the PMS according to the test message, state information, timestamp, data check code, etc. It is worth noting that the content included in the test message is determined according to the specific test content.
[0088] Specifically, the second variable value is a new value of the target variable generated by the PMS after receiving the test message and performing corresponding configuration and operation. This value can be used to determine the response and performance of the PMS under specific test conditions.
[0089] The status information includes the current operating status of the PMS, error codes, and warning information.
[0090] The timestamp records the time when the test result message is generated to facilitate timing analysis.
[0091] The data checksum is used to ensure that the test result message has not been tampered with during transmission, thus ensuring the integrity and reliability of the data.
[0092] S203: Determine whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0093] In this step, according to step S201 and step S202, the software running the test program determines whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0094] Specifically, the first variable value is the target variable value set in the test message, and the second variable value is a new value of the target variable generated by the PMS after receiving the test message and performing corresponding configuration and operation.
[0095] The first variable value represents the state or output that the test program expects the PMS to achieve, while the second variable value is the result of the actual response of the PMS. By comparing the two variable values, it can be determined whether the PMS signal meets expectations. If the first variable value and the second variable value are within the preset conditions, it can be determined that the PMS signal is normal, otherwise it is considered that the PMS signal is abnormal.
[0096] Compared with the HIL test solution, the signal test method of the PMS provided in the embodiment of the present application is that the test program in the method can automatically send a test message to the PMS and receive a test result message, which reduces the dependence on hardware equipment and reduces the test cost, thereby realizing the automation and efficiency of the signal test process. At the same time, by comparing the first variable value in the test message and the second variable value in the test result message, the test program can automatically determine whether there is an abnormality in the signal in the PMS. The entire process does not require manual intervention, thereby improving the efficiency and accuracy of signal testing.
[0097] In order to accurately determine whether there is an abnormality in the signal in the PMS, it is necessary to perform a sending test and a receiving test on the same signal to determine whether the execution of the signal during the sending and receiving process is normal. Figure 3 This is an explanation of the sending test for the same signal. Figure 4 The following describes a reception test for the same signal.
[0098] Figure 3 This is a flow chart of a second embodiment of a signal testing method for a PMS provided in this application. Figure 3 As shown, the process of the signal testing method of the PMS may include:
[0099] S301: In response to a user operation, a predefined test program is run, and a test message is sent to the PMS through the XCP, where the test message includes a first variable value set for a target variable.
[0100] In this step, when the signal transmission test is performed on the PMS, the predefined test program will respond to the user's operation and send a test message to the application layer software of the PMS through XCP.
[0101] Specifically, XCP is a standard measurement and calibration protocol widely used in automotive electronic systems, which can efficiently transmit data and commands. In this process, the test program generates test messages containing specific instructions and data, including the first variable value set for the target variable. The test message is transmitted to the application layer software of the PMS through XCP, and the application layer software is responsible for receiving and processing these messages.
[0102] The application layer software is the part of the PMS that is responsible for processing high-level protocols and user interactions. During this test process, the predefined test program sends a test message to the application layer software of the PMS through XCP. After receiving the test message, the application layer software will perform corresponding configurations and operations based on the instructions and data in the message. For example, the application layer software will set the first variable value in the test message to the target variable in preparation for testing.
[0103] S302: After a preset time, based on the software signal mapping logic in the test program, a test result message is obtained from the underlying software of the PMS through a CAN message, and the test result message includes a second variable value of the target variable after the PMS is configured according to the test message.
[0104] In this step, according to step S301, when the software running the test program detects that the time for sending the test message has reached the preset duration, the test program will obtain the test result message from the underlying software of the PMS through the CAN message according to its internal software signal mapping logic.
[0105] Specifically, the test program monitors the time of sending the test message. When the preset waiting time is reached, the test program uses the signal mapping logic to accurately identify and obtain the specific signal in the PMS. Subsequently, the test program obtains the test result message containing the second variable value of the target variable from the underlying software of the PMS through the CAN message.
[0106] Among them, CAN is a standard protocol for internal communication in vehicles, which can efficiently transmit data and commands. The bottom-level software is responsible for handling details related to hardware and communication protocols, including data transmission and signal processing. During the test, the bottom layer obtains the test result message generated by the bottom-level software of the PMS through the CAN protocol. The reason why the bottom layer obtains the test result message is that the bottom layer directly interacts with the hardware and sensors and can obtain the actual status and response data of the PMS. These data include the second variable value of the target variable after the PMS is configured according to the test message.
[0107] S303: Determine whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0108] In this step, according to step S301 and step S302, the software running the test program determines whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0109] Specifically, by comparing the first variable value and the second variable value, the software running the test program can determine whether there is an abnormality in the signal transmission process from the application layer software to the bottom layer software in the PMS. The first variable value is the target value pre-set in the test message, and the second variable value is the value actually configured and fed back by the PMS after receiving the test message. By comparing the two variable values, the test program can determine whether the signal has accurately achieved the expected effect during the transmission and processing process.
[0110] If the first variable value and the second variable value are consistent, it means that there is no abnormality in the transmission and processing of the signal from the application layer software to the bottom layer software, and the PMS can correctly respond to the instructions of the test message. However, if there is a significant difference between the two variable values, it may indicate that there is a problem in the signal transmission, processing or hardware interaction process. Specific abnormal conditions may include signal loss, delay, data error or hardware failure.
[0111] The signal testing method of the PMS provided in the embodiment of the present application is mainly described for the sending test process of the same signal. Specifically, a test message containing a preset target variable value is sent to the PMS through XCP, and the actual feedback target variable value is obtained from the underlying software of the PMS through a CAN message after a preset time. By comparing the preset value and the feedback value, the test program can determine whether there is an abnormality in the signal sending and processing process, thereby improving the accuracy and efficiency of the test.
[0112] Figure 4 This is a flow chart of a third embodiment of a signal testing method for PMS provided in this application. Figure 4 As shown, the process of the signal testing method of the PMS may include:
[0113] S401: In response to a user operation, a predefined test program is run, and a test message is sent to the PMS via the CAN protocol, where the test message includes a first variable value set for a target variable.
[0114] In this step, when the signal reception test is performed on the PMS, the predefined test program will respond to the user's operation and send a test message to the underlying software of the PMS through the CAN protocol.
[0115] Specifically, in the test program, the CAN communication interface is first initialized, and the communication rate and related parameters are set to ensure that the CAN bus can work normally. Then, according to the predefined test requirements, a test message containing the first variable value is constructed. The test message usually includes a message ID, a data length, and a data field, where the data field contains the first variable value of the target variable. Finally, the constructed test message is sent to the underlying software of the PMS using the CAN communication interface. The sending process includes writing the message to the send buffer of the CAN controller and triggering the sending operation. During the sending process, the status of the CAN controller is checked in real time to confirm whether the test message is successfully sent. If the sending fails, it may be necessary to resend or record the error information.
[0116] S402: After a preset time, based on the software signal mapping logic in the test program, a test result message is obtained from the application layer software of the PMS through an XCP message, and the test result message includes a second variable value of the target variable after the PMS is configured according to the test message.
[0117] In this step, according to step S401, when the software running the test program detects that the time for sending the test message has reached a preset duration, the test program will obtain the test result message from the application layer software of the PMS through the XCP message according to its internal software signal mapping logic.
[0118] Specifically, in the test program, the XCP communication interface is first initialized, and the communication parameters and related configurations are set to ensure that the XCP communication can work normally. Then, according to the test requirements, an XCP request message is constructed. The message is used to request the application layer software of the PMS to return the test results, and the message includes a request ID and related parameters. Then the constructed request message is sent to the application layer software of the PMS using the XCP communication interface. The sending process includes writing the message to the send buffer of the XCP controller and triggering the sending operation. The test program waits for the application layer software of the PMS to return the test result message, and uses the XCP communication interface to receive the response message. Finally, the test program parses the received XCP response message and extracts the second variable value of the target variable from it, which reflects the actual feedback of the PMS after the configuration according to the test message.
[0119] S403: Determine whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0120] In this step, according to step S401 and step S402, the software running the test program determines whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0121] Specifically, by comparing the first variable value and the second variable value, the software running the test program can determine whether there is an abnormality in the signal sending process from the bottom layer software to the application layer software in the PMS.
[0122] If the first variable value and the second variable value are consistent, it means that there is no abnormality in the transmission and processing of the signal from the bottom layer software to the application layer software, and the PMS can correctly respond to the instructions of the test message. However, if there is a significant difference between the two variable values, it means that there is an abnormality in the transmission and processing of the signal from the bottom layer software to the application layer software.
[0123] The signal testing method of the PMS provided in the embodiment of the present application is mainly described for the reception test process of the same signal. Specifically, a test message containing a preset target variable value is sent to the PMS through the CAN protocol, and the actual feedback target variable value is obtained from the application layer software of the PMS through the XCP message after a preset time. By comparing the preset value and the feedback value, the test program can determine whether there is an abnormality in the signal sending and processing process, thereby improving the accuracy and efficiency of the test.
[0124] Figure 5 This is a flow chart of a fourth embodiment of a signal testing method for a PMS provided in this application. Figure 5 As shown, based on the above embodiment, whether the software signal in the PMS is abnormal is determined based on the first variable value and the second variable value. The process of the signal testing method of the PMS may include:
[0125] S501: If the first variable value is consistent with the second variable value, it is determined that there is no abnormality in the software signal in the PMS.
[0126] In this step, after the test result message is obtained from the PMS, it is determined whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0127] Specifically, if the first variable value is consistent with the second variable value, it is determined that there is no abnormality in the software signal in the PMS.
[0128] When the software signal in the PMS is sent and tested, if the first variable value is consistent with the second variable value, it means that there is no abnormality in the signal sending process from the application layer software to the bottom layer software in the PMS.
[0129] When the software signal in the PMS is received and tested, if the value of the first variable is consistent with the value of the second variable, it means that there is no abnormality in the signal sending process from the bottom layer software to the application layer software in the PMS.
[0130] It is worth noting that when testing a signal in PMS, the first variable value is usually set to 0 and 1. Therefore, when the first variable value is set to 1, it is necessary to determine whether the second variable value is 1, and when the first variable value is set to 0, it is necessary to determine whether the second variable value is 0. Only when the results of these two judgments are consistent can it be determined that there is no abnormality in the corresponding software signal in PMS.
[0131] S502: If the first variable value is inconsistent with the second variable value, it is determined that the software signal in the PMS is abnormal.
[0132] In this step, after the test result message is obtained from the PMS, it is determined whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0133] Specifically, if the first variable value is inconsistent with the second variable value, it is determined that the software signal in the PMS is abnormal.
[0134] When the software signal in the PMS is sent and tested, if the first variable value is inconsistent with the second variable value, it means that the signal sending process from the application layer software to the bottom layer software in the PMS is abnormal.
[0135] When the software signal in the PMS is received and tested, if the first variable value is inconsistent with the second variable value, it means that the signal sending process from the bottom layer software to the application layer software in the PMS is abnormal.
[0136] It is worth noting that when testing a signal in the PMS, the first variable value is usually set to 0 and 1. Therefore, when the first variable value is set to 1, it is necessary to determine whether the second variable value is 1, and when the first variable value is set to 0, it is necessary to determine whether the second variable value is 0. If there is an inconsistency between the two judgment results, it can be determined that the corresponding software signal in the PMS is abnormal.
[0137] The signal testing method of the PMS provided in the embodiment of the present application mainly determines whether there is an abnormality in the software signal in the PMS based on the first variable value and the second variable value. Specifically, when the first variable value and the second variable value are consistent, it can be determined that there is no abnormality in the software signal in the PMS, and when the first variable value and the second variable value are inconsistent, it can be determined that there is an abnormality in the software signal in the PMS. Through this method, it is possible to quickly and accurately detect whether there is an abnormality in the software signal in the PMS, thereby improving the reliability and stability of the PMS.
[0138] Figure 6 This is a flow chart of a fifth embodiment of a signal testing method for PMS provided in this application. Figure 6 As shown, based on the above embodiment, in response to the user's operation, the predefined test program is run, and before the test message is sent to the PMS of the vehicle, the process of the signal test method of the PMS also includes:
[0139] S601: Generate a test program based on a pre-written software program and a predefined software signal interface information table, wherein the software signal interface information table is used to define the interface information of the application layer software and the underlying software of the PMS, and the test program includes a system variable definition unit, a signal mapping unit, a system variable assignment unit, a system variable value acquisition unit, and a result comparison and output unit.
[0140] In this step, before the predefined test program responds to the user's operation and sends a test message to the PMS of the vehicle, it is necessary to generate a test program based on the pre-written software program and the predefined software signal interface information table.
[0141] In a specific implementation, MATLAB first obtains a pre-written software program and a pre-defined software signal interface information table. Then, the software signal interface information table is parsed to extract necessary interface information. Next, a system variable definition unit, a signal mapping unit, a system variable assignment unit, a system variable value acquisition unit, and a result comparison and output unit are generated. Finally, these units are integrated into a complete test program, copied into the test program, and verified and optimized.
[0142] Figure 7 A schematic diagram of the construction process of a test program provided in this application. Figure 7 As shown, the test program 700 includes a software signal interface information table 701, a system variable definition unit 702, a signal mapping unit 703, a system variable assignment unit 704, a system variable value acquisition unit 705 and a result comparison and output unit 706.
[0143] The software signal interface information table 701 is used to define the interface information of the application layer software and the underlying software of the PMS, and is generally stored in the form of an Excel table. Such interface information includes but is not limited to the name, type, range, unit, etc. of the signal. These information tables provide necessary references for the test program so that the test program can correctly interact with the PMS.
[0144] The system variable definition unit 702 defines the global variables and local variables of the signals to be tested according to the software signal interface information table. These variables represent various signals in the PMS and will be used to store and transfer signal values during the test process.
[0145] The signal mapping unit 703 is used to map the address and direction of the system variables and the CAN message, so as to obtain the software signal mapping logic in the test program. Through this mapping, the test program can accurately interact with the signals in the PMS.
[0146] The system variable assignment unit 704 is a unit for assigning a value to the first variable in a test, including a unit for assigning a value of 0 and a unit for assigning a value of 1.
[0147] The system variable value acquisition unit 705 is used to acquire a second variable value from the PMS, and the value will be used for subsequent result comparison and verification.
[0148] The result comparison and output unit 706 is used to compare the first variable value with the second variable value. If the first variable value and the second variable value are consistent, the test passes; otherwise, the test fails. The test result will be output for further analysis and processing.
[0149] The signal testing method of the PMS provided in the embodiment of the present application mainly describes the generation process of the test program. Specifically, the test program is generated according to the pre-written software program and the pre-defined software signal interface information table. Through this method, the generation efficiency and accuracy of the test program can be improved, the possibility of errors caused by manual methods can be reduced, and the standardization and consistency of the test process can be ensured.
[0150] In a possible implementation, based on any one of the above embodiments, after determining whether the software signal in the PMS is abnormal based on the first variable value and the second variable value, the test result of the software signal in the PMS is recorded in the software signal interface information table.
[0151] Specifically, after determining whether the software signal in the PMS is abnormal based on the first variable value and the second variable value, the test result needs to be recorded in the software signal interface information table.
[0152] Specifically, the software signal is judged whether it is normal by comparing the first variable value and the second variable value. If an abnormality is detected, the signal is marked as abnormal, and relevant detailed information is recorded, such as the abnormality type, occurrence time, first variable value and second variable value. If no abnormality is detected, the signal is marked as not abnormal, and relevant detailed information is recorded. Finally, these test results and related information are updated to the software signal interface information table for subsequent analysis and processing.
[0153] The signal testing method of the PMS provided in this embodiment details a method for recording software signal test results. Specifically, the test results are recorded in the software signal interface information table. This recording method not only helps to track and manage the status of software signals, but also provides valuable data support for further optimization and troubleshooting of the PMS. Through this method, it can be ensured that the software signals in the PMS are effectively monitored and managed, thereby improving the efficiency of software signal testing.
[0154] In a possible implementation manner, based on any one of the above embodiments, the test program is written in C language, and the platform for running the predefined test program is the Tsmaster software platform.
[0155] Specifically, in order to ensure the efficiency and portability of the test program, the test program is generated by MATLAB based on the software signal interface information table, the programming language used is C language, and the test program is run through the Tsmaster software platform.
[0156] Among them, the Tsmaster software platform provides powerful test management and execution functions. By running the test program on the Tsmaster platform, you can make full use of its rich test tools and resources to conduct comprehensive signal testing and analysis. In addition, the user-friendly interface and automation functions of the Tsmaster platform further simplify the test process and improve the accuracy and efficiency of the test.
[0157] It is worth noting that the programming language used in the test program can also be other types of programming languages, such as Python, C++, etc. These languages have different advantages, and the most suitable programming language can be selected to write the test program according to specific needs. The platform for running predefined test programs can also be other software platforms with test management and execution functions. These platforms provide a variety of tools and resources to meet different test environments and needs, thereby further improving the flexibility and efficiency of testing.
[0158] The signal testing method of PMS provided in this embodiment mainly describes the programming language and operating platform of the test program. Specifically, the test program is written in C language and runs on the Tsmaster platform, which not only improves the performance of the test program, but also optimizes the entire test process.
[0159] Figure 8 This is a schematic diagram of a signal transmission test process framework for a PMS provided in this application. Figure 8 As shown, the signal transmission test process framework of the PMS includes Tsmaster 801 and PMS 802. Among them, Tsmaster 801 includes system variable Tx1 8011, XCP protocol message 8012, system variable Tx2 8013, signal mapping 8014, message variable 8015 and CAN message 8016.
[0160] Before testing the signal transmission of PMS, run the C applet on Tsmaster801 to set the system variable Tx18011, signal mapping 8014 and system variable Tx28013. Among them, the system variable Tx18011 is used to change the initial value of the system variable and detect the reception of PMS802. Signal mapping 8014 is used to map the message variable 8015 to the system variable Tx28013. The system variable Tx28013 is used to obtain the internal variable value of PMS802 and then compare it with the system variable Tx18011.
[0161] It is worth noting that the C applet is generated by MATLAB based on the software signal interface information table, corresponding to the test program.
[0162] During the PMS signal transmission test, the test program sets the system variable Tx18011 to 1, waits for 2 seconds, checks whether the system variable Tx28013 is equal to 1, and records the result in the software signal interface information table.
[0163] After the preset time period, the test program sets the system variable Tx18011 to 0, waits for 2 seconds, checks whether the system variable Tx28013 is equal to 0, and records the result in the software signal interface information table.
[0164] If both of the above two recording results show success, it is determined that the corresponding software signal interface test has passed. If any of the recording results shows failure, it is determined that the corresponding software signal interface test has not passed.
[0165] Fig. 9 A schematic diagram of a signal reception test process framework for a PMS provided in this application. Fig. 9 As shown, the signal receiving test process framework of the PMS includes Tsmaster 901 and PMS 902. Among them, Tsmaster 901 includes system variable Rx1 9011, signal mapping 9012, message variable 9013, CAN message 9014, XCP protocol message 9015, and system variable Rx2 9016.
[0166] Before the signal transmission test of PMS, the C applet running in Tsmaster901 sets the system variable Rx19011, signal mapping 9012 and system variable Rx29016. Among them, the system variable Rx19011 is used to change the initial value of the system variable and detect the reception of PMS902. Signal mapping 9012 is used to map the system variable Rx29016 to the message variable 9013. The system variable Rx29016 is used to obtain the internal variable value of PMS902, and then compare it with the system variable Rx19011.
[0167] It is worth noting that the C applet is generated by MATLAB based on the software signal interface information table, corresponding to the test program.
[0168] During the PMS signal transmission test, the test program sets the system variable Rx19011 to 1, waits for 2 seconds, checks whether the system variable Rx29016 is equal to 1, and records the result in the software signal interface information table.
[0169] After the preset time period, the test program sets the system variable Rx19011 to 0, waits for 2 seconds, checks whether the system variable Rx29016 is equal to 0, and records the result in the software signal interface information table.
[0170] If both of the above two recording results show success, it is determined that the corresponding software signal interface test has passed. If any of the recording results shows failure, it is determined that the corresponding software signal interface test has not passed.
[0171] Fig.10 This is a schematic diagram of the structure of a signal testing device for a PMS according to an embodiment of the present invention. Fig.10 As shown, the signal testing device 1000 of the PMS includes:
[0172] The sending module 1001 is used to run a predefined test program in response to a user operation and send a test message to the PMS of the vehicle, wherein the test message includes a first variable value set for the target variable;
[0173] The acquisition module 1002 is used to acquire a test result message from the PMS after a preset time period based on the software signal mapping logic in the test program, wherein the test result message includes a second variable value of the target variable configured by the PMS according to the test message;
[0174] The processing module 1003 is used to determine whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
[0175] Optionally, the sending module 1001 is further used to: send a test message to the PMS through XCP.
[0176] Optionally, the acquisition module 1002 is further used to: based on the software signal mapping logic in the test program, obtain the test result message from the underlying software of the PMS via the CAN message.
[0177] Optionally, the sending module 1001 is further used to: send a test message to the PMS via the CAN protocol.
[0178] Optionally, the acquisition module 1002 is further used to: based on the software signal mapping logic in the test program, acquire the test result message from the application layer software of the PMS through the XCP message.
[0179] Optionally, the processing module 1003 is further used for:
[0180] If the value of the first variable is consistent with the value of the second variable, it is determined that there is no abnormality in the software signal in the PMS;
[0181] If the first variable value is inconsistent with the second variable value, it is determined that the software signal in the PMS is abnormal.
[0182] Optionally, the processing module 1003 is also used to generate a test program based on a pre-written software program and a predefined software signal interface information table, wherein the software signal interface information table is used to define the interface information of the application layer software and the underlying software of the PMS, and the test program includes a system variable definition unit, a signal mapping unit, a system variable assignment unit, a system variable value acquisition unit, and a result comparison and output unit.
[0183] Optionally, the test program is written in C language.
[0184] Optionally, the processing module 1003 is further used to: run the test program through the Tsmaster software platform.
[0185] The PMS signal testing device provided in this embodiment can be used to execute the PMS signal testing method in any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be described in detail here.
[0186] Fig.11 A schematic diagram of the structure of a computer device provided for the application. Fig.11 As shown, the computer device 1100 for PMS signal testing may specifically include a transceiver 1101, a processor 1102, and a memory 1103. The transceiver 1101 is used to implement signal transmission with the PMS, the memory 1103 stores computer execution instructions; the processor 1102 executes the computer execution instructions stored in the memory 1103 to implement the PMS signal testing method in the above embodiment.
[0187] This embodiment provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the signal testing method of the PMS in the above embodiment.
[0188] This embodiment further provides a computer program product, including a computer program, which implements the signal testing method of the PMS provided in any one of the above embodiments when the computer program is executed by a processor.
[0189] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0190] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A signal testing method for PMS, characterized in that: The method comprises: In response to the user's operation, a predefined test program is run to send a test message to a power domain controller PMS of the vehicle, wherein the test message includes a first variable value set for the target variable; After a preset time, based on the software signal mapping logic in the test program, a test result message is obtained from the PMS, wherein the test result message includes a second variable value of the target variable configured by the PMS according to the test message; Based on the first variable value and the second variable value, it is determined whether the software signal in the PMS is abnormal.
2. The method according to claim 1, characterized in that The sending of a test message to the power domain controller PMS of the vehicle includes: Sending the test message to the PMS via the universal measurement and calibration protocol XCP; Accordingly, obtaining the test result message from the PMS based on the software signal mapping logic in the test program includes: Based on the software signal mapping logic in the test program, the test result message is obtained from the underlying software of the PMS via a controller area network (CAN) message.
3. The method according to claim 1 or 2, characterized in that: The sending of a test message to the power domain controller PMS of the vehicle also includes: Sending the test message to the PMS via the controller area network (CAN) protocol; Accordingly, obtaining the test result message from the PMS based on the software signal mapping logic in the test program includes: Based on the software signal mapping logic in the test program, the test result message is obtained from the application layer software of the PMS through the universal measurement and calibration protocol XCP message.
4. The method according to claim 1, characterized in that The determining whether the software signal in the PMS is abnormal based on the first variable value and the second variable value includes: If the first variable value is consistent with the second variable value, it is determined that there is no abnormality in the software signal in the PMS; If the first variable value is inconsistent with the second variable value, it is determined that the software signal in the PMS is abnormal.
5. The method according to claim 4, characterized in that Before the predefined test program is run in response to the user's operation and the test message is sent to the power domain controller PMS of the vehicle, the method further includes: The test program is generated based on a pre-written software program and a predefined software signal interface information table, wherein the software signal interface information table is used to define the interface information of the application layer software and the underlying software of the PMS, and the test program includes a system variable definition unit, a signal mapping unit, a system variable assignment unit, a system variable value acquisition unit, and a result comparison and output unit.
6. The method according to claim 5, characterized in that The method further comprises: The test results of the software signal in the PMS are recorded in the software signal interface information table.
7. The method according to any one of claims 1, 2, 4-6, characterized in that: The test program is written in C language; Accordingly, the running of the predefined test program includes: The test program is run through the Tsmaster software platform.
8. A signal testing device for PMS, characterized in that: include: A sending module, configured to run a predefined test program in response to a user's operation, and send a test message to a power domain controller PMS of the vehicle, wherein the test message includes a first variable value set for a target variable; an acquisition module, configured to acquire a test result message from the PMS after a preset time period based on the software signal mapping logic in the test program, wherein the test result message includes a second variable value of the target variable configured by the PMS according to the test message; A processing module is used to determine whether the software signal in the PMS is abnormal based on the first variable value and the second variable value.
9. A computer device, characterized in that: include: A transceiver, a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the signal testing method for the PMS according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the signal testing method for the PMS according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the signal testing method for a PMS according to any one of claims 1 to 7 is implemented.
