Time detection method and device, terminal equipment and computer program product

By detecting when a device wakes up in a CAN network and starting a timer to send a diagnostic request, and by adjusting the timing based on the test environment and behavioral information, the problem of detecting the CAN network diagnostic start time is solved, achieving accurate detection of the CAN network diagnostic start time and improving the practicality of the device.

CN120877401APending Publication Date: 2025-10-31GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411385151.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing technologies cannot effectively detect the diagnostic start time of CAN networks, making it difficult to meet the standard requirements for automotive AUTOSAR network management.

Method used

The timing is started when the device under test (DUT) is detected to be woken up in the controller local area network. A preset diagnostic request is sent to the DUT, and a preset response information is received within a standard duration to determine the normality of the diagnostic start time. A test environment is built to perform power-on and power-off operations, wake up the device, and obtain behavioral information to adjust the diagnostic start time.

Benefits of technology

It enables accurate detection of CAN network diagnostic start time, improves the practicality and diagnostic accuracy of the equipment, avoids erroneous judgments caused by non-compliant diagnostic start time, and improves the success rate of diagnostic functions of the vehicle controller area network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877401A_ABST
    Figure CN120877401A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of automobiles, and provides a time detection method and device, terminal equipment and a computer program product, and the method comprises the steps: starting timing when detecting that to-be-detected equipment in a controller local area network is awakened; after it is detected that the timing duration is equal to the standard duration, a preset diagnosis request is sent to the to-be-detected device; if preset response information sent by the to-be-detected equipment within the standard duration range is detected, determining that the diagnosis starting time of the to-be-detected equipment is normal; the preset response information corresponds to the preset diagnosis request. According to the method, after the equipment in the controller local area network is awakened for the standard duration, the preset diagnosis request is sent to the equipment, and the preset response information fed back by the equipment is received within the standard duration range, so that the diagnosis starting time of the equipment can be determined to be normal, and the detection of the diagnosis starting time of the CAN network is realized; and the practicability of the equipment and the subsequent diagnosis accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of automotive technology, and in particular relates to a time detection method, device, terminal equipment, and computer program product. Background Technology

[0002] In practical applications, the diagnostic start time (TDiagStart) of the vehicle's Controller Area Network (CAN) refers to the point in time when the diagnostic function of the Electronic Control Unit (ECU) connected to the CAN network begins recording data. According to automotive AUTOSAR network management regulations, the diagnostic start time TDiagStart must meet the specifications.

[0003] However, existing technologies typically only monitor for anomalies in CAN network messages and cannot detect the start-up time of CAN network diagnostics, which is insufficient to meet practical needs. Summary of the Invention

[0004] This application provides a time detection method, apparatus, terminal device, and computer program product to solve the problem that the prior art cannot detect the diagnostic start time of the CAN network, which makes it difficult to meet practical needs.

[0005] In a first aspect, embodiments of this application provide a time detection method, including:

[0006] The timer starts when the device under test (DUT) in the controller area network is detected to be awakened.

[0007] After detecting that the timing duration is equal to the standard duration, a preset diagnostic request is sent to the device under test;

[0008] If a preset response message is received from the device under test within the standard time range, it is determined that the diagnostic activation time of the device under test is normal; the preset response message corresponds to the preset diagnostic request.

[0009] Optionally, before starting the timing upon detecting that the device under test (DUT) in the CAN network has been woken up, the method further includes:

[0010] Construct a test environment that matches the device under test;

[0011] In the test environment, power-on and power-off operations are performed on the device under test;

[0012] When the device under test is detected to be in a sleep state, the device under test is woken up.

[0013] Optionally, performing power-on and power-off operations on the device under test includes:

[0014] Perform a power-on operation on the device under test;

[0015] If a setting message is received from the device under test, it is determined that the device under test is in normal working condition;

[0016] Perform a power-off operation on the device under test;

[0017] If it is detected that the device under test has not sent any type of message, then it is determined that the device under test is in a sleep state;

[0018] Accordingly, after waking up the device under test, the following steps are also included:

[0019] If the set message sent by the device under test is detected, it is determined that the device under test is in normal working condition.

[0020] Optionally, after sending a preset diagnostic request to the device under test after detecting that the timing duration equals the standard duration, the method further includes:

[0021] If the preset response information is not received within the standard time range, the diagnostic start time is determined to be abnormal.

