State machine jump test method, system, device, equipment and medium
The time stamp of the state machine is accurately measured by crystal oscillator tapping method, which solves the problem of poor reliability of state machine jump test in the prior art, improves the test accuracy and ECU quality, and reduces costs.
Patent Information
- Application Number
- CN202411094456.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-09
AI Technical Summary
In the existing state machine jump test method, the state maintenance time of the state machine is determined by calculating the transmission time difference between network management messages and application messages, resulting in poor reliability of the test results and affecting the quality of the ECU.
The crystal oscillator tapping method is used to accurately measure the start and end timestamps of the state machine, determine the state maintenance time, and send the target information to the test host computer through the information transceiver unit to improve the test accuracy.
By measuring the state entry and exit moments of the state machine with high accuracy, the reliability of the state machine jump test is significantly improved, the ECU quality is ensured, and the implementation cost is reduced.
Smart Images

Figure CN119126739A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automotive technology, and in particular to a state machine jump test method, system, device, equipment and medium. Background Art
[0002] With the increasing number of electronic control units (ECUs) installed in vehicles, network management has emerged to reduce vehicle power consumption. Network management primarily controls the state transitions within the ECU's state machine, enabling ECU sleep and wakeup. During state machine transition testing, the host computer needs to obtain the state duration of the ECU's state machine and determine whether it meets the required state to generate the test results.
[0003] In related technologies, the state maintenance time of the state machine is mainly determined by testing the upper computer to calculate the transmission time difference between the network management message and the application message. There is a large deviation between the state maintenance time determined in this way and the actual state maintenance time, resulting in poor reliability of the current state machine jump test, which in turn affects the quality of the ECU. Summary of the Invention
[0004] In view of the above problems, embodiments of the present application provide a state machine jump test method, system, apparatus, device and medium to overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect of an embodiment of the present application, a state machine jump test method is provided, the method comprising:
[0006] Using a crystal oscillator marking method, determining the start timestamp of the state machine of the electronic control unit ECU jumping to different states and the end timestamp of jumping out of the different states;
[0007] Determining target information associated with each of the different states according to each of the start timestamps and each of the end timestamps, wherein the target information is used to represent the duration of the state;
[0008] Send each of the target information to the test host computer.
[0009] Optionally, sending each of the target information to a test host computer includes:
[0010] In response to detecting that the state machine successfully jumps from the previous state to the current state, the target information associated with the previous state is sent to the test host computer.
[0011] Optionally, the method further includes:
[0012] Adding the target information as message content to a target message, wherein the target message is an event-type message in which the state of the state machine successfully jumps to a sending trigger event;
[0013] Sending each of the target information to the test host computer includes:
[0014] Send each target message containing each target information to the test host computer.
[0015] Optionally, sending each of the target information to a test host computer includes:
[0016] When receiving target indication information from the test host computer, determining the target state maintenance time for the state machine from jumping to the first state to jumping to the second state according to each target information;
[0017] Sending the target state maintenance time to the test host computer;
[0018] The different states associated with each of the target information include at least any one of the following:
[0019] the first state and the second state;
[0020] The first state, and the intermediate state to which the state machine needs to jump when finally jumping from the first state to the second state.
[0021] Optionally, the method further includes:
[0022] The microcontroller unit MCU in the ECU stores each of the start timestamps and each of the end timestamps in a log record manner;
[0023] Determining target information associated with each of the different states according to each of the start timestamps and each of the end timestamps includes:
[0024] From the MCU log, obtain the start timestamp and end timestamp associated with each state;
[0025] The target information associated with the single state is determined according to the start timestamp and the end timestamp associated with the single state.
[0026] Optionally, the target information includes at least one of the following:
[0027] The starting timestamp;
[0028] the termination timestamp;
[0029] The difference between the end timestamp and the start timestamp.
[0030] A second aspect of an embodiment of the present application provides a state machine jump test system, the system including an electronic control unit ECU, an information transceiver unit, and a test host computer, wherein:
[0031] The information transceiver unit is used to convert the communication protocol to support information transmission between the ECU and the test host computer;
[0032] The test host computer is used to send control information to the test host computer through the information transceiver unit to control the state machine in the ECU to start jumping between different states;
[0033] The ECU is used to determine the start timestamp of the ECU state machine jumping to different states and the end timestamp of jumping out of the different states by using a crystal oscillator marking method;
[0034] The ECU is further configured to determine target information associated with each of the different states based on each of the start timestamps and each of the end timestamps, wherein the target information is used to describe the state maintenance time;
[0035] The ECU is further configured to send each target information to a test host computer via the information transceiver unit.
[0036] According to a third aspect of an embodiment of the present application, a state machine jump test device is provided, the device comprising:
[0037] A timing module is used to determine the start timestamp of the ECU's state machine jumping to different states and the end timestamp of jumping out of the different states by using a crystal oscillator timing method;
[0038] An information determination module, configured to determine target information associated with each of the different states according to each of the start timestamps and each of the end timestamps, wherein the target information is used to represent a state maintenance time;
[0039] The information sending module is used to send each of the target information to the test host computer.
[0040] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the state machine jump test method described in the first aspect are implemented.
[0041] In a fifth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the state machine jump test method as described in the first aspect are implemented.
[0042] The embodiments of the present application include the following advantages:
[0043] Leveraging the high-precision timing capabilities of a crystal oscillator, the state machine's state entry (i.e., start timestamp) and state exit (i.e., end timestamp) are accurately measured. Target information is then determined and communicated to the test host computer, enabling it to obtain more accurate state maintenance times. This improves the reliability of state machine transition testing and ensures ECU quality.
[0044] Using the state transition of the state machine as the timing for information transmission can ensure that the target information can be sent to the test host computer in a timely manner after it is determined, thus avoiding delays in the test progress;
[0045] By leveraging the logging function of the MCU to store the start and end timestamps, there is no need to allocate additional storage space in the ECU, which can reduce implementation costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0047] Figure 1 This is a flow chart of an implementation of a jump test method of a state machine in an embodiment of the present application;
[0048] Figure 2 is a schematic diagram of the state maintenance time obtained under different measurement methods in an embodiment of the present application;
[0049] Figure 3 This is a structural diagram of a state machine jump test system in an embodiment of the present application;
[0050] Figure 4 It is a structural diagram of a jump test device of a state machine in an embodiment of the present application;
[0051] Figure 5 It is a schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0053] With the continuous development of intelligent automotive technology, software-defined cars have become a key trend in the automotive industry. Users' expectations for a richer and more engaging automotive experience are also increasing, leading to a corresponding increase in the number of ECUs installed. To prevent unused functions while the associated ECUs remain in operation, leading to increased vehicle power consumption, network management has emerged. This technology primarily controls the state transitions within the ECU's state machine to enable ECU sleep and wakeup.
[0054] As the core of network management, state machines require transition testing to verify their functionality and thus ensure the quality of the ECUs they operate in. During transition testing, the host computer must obtain the state hold time of the ECU's state machine and determine whether it meets the required test results. Therefore, the accuracy of the state hold time significantly impacts the reliability of the state machine transition test.
[0055] In related technologies, the state maintenance time of the state machine is mainly determined by testing the upper computer to calculate the transmission time difference between the network management message and the application message. There is a large deviation between the state maintenance time determined in this way and the actual state maintenance time, resulting in poor reliability of the current state machine jump test, which in turn affects the quality of the ECU.
[0056] In response to the problems existing in the above-mentioned related technologies, the embodiments of the present application propose a state machine jump test method, system, device, equipment and medium, which uses a crystal oscillator to accurately measure the state entry time (i.e., the start timestamp) and state exit time (i.e., the end timestamp) of the state machine, and thereby determine the target information and inform the test host computer so that the test host computer can obtain a more accurate state maintenance time, thereby improving the reliability of the state machine jump test and ensuring the quality of the ECU.
[0057] The following, in conjunction with the accompanying drawings, describes in detail the state machine jump test method, system, device, equipment and medium provided by the embodiments of the present application through some embodiments and their application scenarios.
[0058] First, refer to Figure 1 FIG. 1 is a flowchart of an implementation of a state machine jump test method provided by an embodiment of the present application. The method may include the following steps:
[0059] Step S101: using a crystal oscillator marking method to determine a start timestamp when a state machine of an electronic control unit ECU jumps to a different state and an end timestamp when a state machine jumps out of the different state.
[0060] In specific implementation, the state machine jump test method can be executed by the ECU, or by other devices that are in communication with the ECU (such as an external device equipped with a crystal oscillator, or an external device that can obtain the timing information of the crystal oscillator in the ECU). This embodiment of the present application does not limit this. Taking the ECU executing the state machine jump test method as an example, after pre-setting the timing function of the crystal oscillator according to the time accuracy of the crystal oscillator in the ECU, the target chip in the ECU that is in communication with the test host computer, such as a controller area network (CAN) chip, detects whether the state machine in the ECU's microcontroller unit (MCU) enters or exits a state.
[0061] When the target chip detects that the state machine enters (i.e. jumps to) a state, the target chip triggers the crystal oscillator to start dotting, and the crystal oscillator then continuously dot-dots at its own time accuracy (i.e., a certain time interval). When the target chip detects that the state machine leaves the above state, the target chip triggers the crystal oscillator to stop dotting.
[0062] During the above process, the target chip records the moment when the crystal oscillator hits the first point as the start timestamp, and the moment when the crystal oscillator hits the last point as the end timestamp.
[0063] It should be noted that since the time accuracy of a crystal oscillator is usually in the nanosecond level, the error in recording the moment when the state machine enters and exits a state through the crystal oscillator is extremely small and has little effect on the test accuracy.
[0064] Step S102: determining target information associated with each of the different states according to each of the start timestamps and each of the end timestamps, wherein the target information is used to represent the state maintenance time.
[0065] Optionally, the target information includes at least one of the following:
[0066] The starting timestamp;
[0067] the termination timestamp;
[0068] The difference between the end timestamp and the start timestamp.
[0069] In specific implementation, the above-mentioned target chip can directly use the obtained start timestamps and end timestamps as target information. At this time, the target information is used to implicitly represent the state maintenance time, so that the test host computer can calculate the maintenance time of each state and determine the jump test result of the state machine accordingly.
[0070] Alternatively, the target chip can use the start or end timestamps of different states as target information. In this case, the target information implicitly represents the state duration. The test host computer can then use the end timestamp of the previous state as the start timestamp of the next state, or the start timestamp of the next state as the end timestamp of the previous state to calculate the duration of each state, thereby reducing the amount of information transmitted between the ECU and the test host computer.
[0071] Alternatively, the above-mentioned target chip can also perform a difference operation on each of the start timestamps and each of the end timestamps, that is, subtract the start timestamp of a state from the end timestamp of the state to obtain the maintenance time of the state, and use the maintenance time as a target information. At this time, the target information is used to explicitly represent the state maintenance time, which can reduce the computing resource usage of the test host computer.
[0072] Step S103: Send each of the target information to the test host computer.
[0073] In specific implementation, the above-mentioned target chip can send each of the target information to the test host computer together, or send it to the test host computer in multiple times (such as sending it one by one). The test host computer can then determine the maintenance time of each state based on the received target information, and determine the jump test result of the state machine by judging whether the maintenance time of each state meets the preset requirements.
[0074] It should be noted that compared with determining the state maintenance time by measuring the transmission time difference of the message on the test host computer side, the embodiment of the present application uses a crystal oscillator to measure the state jump related timestamps of the ECU side state machine, and then determines the state maintenance time, so that the measurement position is closer to the state machine, thereby better avoiding time deviation in the measurement process.
[0075] For example, referring to Figure 2 The diagram shows the state maintenance time obtained using different measurement methods. The crystal oscillator time is the state maintenance time obtained using the measurement method provided in the embodiment of the present application. The personal computer (PC) measurement time is the state maintenance time obtained by measuring the message transmission time difference on the PC side (i.e., the test host computer) in the related art. The start time is the time when the last frame of the NM message is received, and the end time is the time when the last frame of the application message is received. The PC measurement time is equal to the end time minus the start time.
[0076] Specifically, the PC side will obtain the network management messages and application messages sent by the ECU sample based on the CANoe software, and use the reception time difference between the network management messages and the application messages as the state maintenance time of the state machine. Compared with the crystal oscillator time, there are two time deviations.
[0077] On the one hand, according to the AUTOSAR (Automotive Open System Architecture) network management specification, when the ECU sends a message, it is not sent directly from the bottom layer of the CAN chip, but from the chip's buffer pool. Then, when the PC side calculates the state machine jump, the state machine will jump, but the message data in the buffer pool will not be completely sent (that is, the buffer pool has not been released). This will cause the state maintenance time obtained by the PC side to include the time of the buffer pool release (that is, Figure 2 Cache pool time in ), and this period cannot be separated on the PC side, which leads to the first time deviation.
[0078] On the other hand, when the state machine starts to jump state and the time when the network management (NM) message is sent is inconsistent, and the absolute value of the difference is less than the NM message period, an error will occur (i.e. Figure 2 This leads to the second time deviation.
[0079] It is understandable that due to the existence of the above two time deviations, when the state machine jump test is performed based on the PC measurement time, the test results cannot accurately reflect the relevant performance of ECU network management. The state machine jump test method provided in the embodiment of the present application can avoid the interference of the above two time deviations, thereby improving the test reliability, which is beneficial to improving the quality of the ECU and reducing project costs.
[0080] By adopting the technical solution of the embodiment of the present application, with the help of the high-precision timing capability of the crystal oscillator, the state entry moment (i.e., the start timestamp) and the state exit moment (i.e., the end timestamp) of the state machine are accurately measured, and the target information is determined based on this and informed to the test host computer, so that the test host computer can obtain a more accurate state maintenance time, thereby improving the reliability of the state machine jump test and ensuring the quality of the ECU.
[0081] Optionally, in one embodiment, sending each of the target information to a test host computer includes:
[0082] In response to detecting that the state machine successfully jumps from the previous state to the current state, the target information associated with the previous state is sent to the test host computer.
[0083] In specific implementation, the target chip (such as a CAN chip) in the ECU that is connected to the test host computer for communication detects whether a state jump occurs in the state machine of the MCU in the ECU. For example, the MCU can send a signal to the target chip after each successful state jump.
[0084] When the target chip detects that the state machine has a state jump, the target information associated with the previous state is sent to the test host computer. When it is detected that the state machine has successfully jumped from state A to state B (i.e., the current state), the target information associated with the determined state A (and / or one or more states before state A) is sent to the test host computer.
[0085] In this embodiment, the state transition of the state machine is used as the information sending opportunity, which can ensure that the target information can be sent to the test host computer in time after it is determined, thereby avoiding delays in the test progress.
[0086] Optionally, the method further includes:
[0087] Adding the target information as message content to a target message, wherein the target message is an event-type message in which the state of the state machine successfully jumps to a sending trigger event;
[0088] In response to detecting that the state machine successfully jumps to the current state, sending target information associated with the previous state to the test host computer, including:
[0089] In response to detecting the sending trigger event, a target message containing the target information is sent to the test host computer.
[0090] In the specific implementation, the sending trigger mechanism of event-type messages can be used, and the successful state jump of the state machine (that is, the state machine jumps) is used as the sending trigger event. Therefore, when it is detected that the state machine has successfully jumped to the current state, the target information associated with the previous state can be sent to the test host computer.
[0091] For example, the ECU can add the target information determined for one or more previous states as message content to one or more target messages. Subsequently, when the state machine does not transition, the one or more target messages are not triggered to be sent, and the ECU will not automatically send the one or more target messages. When the state machine successfully transitions to a state, the one or more target messages are triggered to be sent, and the ECU will accordingly send the one or more target messages to the test state machine.
[0092] Optionally, in one embodiment, sending each of the target information to a test host computer includes:
[0093] When receiving target indication information from the test host computer, determining the target state maintenance time for the state machine from jumping to the first state to jumping to the second state according to each target information;
[0094] Sending the target state maintenance time to the test host computer;
[0095] The different states associated with each of the target information include at least any one of the following:
[0096] the first state and the second state;
[0097] The first state, and the intermediate state to which the state machine needs to jump in the process of finally jumping from the first state to the second state; for example, in the process of the state machine finally jumping from state 1 (corresponding to the first state) to state 2 (corresponding to the second state), it is necessary to first jump from state 1 to state 3, and then jump from state 3 to state 2, then the state 3 is the intermediate state to which the state machine needs to jump in the process of finally jumping from state 1 to state 2.
[0098] During specific implementation, considering that only the maintenance time of one or several states may be required when executing certain jump tests, in this case, the test switch can indicate to the ECU through the target indication information the maintenance time from entering which state (i.e., the first state) to jumping out of which state (i.e., the previous state of the second state) the current test needs to use based on the jump order between the states (usually fixed), so that the ECU can determine and send the state maintenance time of the above-mentioned specific state, thereby the test host computer can quickly obtain the specific state maintenance time to meet the current test requirements.
[0099] After receiving the target indication information, the ECU will obtain the target information of the relevant state, such as obtaining the maintenance time associated with each state in the previous state from the first state to the second state (that is, the target information associated with the first state and the intermediate state), or obtaining the start timestamp of the first state and the start timestamp of the second state (that is, the target information associated with the first state and the second state), etc.; and then determine the target maintenance time through the obtained target information, such as using the start timestamp of the second state minus the start timestamp of the first state to obtain the target maintenance time.
[0100] It should be noted that the ECU can process the above-mentioned target message and the above-mentioned target indication information compatibly, that is, when the target message is not triggered to be sent, the test host computer can quickly obtain the specific state maintenance time through the target indication information.
[0101] Optionally, the target indication information is a specific flag bit in a network management message.
[0102] Optionally, in one embodiment, the method further includes:
[0103] The microcontroller unit MCU in the ECU stores each of the start timestamps and each of the end timestamps in a log record manner;
[0104] Determining target information associated with each of the different states according to each of the start timestamps and each of the end timestamps includes:
[0105] From the MCU log, obtain the start timestamp and end timestamp associated with each state;
[0106] The target information associated with the single state is determined according to the start timestamp and the end timestamp associated with the single state.
[0107] In this embodiment, after obtaining the start timestamp or the end timestamp, the above-mentioned target chip can store it in the form of log records through the MCU. When the target information is subsequently determined, the relevant timestamp can be quickly obtained by querying the log, thereby using the logging function of the MCU to realize the storage of the start timestamp and the end timestamp, without the need to open up additional storage space in the ECU, which can reduce the implementation cost.
[0108] Reference Figure 3 The schematic diagram of the structure of the state machine jump test system shown in FIG. 1 illustrates the implementation process of the state machine jump test method by taking the ECU in the state machine jump test system executing the state machine jump test method as an example. The implementation process includes the following steps:
[0109] (1) Select an ECU with network management function, which includes an MCU, a CAN chip and a crystal oscillator. Connect the ECU, an information transceiver unit (such as VN1640) and a test host computer to build a jump test system for the state machine.
[0110] (2) Set the dotting timing function according to the time accuracy of the crystal oscillator in the ECU so that the start and end timestamps of each state can be recorded in the subsequent crystal oscillator dotting method.
[0111] (2) The sample device (i.e., ECU) is in a normal power-on state, and the state machine therein is in a normal operation state (Normal Operation State, NOS) for 5 seconds.
[0112] (3) Disconnect the wake-up line of the sample (i.e., disconnect the KL15 power), wait for the sample to sleep, so that the state machine is in Prepare Bus-Sleep Mode (PBSM), and then jump to Bus-Sleep Mode (BSM).
[0113] In the above process, the crystal oscillator measures the time when the state machine jumps from NOS to Ready Sleep State (RSS) as t1, the time when it jumps from RSS state to PBSM as t3, and the time when it jumps from PBSM to BSM as t2. The state maintenance time T from jumping from RSS to jumping out of PBSM (i.e. jumping to BSM) is (晶振) It can be determined by the following formula:
[0114] T (晶振) =(t2-t3)+(t3-t1)
[0115] Here, (t2-t3) represents the state maintenance time of PBSM, and (t3-t1) represents the state maintenance time of RSS.
[0116] The CAN chip can obtain the PBSM state maintenance time (corresponding to the target information associated with PBSM) and the RSS state maintenance time (corresponding to the target information associated with RSS) by querying the MCU log record, encapsulate these two time periods as two target information into the target message, and send the target message to the test host computer through the CAN chip Tx channel, so that the test host computer can determine the T required for the test by parsing the target message. (晶振) .
[0117] For the sake of simplicity, the method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0118] Secondly, Figure 3 This is a structural diagram of a state machine jump test system according to an embodiment of the present application. The system includes an electronic control unit (ECU), an information transceiver unit, and a test host computer, wherein:
[0119] The information transceiver unit is used to convert the communication protocol to support information transmission between the ECU and the test host computer;
[0120] The test host computer is used to send control information to the test host computer through the information transceiver unit to control the state machine in the ECU to start jumping between different states;
[0121] The ECU is used to determine the start timestamp of the ECU state machine jumping to different states and the end timestamp of jumping out of the different states by using a crystal oscillator marking method;
[0122] The ECU is further configured to determine target information associated with each of the different states based on each of the start timestamps and each of the end timestamps, wherein the target information is used to describe the state maintenance time;
[0123] The ECU is further configured to send each target information to a test host computer via the information transceiver unit.
[0124] The ECU has a network management function, which includes an MCU, a target chip (such as a CAN chip) and a crystal oscillator that are communicatively connected to the test host computer; the information transceiver unit can be a message transceiver (such as VN1640, etc.).
[0125] By adopting the technical solution of the embodiment of the present application, with the help of the high-precision timing capability of the crystal oscillator, the state entry moment (i.e., the start timestamp) and the state exit moment (i.e., the end timestamp) of the state machine are accurately measured, and the target information is determined based on this and informed to the test host computer, so that the test host computer can obtain a more accurate state maintenance time, thereby improving the reliability of the state machine jump test and ensuring the quality of the ECU.
[0126] Optionally, the ECU is further configured to send target information associated with the previous state to the test host computer in response to detecting that the state machine successfully jumps to the current state.
[0127] Optionally, the ECU is further configured to add the target information as message content to a target message, wherein the target message is an event-type message in which the state of the state machine successfully jumps to a sending trigger event;
[0128] The ECU is further configured to send a target message containing the target information to the test host computer in response to detecting the sending trigger event.
[0129] Optionally, the test host computer is further configured to send target indication information to the ECU via the information transceiver unit;
[0130] The ECU is further configured to, upon receiving the target indication information, determine, based on each of the target information, a target state maintenance time for the state machine from jumping to the first state to jumping to the second state;
[0131] The ECU is further configured to send the target state maintenance time to the test host computer;
[0132] The different states associated with each of the target information include at least any one of the following:
[0133] the first state and the second state;
[0134] The first state, and the intermediate state to which the state machine needs to jump when finally jumping from the first state to the second state.
[0135] Optionally, the ECU is further configured to store each of the start timestamps and each of the end timestamps in a log record manner through a microcontroller unit MCU in the ECU;
[0136] The ECU is further configured to obtain a start timestamp and an end timestamp associated with each state from the log of the MCU;
[0137] The ECU is further configured to determine target information associated with a single state based on a start timestamp and an end timestamp associated with the single state.
[0138] Optionally, the target information includes at least one of the following:
[0139] The starting timestamp;
[0140] the termination timestamp;
[0141] The difference between the end timestamp and the start timestamp.
[0142] Thirdly, Figure 4 1 is a schematic structural diagram of a state machine jump test device according to an embodiment of the present application, the device comprising:
[0143] A timing module is used to determine the start timestamp of the ECU's state machine jumping to different states and the end timestamp of jumping out of the different states by using a crystal oscillator timing method;
[0144] An information determination module, configured to determine target information associated with each of the different states according to each of the start timestamps and each of the end timestamps, wherein the target information is used to represent a state maintenance time;
[0145] The information sending module is used to send each of the target information to the test host computer.
[0146] By adopting the technical solution of the embodiment of the present application, with the help of the high-precision timing capability of the crystal oscillator, the state entry moment (i.e., the start timestamp) and the state exit moment (i.e., the end timestamp) of the state machine are accurately measured, and the target information is determined based on this and informed to the test host computer, so that the test host computer can obtain a more accurate state maintenance time, thereby improving the reliability of the state machine jump test and ensuring the quality of the ECU.
[0147] Optionally, the information sending module includes:
[0148] The first sending module is configured to send target information associated with the previous state to the test host computer in response to detecting that the state machine successfully jumps to the current state.
[0149] Optionally, the device further comprises:
[0150] A first processing module is configured to add the target information as message content to a target message, wherein the target message is an event-type message in which the state of the state machine successfully jumps to a sending trigger event;
[0151] The first sending module includes:
[0152] The first sending submodule is configured to send a target message containing the target information to the test host computer in response to detecting the sending trigger event.
[0153] Optionally, the information sending module includes:
[0154] An information receiving module is used to determine, based on each target information, the target state maintenance time for the state machine from jumping to the first state to jumping to the second state when receiving the target indication information from the test host computer;
[0155] A second sending module is used to send the target state maintenance time to the test host computer;
[0156] The different states associated with each of the target information include at least any one of the following:
[0157] the first state and the second state;
[0158] The first state, and the intermediate state to which the state machine needs to jump when finally jumping from the first state to the second state.
[0159] Optionally, the device further comprises:
[0160] A second processing module is configured to store each of the start timestamps and each of the end timestamps in a log record manner through a microcontroller unit MCU in the ECU;
[0161] The information determination module includes:
[0162] A first determining module is configured to obtain a start timestamp and an end timestamp associated with a single state from a log of the MCU;
[0163] The second determining module is configured to determine target information associated with a single state according to a start timestamp and an end timestamp associated with the single state.
[0164] Optionally, the target information includes at least one of the following:
[0165] The starting timestamp;
[0166] the termination timestamp;
[0167] The difference between the end timestamp and the start timestamp.
[0168] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0169] The present application also provides an electronic device, Figure 5 , Figure 5 Schematic diagram of the electronic device proposed in the embodiment of the present application. Figure 5 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120, thereby implementing the steps in the jump test method of the state machine disclosed in the embodiment of the present application.
[0170] An embodiment of the present application further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the jump test method of the state machine disclosed in the embodiment of the present application is implemented.
[0171] An embodiment of the present application further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the jump test method of the state machine disclosed in the embodiment of the present application.
[0172] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0173] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0174] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, systems, devices, storage media, and program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0177] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0178] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "includes," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements that are inherent to such process, method, article, or terminal device. In the absence of further restrictions, an element defined by the phrase "comprises a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0179] The above is a detailed introduction to the jump test method, system, device, equipment and medium of a state machine provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A jump test method for a state machine, characterized in that: The method comprises: Using a crystal oscillator dot method, determine the start timestamp of the state machine of the electronic control unit ECU jumping to different states and the end timestamp of jumping out of the different states; Determine, according to each of the start timestamps and each of the end timestamps, target information associated with each of the different states, wherein the target information is used to characterize the state maintenance time; Send each of the target information to the test host computer.
2. The method according to claim 1, characterized in that: Sending each of the target information to the test host computer includes: In response to detecting that the state machine successfully jumps to the current state, the target information associated with the previous state is sent to the test host computer.
3. The method according to claim 2, characterized in that The method further comprises: Adding the target information as message content to a target message, wherein the target message is an event-type message in which the state of the state machine successfully jumps to a sending trigger event; In response to detecting that the state machine successfully jumps to the current state, sending the target information associated with the previous state to the test host computer includes: In response to detecting the sending trigger event, a target message containing the target information is sent to the test host computer.
4. The method according to claim 1, characterized in that: Sending each of the target information to the test host computer includes: When receiving target indication information from the test host computer, determining the target state maintenance time for the state machine from jumping to the first state to jumping to the second state according to each target information; Sending the target state maintenance time to the test host computer; The different states associated with each of the target information include at least any one of the following: the first state and the second state; The first state, and the intermediate state to which the state machine needs to jump during the process of finally jumping from the first state to the second state.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: By means of a microcontroller unit MCU in the ECU, each of the start timestamps and each of the end timestamps are stored in a log record manner; Determining target information associated with each of the different states according to each of the start timestamps and each of the end timestamps includes: From the MCU log, obtain the start timestamp and end timestamp associated with each state; According to the start timestamp and the end timestamp associated with the single state, the target information associated with the single state is determined.
6. The method according to any one of claims 1 to 4, characterized in that: The target information includes at least one of the following: The starting timestamp; the termination timestamp; The difference between the end timestamp and the start timestamp.
7. A state machine jump test system, characterized in that: The system includes an electronic control unit ECU, an information transceiver unit and a test host computer, wherein: The information transceiver unit is used to convert the communication protocol to support information transmission between the ECU and the test host computer; The test host computer is used to send control information to the test host computer through the information transceiver unit to control the state machine in the ECU to start jumping between different states; The ECU is used to determine the start timestamp of the state machine of the ECU jumping to different states and the end timestamp of jumping out of the different states by using a crystal oscillator dotting method; The ECU is further used to determine target information associated with each of the different states according to each of the start timestamps and each of the end timestamps, wherein the target information is used to describe the state maintenance time; The ECU is also used to send each of the target information to the test host computer through the information transceiver unit.
8. A jump test device for a state machine, characterized in that: The device comprises: A timing module is used to determine the start timestamp of the ECU state machine jumping to different states and the end timestamp of jumping out of the different states by using a crystal oscillator timing method; An information determination module, used to determine target information associated with each of the different states according to each of the start timestamps and each of the end timestamps, wherein the target information is used to represent the state maintenance time; The information sending module is used to send each of the target information to the test host computer.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the jump test method of the state machine according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the jump test method of the state machine as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Real-time test method for computer control system
CN102541052A
ONU time synchronization processing system and method based on the GPON system in the class B PON protection
CN106603186A
Signal transmission method and apparatus, and chip
CN108268683A
Method and device for state conversion
CN108845844A
Performance degradation feature assessment method based on time series change mutation point detection
CN109828548A