[0022] Optionally, after determining that the diagnostic start time is abnormal, the method further includes:

[0023] Acquire the behavior information of the device under test when the diagnostic start time is abnormal within a historical time period;

[0024] Based on the behavioral information, the degree of abnormality of the device under test is determined;

[0025] If the degree of abnormality is greater than a set threshold, the diagnostic activation time of the device under test will be adjusted.

[0026] Optionally, after the start of timing, the following may also be included:

[0027] Send the preset diagnostic request to the device under test at preset time intervals;

[0028] If the preset response information is received before the end of the standard duration, it is determined that the diagnostic start time is abnormal.

[0029] If a target response is received, it is determined that the diagnostic start time is normal; the target response corresponds to the target diagnostic request; the target diagnostic request refers to a preset diagnostic request sent at the end of the standard duration.

[0030] Optionally, after determining that the diagnostic start-up time of the device under test is normal, the method further includes:

[0031] Determine the status of the electronic control unit in the device under test;

[0032] Obtain the power supply voltage of the device under test;

[0033] If the status indicates that the electronic control unit has been activated and the power supply voltage is within the set range, a prompt message is output to prompt the activation of the diagnostic function of the device under test.

[0034] Secondly, embodiments of this application provide a time detection device, including:

[0035] A timing unit is used to start timing when the device under test in the controller area network is detected to be woken up;

[0036] The first sending unit is used to send a preset diagnostic request to the device under test after detecting that the timing duration is equal to the standard duration.

[0037] The first determining unit is configured to determine that the diagnostic activation time of the device under test is normal if a preset response information is received from the device under test within a standard time range; the preset response information corresponds to the preset diagnostic request.

[0038] Thirdly, embodiments of this application provide a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the time detection method as described in any one of the first aspects above.

[0039] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the time detection method as described in any one of the first aspects above.

[0040] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when run on a terminal device, enables the terminal device to execute the time detection method described in any one of the first aspects.

[0041] The beneficial effects of the embodiments in this application compared with the prior art are:

[0042] This application provides a time detection method that starts timing when a device under test (DUT) in a controller local area network (CLAN) is detected to be woken up. After the timing duration equals a standard duration, a preset diagnostic request is sent to the DUT. If a preset response is received from the DUT within the standard duration, the diagnostic activation time of the DUT is determined to be normal. The preset response corresponds to the preset diagnostic request. This method can determine that the diagnostic activation time of a device in a CLAN is normal by sending a preset diagnostic request to the device after a standard wake-up time and receiving a preset response within the standard duration. This achieves the detection of the diagnostic activation time of the CAN network, improving the practicality of the device and the accuracy of subsequent diagnostics. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart illustrating the implementation of a time detection method provided in an embodiment of this application;

[0045] Figure 2 This is a flowchart illustrating the implementation of a time detection method provided in another embodiment of this application;

[0046] Figure 3 This is a flowchart illustrating the implementation of a time detection method provided in another embodiment of this application;

[0047] Figure 4 This is a schematic diagram of the structure of a time detection device provided in an embodiment of this application;

[0048] Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0049] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0050] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0051] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0052] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0053] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0054] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0055] In practical applications, according to automotive AUTOSAR network management regulations, when using devices with diagnostic functions in a vehicle, the power supply to the KL15 connected to the device in the vehicle's Controller Area Network (CAN) must be disconnected to put the device into sleep mode. Then, the device must be woken up using the KL15 to test whether the diagnostic start time (TDiagStart) of the CAN meets the specification requirements. The diagnostic start time of the CAN refers to the time when the diagnostic function of the Electronic Control Unit (ECU) in the vehicle's CAN network begins recording data.

[0056] However, existing technologies typically only monitor for anomalies in CAN network messages and cannot detect the diagnostic start time of the CAN network, thus failing to meet practical needs. Therefore, embodiments of this application provide a time detection method to detect the diagnostic start time of the CAN network.

[0057] Please see Figure 1 , Figure 1 This is a flowchart illustrating the implementation of a time detection method according to an embodiment of this application. In this embodiment, the execution subject of the time detection method is a terminal device. The terminal device includes, but is not limited to, devices such as laptops, desktop computers, and computers.

[0058] like Figure 1 As shown, a time detection method provided in one embodiment of this application may include S101 to S103, which are described in detail below:

[0059] In S101, timing begins when the device under test in the controller area network is detected to be woken up.

[0060] It should be noted that the device under test can be a device with an electronic control unit.

[0061] In this embodiment of the application, when the terminal device detects that the device under test in the controller local area network is woken up from the sleep state, in order to realize the detection of the diagnostic start time of the device under test in the controller local area network, that is, whether the diagnostic start time of the controller local area network meets the specification requirements, the terminal device can start timing at the moment the device under test is woken up.

[0062] The start time of the timing is the moment when the device under test is woken up.

[0063] In practical applications, if the diagnostic activation time of the device under test (DUT) located in the controller area network does not meet the requirements (i.e., the activation time is too short or too long), the diagnostic function of the DUT may fail to activate properly, leading to incorrect diagnoses of certain vehicle faults. Therefore, to avoid this situation, the DUT can be controlled to be woken up in a test environment. The test environment refers to a virtual experimental environment constructed by the terminal device.

[0064] Based on this, in one embodiment of this application, the terminal device can specifically be configured as follows: Figure 2 The steps S201 to S203 shown are described in detail below:

[0065] In S201, a test environment matching the device under test is constructed.

[0066] In S202, in the test environment, power-on and power-off operations are performed on the device under test.

[0067] In S203, when the device under test is detected to be in a sleep state, the device under test is woken up.

[0068] In this embodiment, in order to ensure that the diagnostic start-up time of the device under test can be successfully tested, the terminal device can build a test environment that matches the device under test.

[0069] Understandably, the test environment that matches the device under test can be constructed based on the actual working environment of the device under test located in the vehicle controller local area network in the actual application.

[0070] In this embodiment, in order to detect whether the device under test can operate normally in the above-mentioned test environment, and to further improve the accuracy and success rate of subsequent detection of diagnostic start time, the terminal device can perform power-on and power-off operations on the device under test in the above-mentioned test environment to determine whether the device under test can be powered on and powered off normally, that is, whether the device under test can operate normally in the above-mentioned test environment.

[0071] Specifically, in one embodiment of this application, the terminal device may determine whether the device under test can be powered on and off normally through the following steps, detailed below:

[0072] Perform a power-on operation on the device under test;

[0073] If a setting message is received from the device under test, it is determined that the device under test is in normal working condition;

[0074] Perform a power-off operation on the device under test;

[0075] If it is detected that the device under test (DUT) has not sent any type of message, then the DUT is determined to be in a sleep state.

[0076] It should be noted that after the device under test (DUT) is powered on, it will send a configuration message to the terminal device to indicate that it is in normal working condition. Therefore, in this embodiment, after the terminal device powers on the DUT, it can detect in real time whether it has received the configuration message sent by the DUT. The configuration message can be set according to actual needs and is not limited here.

[0077] For example, the configuration message can be a message with message ID 0x502.

[0078] In this embodiment, when the terminal device receives the setting message sent by the device under test, it can determine that the device under test is in normal working condition.

[0079] Afterwards, the terminal device can perform a power-off operation on the device under test.

[0080] In some possible embodiments, the power-off operation may specifically involve disconnecting the device under test from the power supply. This power supply may be a KL15 power supply.

[0081] It should be noted that after the device under test (DUT) is powered off, it cannot send any messages to the terminal device. Therefore, in this embodiment, after the terminal device performs a power-off operation on the DUT and detects that the DUT has not sent any message, it can determine that the DUT is in a sleep state.

[0082] In this embodiment, when the terminal device determines that the device under test is in a sleep state, it means that the device under test can be woken up to detect the diagnostic start time of the device under test. Therefore, the terminal device can wake up the device under test at this time.

[0083] In some possible embodiments, in order to determine whether the device under test has been woken up, the terminal device can check in real time whether it has received a setting message sent by the device under test.

[0084] In this embodiment, when the terminal device receives the setting message sent by the device under test, it indicates that the device under test has been woken up from the sleep state. In other words, the terminal device can determine that the device under test is in normal working condition.

[0085] In this embodiment, after the terminal device starts timing, it can detect the timing duration in real time, that is, the duration for which the device under test is woken up, or the duration for which the diagnostic function of the device under test is enabled, whether it is equal to the standard duration. The standard duration is used to characterize the duration required for the diagnostic activation time to meet the specification requirements.

[0086] For example, the standard duration can be any value within the range of [1400ms, 1600ms].

[0087] In S102, after detecting that the timing duration is equal to the standard duration, a preset diagnostic request is sent to the device under test.

[0088] In this embodiment, after the terminal device detects that the timing duration equals the standard duration, it indicates that the diagnostic start time of the device under test (DUT) meets the specification requirements. In other words, the DUT has entered the first process after the diagnostic start time, such as enabling the diagnostic function. Therefore, to confirm that the diagnostic start time of the DUT indeed meets the specification requirements, the terminal device can send a preset diagnostic request to the DUT. The preset diagnostic request can be set according to actual needs and is not limited here.

[0089] It is understandable that the aforementioned pre-defined diagnostic request is sent at the end of the standard duration.

[0090] For example, a default diagnostic request could be a diagnostic request with a message of 0x762.

[0091] It should be noted that since it takes a certain amount of time for the device under test (DUT) to receive the preset diagnostic request sent by the terminal device, and then another certain amount of processing time for the DUT to send the preset response information corresponding to the preset diagnostic request back to the terminal device, followed by another certain amount of time for the terminal device to receive the preset response information from the DUT, the terminal device can detect in real time whether it receives the preset response information from the DUT within a standard time range after sending the preset diagnostic request to the DUT. The standard time range can be determined according to actual needs and is not limited here.

[0092] When the preset diagnostic request is a diagnostic request with message 0x762, the corresponding preset response information can be the fault code 0xC10087 sent with message 0x7A2.

[0093] In some possible embodiments, the standard duration range can be determined based on the sum of the time it takes for the device under test to receive a preset diagnostic request sent by the terminal device, the processing time for the device under test to send preset response information corresponding to the preset diagnostic request to the terminal device, and the time it takes for the terminal device to receive the preset response information sent by the device under test.

[0094] In one embodiment of this application, when the terminal device receives a preset response information sent by the device under test within a standard duration, it can execute step S103.

[0095] In another embodiment of this application, if the terminal device does not receive the preset response information within the standard duration, it indicates that the device under test has not entered the first process after the diagnostic start time. In other words, the diagnostic start time of the device under test has expired, which means that the diagnostic start time does not meet the specification requirements. Therefore, the terminal device can determine that the diagnostic start time of the device under test is abnormal.

[0096] In S103, if a preset response message is received from the device under test within a standard time range, it is determined that the diagnostic activation time of the device under test is normal; the preset response message corresponds to the preset diagnostic request.

[0097] In this embodiment of the application, when the terminal device receives the preset response information sent by the device under test within the standard duration, it indicates that the device under test has entered the first process after the diagnostic start time. In other words, the diagnostic start time of the device under test has not exceeded the time limit, which means that the diagnostic start time meets the specification requirements. Therefore, the terminal device can determine that the diagnostic start time of the device under test is normal.

[0098] As can be seen from the above, the time detection method provided in this application starts timing when the device under test (DUT) in the controller local area network (CLAN) is detected to be woken up; after the timing duration is detected to be equal to a standard duration, a preset diagnostic request is sent to the DUT; if a preset response information sent by the DUT within the standard duration is detected, it is determined that the diagnostic start time of the DUT is normal; the preset response information corresponds to the preset diagnostic request. This method can determine that the diagnostic start time of a device in the CLAN is normal by sending a preset diagnostic request to the device after the device has been woken up for a standard duration and receiving a preset response information from the device within the standard duration. This achieves the detection of the diagnostic start time of the CAN network, improving the practicality of the device and the accuracy of subsequent diagnostics.

[0099] Please see Figure 3 , Figure 3 This is a flowchart illustrating the implementation of a time detection method according to another embodiment of this application. Relative to... Figure 1 In a corresponding embodiment, this embodiment may further include S301 to S303 after S101, as detailed below:

[0100] In S301, a preset diagnostic request is sent to the device under test based on a preset time interval.

[0101] In S302, if the preset response information is received before the end of the standard duration, it is determined that the diagnostic start time is abnormal.

[0102] In S303, if a target response information is received, it is determined that the diagnostic start time is normal; the target response information corresponds to the target diagnostic request; the target diagnostic request refers to a preset diagnostic request sent at the end of the standard duration.

[0103] In this embodiment, to further improve the accuracy of detecting whether the diagnostic start time meets the specification requirements, the terminal device can send a preset diagnostic request to the device under test based on a preset time interval after the timing starts. The preset time interval can be set according to actual needs and is not limited here.

[0104] After sending a preset diagnostic request to the device under test at a preset time interval, the terminal device can detect in real time whether it receives a preset response information corresponding to each preset diagnostic request. Simultaneously, the terminal device can also determine the time at which the preset response information corresponding to each preset diagnostic request is received.

[0105] In this embodiment, when the terminal device receives the preset response information before the end of the standard duration, it indicates that the diagnostic start time of the device under test is too short, that is, the diagnostic start time does not meet the specification requirements. Therefore, the terminal device can determine that the diagnostic start time is abnormal.

[0106] When the terminal device receives the target response information, since the target response information corresponds to the target diagnostic request, and the target diagnostic request refers to the preset diagnostic request sent at the end of the standard duration, that is, the diagnostic start time at this time meets the specification requirements, the terminal device can determine that the diagnostic start time is normal.

[0107] As can be seen from the above, the time detection method provided in this embodiment allows the terminal device to send a preset diagnostic request to the device under test based on a preset time interval after the timing starts, thereby further improving the detection accuracy of whether the diagnostic start time meets the specification requirements.

[0108] In one embodiment of this application, since both excessively short and excessively long diagnostic activation times of the device under test (DUT) can affect the subsequent functions of the DUT, and even affect certain functions of the vehicle equipped with the DUT, in order to improve the usability of the DUT and avoid impacting the vehicle, the terminal device can also perform the following steps after detecting an abnormal diagnostic activation time, as detailed below:

[0109] Acquire the behavior information of the device under test when the diagnostic start time is abnormal within a historical time period;

[0110] Based on the behavioral information, the degree of abnormality of the device under test is determined;

[0111] If the degree of abnormality is greater than a set threshold, the diagnostic activation time of the device under test will be adjusted.

[0112] It should be noted that the historical time period can be determined according to actual needs, and there are no restrictions here.

[0113] Behavioral information describes the actions taken by the device under test when diagnosing an abnormal start-up time. This behavioral information includes, but is not limited to, outputting a fault code before the standard duration or outputting an incorrect fault code after the standard duration.

[0114] In this embodiment, after obtaining the behavior information of the device under test when the diagnostic start-up time is abnormal, the terminal device can determine the degree of abnormality of the device under test based on the degree of impact of the behavior information on the vehicle.

[0115] It should be noted that the degree of impact is positively correlated with the degree of anomaly. That is, the higher the degree of impact, the higher the degree of anomaly, and vice versa.

[0116] After obtaining the aforementioned level of abnormality, the terminal device can compare this level with a preset threshold. The preset threshold can be determined according to actual needs and is not limited here. For example, the preset threshold could be 50%.

[0117] In this embodiment, after the terminal device detects that the above-mentioned abnormality level is greater than the set threshold, it indicates that the impact of the device under test on the vehicle after the abnormal diagnostic start time is high. Therefore, in order to improve the practicality of the device under test, the terminal device can adjust the diagnostic start time of the device under test so that the diagnostic start time meets the specification requirements, that is, within the standard time range after the standard time, the preset response information corresponding to the preset diagnostic request sent at the end of the standard time is received.

[0118] In one embodiment of this application, after the terminal device detects that the abnormality level is less than or equal to a set threshold, it indicates that the impact of the device under test on the vehicle after diagnosing the abnormal start time is low. In other words, the device under test will not have a significant impact on the vehicle after diagnosing the abnormal start time. Therefore, in order to improve work efficiency, the terminal device may not perform any processing on the device under test so that the device under test can enter the first process after diagnosing the start time as soon as possible.

[0119] As can be seen from the above, the time detection method provided in this embodiment can perform corresponding operations when the diagnostic start-up time of the device under test is abnormal, so as to improve the practicality of the device under test and avoid the impact on the vehicle.

[0120] In another embodiment of this application, in order to further improve the successful activation of the diagnostic function of the device under test after the diagnostic activation time, the terminal device may also perform the following steps after step S103, which are detailed below:

[0121] Determine the status of the electronic control unit in the device under test;

[0122] Obtain the power supply voltage of the device under test;

[0123] If the status indicates that the electronic control unit has been activated and the power supply voltage is within the set range, a prompt message is output to prompt the activation of the diagnostic function of the device under test.

[0124] In this embodiment, after the terminal device detects that the diagnostic activation time is normal, in order to determine whether the diagnostic function of the device under test can be activated at this time, the terminal device can determine the status of the electronic control unit in the device under test.

[0125] The states of the electronic control unit include, but are not limited to, sleep state and working state.

[0126] In practical applications, since whether the power supply voltage of the device under test is within the voltage range for enabling network-related diagnostics will also affect the diagnostic function of the device under test, in this embodiment, the terminal device can also obtain the power supply voltage of the device under test.

[0127] Afterwards, the terminal device can detect whether the electronic control unit (ECU) of the device under test (DUT) is in working condition, i.e., whether the ECU has been woken up, and whether the power supply voltage of the DUT is within the set range. The specific set range can be configured according to the voltage range enabled by the network-related diagnostics.

[0128] In this embodiment, when the terminal device detects that the electronic control unit has been woken up and the power supply voltage of the device under test is within the set range, it indicates that all the conditions for enabling the diagnostic function of the device under test have been met. Therefore, the terminal device can output a prompt message to enable the diagnostic function of the device under test.

[0129] As can be seen from the above, the time detection method provided in this embodiment can perform corresponding operations after the diagnostic start time of the device under test is normal, so as to improve the success rate of starting the diagnostic function of the device under test after the diagnostic start time.

[0130] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0131] Corresponding to the time detection method described in the above embodiments, Figure 4 A schematic diagram of a time detection device according to an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown. (Refer to...) Figure 4 The time detection device 400 includes: a timing unit 41, a first transmitting unit 42, and a first determining unit 43. Wherein:

[0132] The timing unit 41 is used to start timing when the device under test in the controller local area network is detected to be woken up.

[0133] The first sending unit 42 is used to send a preset diagnostic request to the device under test after detecting that the timing duration is equal to the standard duration.

[0134] The first determining unit 43 is used to determine that the diagnostic activation time of the device under test is normal if a preset response information is received from the device under test within a standard time range; the preset response information corresponds to the preset diagnostic request.

[0135] In one embodiment of this application, the time detection device 400 further includes: a construction unit, a first execution unit, and a wake-up unit. Wherein:

[0136] The building unit is used to build a test environment that matches the device under test.

[0137] The first execution unit is used to perform power-on and power-off operations on the device under test in the test environment.

[0138] The wake-up unit is used to wake up the device under test when it is detected that the device under test is in a sleep state.

[0139] In one embodiment of this application, the first execution unit specifically includes: a second execution unit, a second determination unit, a third execution unit, and a third determination unit; correspondingly, the time detection device 400 includes: a fourth determination unit. Wherein:

[0140] The second execution unit is used to perform a power-on operation on the device under test.

[0141] The second determining unit is used to determine that the device under test is in normal working condition if it receives a setting message sent by the device under test.

[0142] The third execution unit is used to perform a power-off operation on the device under test.

[0143] The third determining unit is used to determine that the device under test is in a sleep state if it is detected that the device under test has not sent any kind of message.

[0144] The fourth determining unit is used to determine that the device under test is in normal working condition if the setting message sent by the device under test is detected.

[0145] In one embodiment of this application, the time detection device 400 further includes a fifth determining unit.

[0146] The fifth determining unit is used to determine that the diagnostic start time is abnormal if the preset response information is not received within the standard time range.

[0147] In one embodiment of this application, the time detection device 400 further includes: a first acquisition unit, a sixth determination unit, and an adjustment unit. Wherein:

[0148] The first acquisition unit is used to acquire the behavior information of the device under test when the diagnostic start time is abnormal during a historical time period.

[0149] The sixth determining unit is used to determine the degree of abnormality of the device under test based on the behavioral information.

[0150] The adjustment unit is used to adjust the diagnostic activation time of the device under test if the degree of abnormality is greater than a set threshold.

[0151] In one embodiment of this application, the time detection device 400 further includes: a second sending unit, a seventh determining unit, and an eighth determining unit. Wherein:

[0152] The second sending unit is used to send the preset diagnostic request to the device under test based on a preset time interval.

[0153] The seventh determining unit is used to determine that the diagnostic start time is abnormal if the preset response information is received before the end of the standard duration.

[0154] The eighth determining unit is used to determine that the diagnostic start time is normal if the target response information is received; the target response information corresponds to the target diagnostic request; the target diagnostic request refers to the preset diagnostic request sent at the end of the standard duration.

[0155] In one embodiment of this application, the time detection device 400 further includes: a ninth determining unit, a second acquiring unit, and an output unit. Wherein:

[0156] The ninth determining unit is used to determine the state of the electronic control unit in the device under test.

[0157] The second acquisition unit is used to acquire the power supply voltage of the device under test.

[0158] The output unit is used to output a prompt message to enable the diagnostic function of the device under test if the state indicates that the electronic control unit has been woken up and the power supply voltage is within a set range.

[0159] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0160] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0161] Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 5 As shown, the terminal device 5 in this embodiment includes: at least one processor 50 ( Figure 5 (Only one is shown) a processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, wherein the processor 50 executes the computer program 52 to implement the steps in any of the above-described time detection method embodiments.

[0162] The terminal device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will understand that... Figure 5 This is merely an example of terminal device 5 and does not constitute a limitation on terminal device 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0163] The processor 50 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0164] In some embodiments, the memory 51 may be an internal storage unit of the terminal device 5, such as the RAM of the terminal device 5. In other embodiments, the memory 51 may be an external storage device of the terminal device 5, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 5. Furthermore, the memory 51 may include both internal and external storage units of the terminal device 5. The memory 51 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been output or will be output.

[0165] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0166] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.

[0167] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0168] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0169] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A time detection method, characterized in that, include: The timer starts when the device under test (DUT) in the controller area network is detected to be awakened. After detecting that the timing duration is equal to the standard duration, a preset diagnostic request is sent to the device under test; If a preset response message is received from the device under test within the standard time range, it is determined that the diagnostic activation time of the device under test is normal. The preset response information corresponds to the preset diagnostic request.

2. The time detection method as described in claim 1, characterized in that, Before starting the timing upon detecting that the device under test (DUT) in the CAN network has been woken up, the following is also included: Construct a test environment that matches the device under test; In the test environment, power-on and power-off operations are performed on the device under test; When the device under test is detected to be in a sleep state, the device under test is woken up.

3. The time detection method as described in claim 2, characterized in that, The step of performing power-on and power-off operations on the device under test includes: Perform a power-on operation on the device under test; If a setting message is received from the device under test, it is determined that the device under test is in normal working condition; Perform a power-off operation on the device under test; If it is detected that the device under test has not sent any type of message, then it is determined that the device under test is in a sleep state; Accordingly, after waking up the device under test, the following steps are also included: If the set message sent by the device under test is detected, it is determined that the device under test is in normal working condition.

4. The time detection method as described in claim 1, characterized in that, After sending a preset diagnostic request to the device under test after detecting that the timing duration equals the standard duration, the method further includes: If the preset response information is not received within the standard time range, the diagnostic start time is determined to be abnormal.

5. The time detection method as described in claim 4, characterized in that, After determining that the diagnostic start time is abnormal, the method further includes: Acquire the behavior information of the device under test when the diagnostic start time is abnormal within a historical time period; Based on the behavioral information, the degree of abnormality of the device under test is determined; If the degree of abnormality is greater than a set threshold, the diagnostic activation time of the device under test will be adjusted.

6. The time detection method as described in claim 1, characterized in that, After the start of timing, it also includes: Send the preset diagnostic request to the device under test at preset time intervals; If the preset response information is received before the end of the standard duration, it is determined that the diagnostic start time is abnormal. If a target response is received, it is determined that the diagnostic start time is normal; the target response corresponds to the target diagnostic request; the target diagnostic request refers to a preset diagnostic request sent at the end of the standard duration.

7. The time detection method according to any one of claims 1-6, characterized in that, After determining that the diagnostic start-up time of the device under test is normal, the method further includes: Determine the status of the electronic control unit in the device under test; Obtain the power supply voltage of the device under test; If the status indicates that the electronic control unit has been activated and the power supply voltage is within the set range, a prompt message is output to prompt the activation of the diagnostic function of the device under test.

8. A time detection device, characterized in that, include: A timing unit is used to start timing when the device under test in the controller area network is detected to be woken up; The first sending unit is used to send a preset diagnostic request to the device under test after detecting that the timing duration is equal to the standard duration. The first determining unit is configured to determine that the diagnostic activation time of the device under test is normal if a preset response information is received from the device under test within a standard time range. The preset response information corresponds to the preset diagnostic request.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the time detection method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, It includes a computer program that, when run, implements the time detection method as described in any one of claims 1 to 7.