CN109921915B - Method and device for testing wake-up function of real-time clock module and electronic equipment - Google Patents

Method and device for testing wake-up function of real-time clock module and electronic equipment Download PDF

Info

Publication number
CN109921915B
CN109921915B CN201910014718.9A CN201910014718A CN109921915B CN 109921915 B CN109921915 B CN 109921915B CN 201910014718 A CN201910014718 A CN 201910014718A CN 109921915 B CN109921915 B CN 109921915B
Authority
CN
China
Prior art keywords
message
test
time
testing
awakening
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910014718.9A
Other languages
Chinese (zh)
Other versions
CN109921915A (en
Inventor
董时舫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201910014718.9A priority Critical patent/CN109921915B/en
Publication of CN109921915A publication Critical patent/CN109921915A/en
Application granted granted Critical
Publication of CN109921915B publication Critical patent/CN109921915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The application discloses a method, a device, electronic equipment and a computer readable storage medium for testing a real-time clock module wake-up function, wherein the method comprises the following steps: setting a target awakening mode of the tested equipment; sending a sleep message to the test equipment and triggering the tested equipment to enter a sleep state, wherein the sleep message carries a message type identifier and a quasi-sleep duration; when the tested equipment is awakened from the sleep state, sending an awakening message to the testing equipment so that the testing equipment can obtain a testing result of the current round based on the sleep message and the awakening message, wherein the awakening message carries a message type identifier and a pseudo-sleep duration; and after waiting for a preset time, repeatedly executing the step of setting the target awakening mode of the tested equipment and the subsequent steps until reaching the preset test round number or test time. By the scheme, the automatic test of the real-time clock module awakening function can be realized, so that the test result is more accurate.

Description

Method and device for testing wake-up function of real-time clock module and electronic equipment
Technical Field
The present application belongs to the field of device testing technologies, and in particular, to a method and an apparatus for testing a wake-up function of a real-time clock module, an electronic device, and a computer-readable storage medium.
Background
In various smart mobile devices and embedded devices, a sleep-wake function to a Real Time Clock (RTC) module is generally required. In order to determine the reliability of the wake-up from sleep function provided by the RTC module in different electronic devices, a general method is to set a wake-up time for the RTC on a device to be tested, immediately put the device into sleep, and then wait for the device to be tested to be woken up by the RTC alarm clock; meanwhile, a clock or a timing instrument of a third party is manually controlled, and the time when the tested equipment enters the sleep mode and the time when the tested equipment is awakened by the RTC are obtained by grabbing; and finally, calculating and analyzing the reliability and accuracy of the dormancy awakening function provided by the RTC module of the tested equipment according to the captured moments of the tested equipment entering dormancy and the RTC awakening.
However, the accuracy of the manual grabbing operation is difficult to be ensured, and the workload of the manual grabbing operation is heavy in the cyclic pressure reliability test, which leads to an increase in labor cost.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for testing a wake-up function of a real-time clock module, an electronic device, and a computer-readable storage medium, which can implement automatic testing of the wake-up function of the real-time clock module and make a test result more accurate while saving labor cost.
A first aspect of the present application provides a method for testing a wake-up function of a real-time clock module, which is applied to a device to be tested, and includes:
setting a target awakening mode of the tested equipment to determine the awakening time and the pseudo-sleeping time of the tested equipment;
sending a sleep message to a test device and triggering the tested device to enter a sleep state, wherein the sleep message carries a message type identifier and a pseudo-sleep duration;
when the tested device is awakened from the dormant state, sending an awakening message to the testing device so that the testing device obtains a testing result of the current round based on the dormant message and the awakening message, wherein the awakening message carries a message type identifier and a pseudo dormant duration;
and after waiting for a preset time, repeatedly executing the step of setting the target awakening mode of the tested equipment to determine the awakening time and the pseudo-dormancy time of the tested equipment and the subsequent steps until reaching the preset number of test rounds or test time.
A second aspect of the present application provides a method for testing a wake-up function of a real-time clock module, which is applied to a test device, and includes:
when a first message sent by a tested device is received, analyzing the first message, and determining the type of the first message based on a message type identifier carried in the first message;
if the first message is a dormancy message, recording the time of receiving the first message as first time, and acquiring the quasi-dormancy duration carried in the first message;
after receiving the first message, if a second message sent by the tested device is received, analyzing the second message, and determining the type of the second message based on a message type identifier carried in the second message;
if the second message is a wake-up message, recording the time of receiving the second message as second time;
calculating to obtain a test result of the current round based on the first time, the second time and the pseudo-dormancy duration;
and repeatedly executing the step of analyzing the first message when the first message sent by the tested device is received, and determining the type of the first message based on the message type identifier carried in the first message and the subsequent steps until the preset number of testing rounds or the testing time is reached.
A third aspect of the present application provides an apparatus for testing a wake-up function of a real-time clock module, which is applied to a device under test, and includes:
a setting unit, configured to set a target wake-up mode of the device under test, so as to determine a wake-up time and a pseudo-sleep duration of the device under test;
a first sending unit, configured to send a sleep packet to a test device and trigger the device under test to enter a sleep state, where the sleep packet carries a packet type identifier and the pseudo-sleep duration calculated by the calculating unit;
a second sending unit, configured to send a wake-up packet to the test device when the device under test is awakened from the sleep state, so that the test device obtains a test result of the current round based on the sleep packet and the wake-up packet, where the wake-up packet carries a packet type identifier and a pseudo-sleep duration;
the setting unit is triggered again after waiting for the preset time duration until the preset number of testing rounds or the preset testing time is reached.
A fourth aspect of the present application provides a device for testing a wake-up function of a real-time clock module, which is applied to a test apparatus, and includes:
the device comprises a first analysis unit, a second analysis unit and a third analysis unit, wherein the first analysis unit is used for analyzing a first message sent by a tested device when the first message is received, and determining the type of the first message based on a message type identifier carried in the first message;
a first recording unit, configured to record, as a first time, a time when the first packet is received if the first parsing unit determines that the first packet is a dormant packet, and acquire a quasi-dormant duration carried in the first packet;
a second parsing unit, configured to, after receiving the first packet, if a second packet sent by the device under test is received, parse the second packet, and determine a type of the second packet based on a packet type identifier carried in the second packet;
a second recording unit, configured to record, if the second parsing unit determines that the second packet is a wakeup packet, a time when the second packet is received as a second time;
a result calculating unit, configured to calculate a current test result based on the first time recorded by the first unit, the second time recorded by the second unit, and the pseudo-sleep time;
and the first analysis unit is triggered again after the result calculation unit finishes execution until the preset number of test rounds or test time is reached.
A fifth aspect of the present application provides a device under test comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
A sixth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of the first aspect as above.
A seventh aspect of the present application provides a computer program product comprising a computer program that, when executed by one or more processors, performs the steps of the method as described above in the first aspect.
An eighth aspect of the present application provides a test apparatus comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method of the second aspect when executing the computer program.
A ninth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of the second aspect as above.
A tenth aspect of the application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method according to the second aspect as described above.
As can be seen from the above, according to the present application, in a device under test, first, a target wake-up mode of the device under test is set to determine a wake-up time and a pseudo-sleep duration of the device under test, and then a sleep packet is sent to the test device and the device under test is triggered to enter a sleep state, where the sleep packet carries a packet type identifier and a pseudo-sleep duration, and when the device under test is woken up from the sleep state, a wake-up packet is sent to the test device so that the test device obtains a test result of the current round based on the sleep packet and the wake-up packet, where the wake-up packet carries the packet type identifier and the pseudo-sleep duration, and after waiting for a preset duration, the step of setting the target wake-up mode of the device under test to determine the wake-up time and the pseudo-sleep duration of the device under test and subsequent steps are repeatedly performed, until reaching the preset number of testing rounds or testing time. According to the scheme, the tested equipment respectively sends the sleep message and the test message to the testing equipment during sleep and wake-up, so that the testing equipment calculates the accuracy of the wake-up function of the real-time clock module based on the receiving time of the two messages, the automatic test of the wake-up function of the real-time clock module is realized under the condition of saving labor cost, and the test result is more accurate.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an implementation flow of a method for testing a wake-up function of a real-time clock module according to an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating an implementation flow of another method for testing a wake-up function of a real-time clock module according to an embodiment of the present application;
fig. 3 is a schematic time axis diagram of a device under test and a testing device in a testing process in the method for testing a wake-up function of a real-time clock module according to the embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of an apparatus for testing a wake-up function of a real-time clock module according to an embodiment of the present disclosure;
fig. 5 is a block diagram illustrating a structure of another apparatus for testing a wake-up function of a real-time clock module according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a device under test provided by an embodiment of the present application;
fig. 7 is a schematic diagram of a test apparatus provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution of the present application, the following description will be given by way of specific examples.
Example one
Referring to fig. 1, a method for testing a wake-up function of a real-time clock module according to an embodiment of the present application is described below, where the method for testing the wake-up function of the real-time clock module according to the embodiment of the present application is applied to a device under test, and the method includes:
in step 101, setting a target wake-up mode of the device under test to determine a wake-up time and a pseudo-sleep duration of the device under test;
in the embodiment of the present application, since the wake-up function of the real-time clock RTC module of the device under test is tested, a target wake-up mode for each test needs to be preset by a user or a system of the device under test. Specifically, the user may select a wake-up mode to be tested as a target wake-up mode from fixed-delay wake-up, integral-time wake-up, random-delay wake-up, and hybrid wake-up. After the target wake-up mode is selected, the device to be tested determines the wake-up time and the pseudo-sleep time based on the target wake-up mode.
In step 102, sending a sleep message to the testing device, and triggering the tested device to enter a sleep state;
in this embodiment of the present application, after determining the quasi-dormancy duration, the device under test generates a dormancy packet based on the quasi-dormancy duration, and specifically, the dormancy packet carries a packet type identifier in addition to the quasi-dormancy duration. The example of the structure of the sleep packet using the C language is as follows:
Figure BDA0001938617200000061
Figure BDA0001938617200000071
the type is a message type identifier, and when the type is "S" (meaning "sleep"), the type is used to identify that the message is a dormant message. The sleep _ time is a pseudo sleep time.
Specifically, the test equipment is also provided with an RTC module, and the time precision of the test equipment meets the requirement of RTC awakening accuracy test.
And triggering the tested equipment to enter a dormant state after sending the dormant message to the testing equipment. The device under test will not run any instructions in the sleep state.
In step 103, when the device under test is awakened from the sleep state, sending an awakening message to the test device, so that the test device obtains a test result of the current round based on the sleep message and the awakening message;
in this embodiment, when the device under test is awakened from the sleep state by the RTC awakening source, an awakening message is sent to the device under test, where the awakening message carries a message type identifier and a pseudo-sleep duration, and the length of the awakening message is equal to that of the sleep message. In fact, in a round of test, the sleep message and the wake-up message differ only in the type identifier of the message they carry. When the type (i.e. the packet type identifier) is "W" (meaning "Wake"), it is used to identify the present packet as a Wake-up packet. Because a certain time is required for the message to be transmitted to the testing device, that is, a certain time delay is generated when the message is transmitted from the tested device to the testing device. When the time delays generated in the transmission process of the sleep packet and the transmission process of the wake-up packet are equal, the time error caused by the transmission loss can be theoretically avoided, so that the lengths of the wake-up packet and the sleep packet are required to be equal.
In step 104, after waiting for a preset duration, detecting whether a preset number of test rounds or test time is reached, if yes, executing step 105, and if not, returning to execute step 101 and subsequent steps.
In the embodiment of the present application, after waiting for a preset duration, whether the preset number of test rounds or the preset test time is reached is detected, and when the preset number of test rounds or the preset test time is reached,ending the test, and returning to execute the step 101 and the subsequent steps when the preset number of test rounds or the test time is not reached, namely starting a new round of test; or, whether a preset number of test rounds or test time is reached is detected, if the preset number of test rounds or test time is reached, the test is directly ended, and if the preset number of test rounds or test time is not reached, the preset duration is waited, and then the step 101 and the subsequent steps are executed again, that is, a new round of test is started. That is, the execution sequence of the waiting preset time and the detection whether reaching the preset number of testing rounds or the testing time is not fixed. Specifically, the preset number of test rounds or the preset test time is set by a user. Before the test of this time is started, the test ending condition selection box may be output, and the user may select the test ending condition according to the number of test rounds or the test ending condition according to the test time, which is not limited herein. Specifically, the preset waiting time is for sufficiently restoring the system of the device under test to the working state, and a value of the preset waiting time may be preset by a user according to an actual situation, for example, the preset waiting time may be set to 3 seconds. In fact, after the device under test finishes a test round and is awakened from the sleep state, if the sleep function is called immediately to enter the next test round, the sleep function is likely to fail to be called, that is, the system of the device under test generally requires that at least one minimum interval duration is waited between two consecutive calls of the sleep function, the minimum interval duration is different in different systems, and the typical value is 3 seconds. Therefore, after one round of test, the next round of test operation can be executed after waiting for the preset time, that is, after being awakened by the test equipment, the next round of test operation needs to wait for at least the preset time TwThe hibernate function may be invoked again to hibernate.
In step 105, the test ends.
Optionally, the step 101 specifically includes:
a1, receiving an input awakening mode selection instruction;
a2, based on the awakening mode selection instruction, determining a target awakening mode in more than two preset awakening modes;
in this embodiment of the application, a user may input an awakening mode selection instruction to a device to be tested before a test starts, so that the device to be tested determines a target awakening mode in more than two preset awakening modes based on the awakening mode selection instruction. Specifically, the two or more wake-up manners include, but are not limited to: fixed delay awakening, integral point awakening, random delay awakening and mixed awakening. Specifically, the description of the above several different wake-up modes is as follows:
the fixed-delay wake-up refers to waking up the device immediately after waiting for a fixed delay duration (e.g., 1 minute or 1 hour) from the current time when the sleep is initiated. When the wake-up mode is selected, the specific value of the fixed delay time is set by the user, and the specific value is not limited here.
The above-mentioned wake-up at one time refers to wake-up of the device at the next wake-up at one time from the current time when the hibernation is initiated. For example, if the current time to initiate hibernation is 09:05:50, the device is woken up at time 10:00: 00.
The random delay wake-up refers to waking up the device immediately after waiting for a random delay duration (e.g., any random number in a range of 1 to 3600 seconds) from the current time when the sleep is initiated. The range of the random number can be set according to the application characteristics of the equipment and the requirement of the test progress. When the method is selected, a value interval of the random number (i.e., a minimum value and a maximum value that can be taken by the random number) is set by a user, and then the device generates a random delay time length value in the value interval by using a random number generation function. The value interval of the random number is manually set, so that the flexibility of testing can be improved. Specifically, if the selected wake-up mode is random delay wake-up (or hybrid wake-up), before the test, a prompt box, for example, "please input a value interval (unit: second) of the random number", is output, and then two integers, such as 1, 100, 10, 600, input by the user are received, and the value intervals of the random number are respectively identified to be 1-100 seconds and 10-600 seconds. And when the random time delay is called to wake up to generate the pseudo-sleep time length, generating a random number in the value interval as the pseudo-sleep time length.
And hybrid awakening refers to awakening by randomly selecting one mode from fixed delay awakening, integral point awakening and random delay awakening. When the mode is selected, the specific value of the fixed delay time length of the fixed delay awakening and the value interval of the random delay are preset by a user, and before each test round starts, the awakening mode adopted by the test round needs to be determined, namely, if the user selects the test to adopt the mixed awakening, one mode of the fixed delay awakening, the integral awakening and the random delay awakening is randomly selected to be awakened before each test round starts.
Optionally, the target wake-up mode may be reselected by the user at the beginning of each round of testing; or, the user may select the target wake-up mode only during the first round of testing, and each subsequent round of testing is set based on the target wake-up mode selected by the first round of testing; under the condition that a user only sets the first round of test, in the multi-round test carried out by one test, if the first round of test of the user selects fixed delay awakening, integral point awakening or random delay awakening, the awakening mode of each round is not changed; if the user selects the hybrid wake-up, each round of wake-up pattern is a random selection of the device under test, i.e. each round of wake-up pattern may change automatically.
Optionally, in order to improve the testing efficiency and reduce manual work, the parameters set manually once are continuously applied to each round of testing of one testing until the testing is completed. After completion, different parameters can be set again and the next multiple testing can be performed. Specifically, the basic library functions of the development tool all have a random number generation function, for example, a random number generation function rand () in C language may be used to generate a random number in a random delay wake-up mode as the pseudo sleep duration. As a specific example, if random numbers between 10 and 600 are to be generated, the C language code is as follows:
int i;
srand((unsigned)time(NULL));
i=rand();
i=10+i%(600-10+1);
in the above code, srand (NULL) is used to set a random number seed to generate a random effect; the i ═ rand () is used to generate a random number i; the above-mentioned i ═ 10+ i% (600 to 10+1) is used to make the generated random number i satisfy a specified value range.
A3, setting the awakening time and the pseudo-sleeping time of the tested device according to the target awakening mode.
Optionally, the pseudo sleep duration carried in the sleep message and the wake-up message may be recorded as Ts. According to the different awakening modes, the pseudo-sleep duration TsThe calculation method of (a) is also different, specifically:
for fixed-latency wakeup, TsEqual to the set fixed delay time; for random delayed wakeup, TsEqual to the newly generated random delay duration; for an integer wake, TsEqual to the difference between the next clock value at the integral point and the current clock value; for the hybrid wake-up, T is the wake-up mode of the current round of test, which is selected from the fixed delay wake-up, the random delay wake-up and the integer wake-upsAfter the mixed awakening is carried out to determine the awakening mode adopted by the current round, T is calculated based on the determined awakening modesThe value of (a).
Optionally, before the sending the sleep packet to the test device, the method further includes:
b1, acquiring the communication mode between the tested device and the testing device;
b2, in the device under test, opening a communication port related to the communication method so that the device under test sends a message to the test device through the communication port.
In the embodiment of the present application, the communication modes include but are not limited to serial communication, USB communication, and ethernet communication. Based on the communication mode between the tested device and the testing device, different communication ports are selected to transmit the sleep message and the wake-up message generated in the testing process. Specifically, if the serial communication is performed, a communication port related to the serial communication is opened in the device to be tested, so that the device to be tested and the testing device perform communication by adopting the same baud rate and the same communication format (data bit number, stop bit number, character check mode); if the communication is USB communication, a communication port related to the serial port communication is opened in the tested device, so that the tested device and one device in the testing device adopt a device mode, and the other device adopts a host mode and adopts the same bus rate and the same transmission protocol for communication; if the communication is ethernet communication, the device under test and the test device communicate using a Transmission Control Protocol (TCP) and a client/server mode, specifically, the device under test serves as a client, a destination IP address in a communication port opening function of the client is an IP address of the test device, a destination port number is a TCP port number of the test device, correspondingly, the test device serves as a server, an opposite-end IP address in the communication port opening function of the test device is to fill a value indicating an arbitrary IP address, and a service port number is to fill a TCP port number of the test device.
Therefore, in the embodiment of the application, the tested device only needs to send the sleep message and the wake-up message to the testing device during each round of testing, and the testing device automatically calculates the testing result of each round of testing through the sleep message and the wake-up message.
Example two
Referring to fig. 2, a method for testing a wake-up function of a real-time clock module according to an embodiment of the present application is described below, where the method for testing the wake-up function of the real-time clock module according to the embodiment of the present application is applied to a device under test, and the method includes:
in step 201, when a first message sent by a device under test is received, the first message is analyzed, and the type of the first message is determined based on a message type identifier carried in the first message;
in this embodiment, since the type of the first packet is not clear, the first packet needs to be analyzed first, and the type of the first packet needs to be determined based on the packet type identifier carried in the first packet. Specifically, if it is determined that the packet type identifier carried in the first packet is equal to a preset dormant packet identifier, for example, "S", it represents that the first packet is a dormant packet; on the contrary, if it is determined that the packet type identifier carried in the first packet is equal to the preset wakeup packet identifier, for example, "W", it represents that the first packet is a wakeup packet.
In step 202, if the first message is a sleep message, recording a time of receiving the first message as a first time, and acquiring a pseudo-sleep duration carried in the first message;
in this embodiment of the present application, when it is determined that the first packet is a sleep packet, the test device records a time when the first packet is received as a first time. Specifically, the first time may be recorded in a database or other storage area, which is not limited herein. Further, a pseudo-sleep duration carried in the first message may be obtained, where the pseudo-sleep duration is an expected sleep duration of the device under test in the current test process.
In step 203, after receiving the first message, if a second message sent by the device under test is received, analyzing the second message, and determining the type of the second message based on a message type identifier carried in the second message;
in the embodiment of the present application, after receiving the first message, if the test device receives the message again, the message received again is recorded as the second message. Similarly to step 201, if it is determined that the packet type identifier carried in the second packet is equal to a preset dormant packet identifier, for example, "S", it represents that the second packet is a dormant packet; on the contrary, if it is determined that the packet type identifier carried in the first packet is equal to the preset wakeup packet identifier, for example, "W", it represents that the second packet is a wakeup packet.
In step 204, if the second message is a wakeup message, recording a time of receiving the second message as a second time;
in this embodiment of the application, when it is determined that the second packet is a wakeup packet, the test device records a time when the second packet is received as a second time. Specifically, the second time may be recorded in a database or other storage area together with the first time in step 202 as a timing time of the same test round, which is not limited herein.
In step 205, a test result of the current round is calculated based on the first time, the second time and the pseudo-sleep time;
in this embodiment of the present application, when the first packet is a sleep packet, the first packet is sent by the device under test before the sleep; when the second message is a wake-up message, the second message is sent by the tested device after being awakened; therefore, the first time may be an actual sleep time of the device under test, the second time may be an actual wake-up time of the device under test, and a difference between the first time and the second time may be an actual sleep time of the device under test. And then calculating the error between the time dormancy time and the quasi dormancy time to obtain the accuracy of the awakening function of the RTC module, namely obtaining the test result of the current round. Specifically, the accuracy of the RTC module wake-up function can be obtained by the following formula: accuracy ═ 1- | (T)2-T1)-Ts|/Ts]100%. Wherein, T2At a second time, T1At a first time, TsTo simulate sleep duration, | (T)2-T1)-Ts|/TsThe relative error between the actual sleeping time duration and the expected sleeping time duration (namely the simulated sleeping time duration) in a round of test process (namely the process from entering the sleeping state to being awakened by the tested equipment) is represented, and the accuracy of the RTC module awakening function in the round can be obtained by subtracting the relative error from 1.
In step 206, it is detected whether a preset number of test rounds or test time is reached, if yes, step 207 is executed, and if not, step 201 and the subsequent steps are executed again.
In this embodiment of the present application, before the test device enters the message receiving state, the test device may output a test end condition selection box, and the user may select the test end condition according to the number of test rounds or the test end condition according to the test time, which is not limited herein. After the user selects the test condition, the test equipment receives a test ending condition selection instruction input by the user, sets the test discussion or the test time, and simultaneously sends the test ending condition selection instruction to the tested equipment to inform the tested equipment of the condition for ending the test; or, after receiving the test ending condition selection instruction, the test device may not inform the test device, and when the current test reaches a preset test discussion or test time, the test device may send a test ending instruction to the device to be tested to trigger the device to be tested to end the test, which is not limited herein. Optionally, if the user selects the number of test rounds as a test end condition, defining a variable of the number of test rounds, assigning an initial value of the variable of the number of test rounds as 0, adding 1 to the variable of the number of test rounds after each round of test is ended, and detecting whether the number of test rounds reaches a preset number of test rounds after each round of test is ended; if the user selects the test time as the test ending condition, defining a test time variable, assigning an initial value of the test time variable as a current clock value when the test is started, reading the current clock value again after each round of test is ended, subtracting the test time variable from the read current clock value again to obtain the test time length of the test, and detecting whether the test time length reaches the preset test time. Through the process, the automatic stop of the test can be realized, and the situation that whether the test is finished or not is determined by adopting a manual counting mode is avoided.
In step 207, the test ends.
Optionally, the method further includes:
c1, acquiring the communication mode between the test equipment and the tested equipment;
c2, opening the communication port related to the communication mode in the test equipment;
and C3, receiving the message sent by the device under test through the communication port.
In the embodiment of the present application, the communication modes include but are not limited to serial communication, USB communication, and ethernet communication. Based on the communication mode between the tested device and the testing device, different communication ports are selected to transmit the sleep message and the wake-up message generated in the testing process. Specifically, if the serial communication is performed, a communication port related to the serial communication is opened in the test device, so that the test device and the tested device perform communication by using the same baud rate and the same communication format (data bit number, stop bit number, character check mode); if the communication is USB communication, a communication port related to the serial port communication is opened in the test equipment, so that the test equipment and one of the tested equipment adopt an equipment mode, and the other equipment adopts a host mode and adopts the same bus rate and the same transmission protocol for communication; if the communication is ethernet communication, the testing device and the tested device communicate by adopting a TCP protocol and a client/server mode, specifically, the testing device is used as a server, the IP address of the opposite end in the communication port opening function should fill a value indicating an arbitrary IP address, the port number of the service end should fill the TCP port number of the testing device, correspondingly, the tested device is used as a client, the destination IP address in the communication port opening function should be the IP address of the testing device, and the destination port number should be the TCP port number of the testing device. After the relevant communication port of the testing device is opened, the message sent by the tested device can be received through the communication port. Specifically, the communication port may be monitored to obtain the message sent by the device under test in time.
Optionally, the method further includes:
d1, in the process that the testing equipment waits for receiving the message sent by the tested equipment, acquiring the receiving waiting time of the testing equipment in real time, wherein the message comprises a first message and a second message;
and D2, if the receiving waiting time length exceeds the preset receiving waiting time length threshold value, outputting a receiving overtime message.
In this embodiment of the present application, the receiving waiting duration threshold is related to a packet type of a packet currently waiting to be received by the testing device. Specifically, in an application scenario, if the device under test waits for receiving a wake-up packet (i.e., a second packet), the receiving wait duration is actually a receiving timeout duration of the wake-up packet, and the receiving wait duration threshold may be set based on a pseudo-sleep duration, which is usually greater than the pseudo-sleep duration, for example, the receiving wait duration threshold may be set to be twice the pseudo-sleep duration. In fact, under normal conditions, if the test device sleeps for 100 seconds in this round, the test device may receive the wake-up message after 100 seconds of sending the sleep message. However, in practical applications, the wake-up process is the most error-prone process, and errors such as that the wake-up cannot be performed all the time, and the actual wake-up time is slower than the designated wake-up time may occur, so that the receiving waiting time threshold of the wake-up packet may be set to 2 × 100 seconds, which is twice as long as the receiving waiting time, so that the test device may still receive the wake-up packet even if a non-significant wake-up error occurs in the device under test. It should be noted that, in view of the test efficiency, the above-mentioned receiving wait time threshold is not set to an infinite value, i.e. is not set to an infinite wait wakeup packet here. Specifically, when the timing time exceeds the receiving waiting time threshold, if the second message sent by the device under test is not received yet, it is determined that an error occurs in the wake-up process of the device under test, and at this time, a receiving timeout message may be output, for example, "no wake-up message is received" is output, and the test of this round is ended.
In another application scenario, if the device under test waits for receiving a sleep packet (i.e., a first packet), the receiving waiting time is a receiving timeout time of the sleep packet, and the receiving waiting time threshold may be set based on a waiting time after the device under test completes one round of testing. Assuming that the device under test completes a round of testingLater (i.e. after waking up from sleep state), it is necessary to wait for TwSecond to enter the next round of testing (i.e. wait for T)wSecond to enter the sleep state again), the above-mentioned receiving wait duration threshold may be set to Tw+3 seconds, of course, the user can set the T of the tested device by himselfwThe value of (b) is not limited herein. Because the device under test generally requires to wait for a minimum interval duration for two consecutive calls to the sleep function, the device under test will wait for T after receiving the wake-up messagewThe test equipment enters the sleep again after the second, and for the sake of more insurance, the receiving waiting time threshold of the sleep message of the test equipment is set as Tw+3 seconds, an additional timeout of 3 seconds is added to avoid false positive reception timeout errors. Of course, the receiving waiting time period threshold may be set to Tw+5 seconds or Tw+10 seconds, without limitation. Specifically, if the reception waiting time length exceeds the reception waiting time length threshold value, and the first message sent by the device under test is still not received, it is determined that an error occurs in the sleep process of the device under test, and at this time, a reception timeout message may be output, for example, "no sleep message is received" may be output, and the current round of test is ended.
Therefore, in the embodiment of the application, the tested device only needs to send the sleep message and the wake-up message to the testing device during each round of testing, and the testing device automatically calculates the testing result of each round of testing through the sleep message and the wake-up message.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It should be noted that, in the second embodiment, the method applied to the test device should be started to operate first, so that the test device enters a message reception waiting state; then, the method applied to the tested device in the first embodiment is started and operated; after the test equipment receives the first message sent by the tested equipment, the tested equipment and the test equipment can enter a synchronous state, and the simultaneous operation of the two methods can be ensured. Therefore, the test equipment is started preferentially, so that the message sent by the tested equipment is not lost, and the test result can be prevented from being influenced.
To better explain the technical solution provided by the embodiment of the present application, a method for testing the wake-up function of the real-time clock module is described below by using a time axis of a device under test and a test device during a test process, please refer to fig. 3:
f1, setting a wake-up mode on the tested equipment; setting a circulation mode on the test equipment, namely selecting an end condition;
f2, respectively opening corresponding communication ports by the testing equipment and the tested equipment according to the communication modes;
f3, starting the first round of test, and waiting for receiving the sleep message by the test equipment; the device to be tested enters a dormant state after sending the dormant message; the test equipment receives the dormancy message and records the current time T1Then, waiting for receiving the awakening message;
f4, when the awakening time is reached, the tested equipment is awakened and sends an awakening message to the testing equipment; the tested equipment receives the awakening message and records the current time T2Waiting for receiving a dormancy message sent by the next round of tested equipment;
f5, after the device to be tested is awakened, waiting for the preset time TwAnd starting the second round of test, wherein the process is similar to that of F3 and F4, and after a plurality of rounds of test, the test reaches the selected end condition and the test is ended.
In order to better explain the technical scheme provided by the embodiment of the application, specific test result examples are given below:
Figure BDA0001938617200000171
TABLE 1
Table 1 shows a wake-up mode (random number range is 10 to 600) of wake-up at random delay, and the end condition is a partial test flow record under 1000 test rounds;
of course, based on the results of multiple testing rounds under one test, selectable indexes such as average accuracy, average error rate, mean square error and the like of the test can be counted. For example:
number of actual test rounds 2000
Minimum accuracy 95
Maximum accuracy 100
Average accuracy 98.8
Whether the situation that the dormant message is not received occurs Whether or not
Whether the condition that the awakening message is not received occurs Whether or not
Conclusion of the test By passing
TABLE 2
Table 2 shows statistics of some selectable indicators of test results under a random delay wake-up mode (random number range is 10 to 600) and an end condition of 2000 test rounds; because the trusted test equipment and test environment are ensured to be adopted, if the message is not received, serious system faults such as incapability of waking up or crash and the like usually indicate to the tested equipment.
EXAMPLE III
An embodiment of the present invention provides a device for testing a wake-up function of a real-time clock module, which is applied to a device to be tested, and as shown in fig. 4, the device 400 for testing a wake-up function of a real-time clock module in an embodiment of the present invention includes:
a setting unit 401, configured to set a target wake-up mode of the device under test, so as to determine a wake-up time and a pseudo-sleep duration of the device under test;
a first sending unit 402, configured to send a sleep packet to a testing device, and trigger the tested device to enter a sleep state, where the sleep packet carries a packet type identifier and a pseudo-sleep duration calculated by the calculating unit;
a second sending unit 403, configured to send a wake-up packet to the test device when the device under test is awakened from the sleep state, so that the test device obtains a test result of the current round based on the sleep packet and the wake-up packet, where the wake-up packet carries a packet type identifier and a pseudo-sleep duration;
the setting unit 401 is triggered again after waiting for a preset duration until reaching a preset number of test rounds or a preset test time.
Alternatively, the setting unit 401 includes:
a selection instruction receiving subunit, configured to receive an input wake mode selection instruction;
a target wake-up mode determining subunit, configured to determine a target wake-up mode among two or more preset wake-up modes based on the wake-up mode selection instruction;
and the awakening parameter setting subunit is used for setting the awakening time and the pseudo-sleeping time of the tested equipment according to the target awakening mode.
Optionally, the apparatus 400 further includes:
a communication mode acquiring unit for acquiring a communication mode between the device under test and the test device;
a communication port opening unit, configured to open, in the device under test, a communication port related to the communication method, so that the device under test sends a message to the test device through the communication port.
Therefore, in the embodiment of the application, the tested device only needs to send the sleep message and the wake-up message to the testing device during each round of testing, and the testing device automatically calculates the testing result of each round of testing through the sleep message and the wake-up message.
Example four
An embodiment of the present invention provides a device for testing a wake-up function of a real-time clock module, which is applied to a test device, and as shown in fig. 5, the device 500 for testing a wake-up function of a real-time clock module in an embodiment of the present invention includes:
a first parsing unit 501, configured to parse a first message sent by a device under test when the first message is received, and determine a type of the first message based on a message type identifier carried in the first message;
a first recording unit 502, configured to record, as a first time, a time when the first packet is received if the first parsing unit determines that the first packet is a dormant packet, and acquire a quasi-dormant duration carried in the first packet;
a second parsing unit 503, configured to, after receiving the first message, if a second message sent by the device under test is received, parse the second message, and determine a type of the second message based on a message type identifier carried in the second message;
a second recording unit 504, configured to record, as a second time, a time when the second packet is received if the second parsing unit determines that the second packet is a wakeup packet;
a result calculating unit 505, configured to calculate a test result of the current round based on the first time recorded by the first unit, the second time recorded by the second unit, and the pseudo-sleep duration;
the first parsing unit 501 is triggered again after the result calculating unit 505 completes execution until a preset number of test rounds or test time is reached.
Optionally, the apparatus 500 further includes:
a communication mode acquiring unit for acquiring a communication mode between the test device and the device under test;
a communication port opening unit for opening a communication port related to the communication mode in the test device;
and the message receiving unit is used for receiving the message sent by the tested equipment through the communication port.
Optionally, the apparatus 500 further includes:
a receiving waiting duration obtaining unit, configured to obtain a receiving waiting duration of the testing device in real time in a process that the testing device waits for receiving a message sent by a device to be tested, where the message includes a first message and a second message;
and the overtime message output unit is used for outputting the receiving overtime message if the receiving waiting time exceeds a preset receiving waiting time threshold.
Therefore, in the embodiment of the application, the tested device only needs to send the sleep message and the wake-up message to the testing device during each round of testing, and the testing device automatically calculates the testing result of each round of testing through the sleep message and the wake-up message.
EXAMPLE five
Referring to fig. 6, a device under test according to an embodiment of the present invention includes: a memory 601, one or more processors 602 (only one shown in fig. 6), and computer programs stored on the memory 601 and executable on the processors. Wherein: the memory 601 is used for storing software programs and modules, and the processor 602 executes various functional applications and data processing by running the software programs and units stored in the memory 601, so as to acquire resources corresponding to the preset events. Specifically, the processor 602 implements the following steps by running the above-mentioned computer program stored in the memory 601:
setting a target awakening mode of the tested equipment to determine the awakening time and the pseudo-sleeping time of the tested equipment;
sending a sleep message to a test device and triggering the tested device to enter a sleep state, wherein the sleep message carries a message type identifier and a pseudo-sleep duration;
when the tested device is awakened from the dormant state, sending an awakening message to the testing device so that the testing device obtains a testing result of the current round based on the dormant message and the awakening message, wherein the awakening message carries a message type identifier and a pseudo dormant duration;
and after waiting for a preset time, repeatedly executing the step of setting the target awakening mode of the tested equipment to determine the awakening time and the pseudo-dormancy time of the tested equipment and the subsequent steps until reaching the preset number of test rounds or test time.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the setting a target wake-up manner of the device under test for determining a wake-up time and a pseudo-sleep time of the device under test includes:
receiving an input awakening mode selection instruction;
determining a target awakening mode in more than two preset awakening modes based on the awakening mode selection instruction;
and setting the awakening time and the pseudo-dormancy duration of the tested equipment according to the target awakening mode.
In a third possible implementation manner provided on the basis of the first possible implementation manner, the processor 602 implements the following steps by running the above computer program stored in the memory 601:
acquiring a communication mode between the tested equipment and the testing equipment;
in the device under test, a communication port related to the communication mode is opened, so that the device under test sends a message to the test device through the communication port.
Further, as shown in fig. 6, the device under test may further include: one or more input devices 603 (only one shown in fig. 6) and one or more output devices 604 (only one shown in fig. 6). The memory 601, processor 602, input device 603, and output device 604 are connected by a bus 605.
It should be understood that in the present embodiment, the Processor 602 may be a Central Processing Unit (CPU), and the Processor may be other general 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 the processor may be any conventional processor or the like.
The input device 603 may include a keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 604 may include a display, a speaker, etc.
Memory 601 may include both read-only memory and random-access memory, and provides instructions and data to processor 602. Some or all of memory 601 may also include non-volatile random access memory. For example, the memory 601 may also store device type information.
Therefore, through the embodiment of the application, the tested equipment only needs to send the dormancy message and the awakening message to the testing equipment during each round of testing, the testing equipment automatically calculates the testing result of each round of testing through the dormancy message and the awakening message, the user does not need to manually time, compare and calculate in the process, and the labor cost is greatly saved on the premise of improving the accuracy of the testing result.
EXAMPLE six
Referring to fig. 7, the test apparatus according to an embodiment of the present invention includes: a memory 701, one or more processors 702 (only one shown in fig. 4) and a computer program stored on the memory 701 and executable on the processors. Wherein: the memory 701 is used for storing software programs and modules, and the processor 702 executes various functional applications and data processing by running the software programs and units stored in the memory 701, so as to acquire resources corresponding to the preset events. Specifically, the processor 702 realizes the following steps by running the above-mentioned computer program stored in the memory 701:
when a first message sent by a tested device is received, analyzing the first message, and determining the type of the first message based on a message type identifier carried in the first message;
if the first message is a dormancy message, recording the time of receiving the first message as first time, and acquiring the quasi-dormancy duration carried in the first message;
after receiving the first message, if a second message sent by the tested device is received, analyzing the second message, and determining the type of the second message based on a message type identifier carried in the second message;
if the second message is a wake-up message, recording the time of receiving the second message as second time;
calculating to obtain a test result of the current round based on the first time, the second time and the pseudo-dormancy duration;
and repeatedly executing the step of analyzing the first message when the first message sent by the tested device is received, and determining the type of the first message based on the message type identifier carried in the first message and the subsequent steps until the preset number of testing rounds or the testing time is reached.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the processor 702 further implements the following steps when executing the above computer program stored in the memory 701:
acquiring a communication mode between the test equipment and the tested equipment;
in the test equipment, opening a communication port related to the communication mode;
and receiving the message sent by the tested equipment through the communication port.
In a third possible implementation manner provided on the basis of the first possible implementation manner, the processor 702 further implements the following steps when executing the computer program stored in the memory 701:
the method comprises the steps that in the process that the test equipment waits for receiving a message sent by tested equipment, the receiving waiting time of the test equipment is obtained in real time, wherein the message comprises a first message and a second message;
and if the receiving waiting time exceeds a preset receiving waiting time threshold, outputting a receiving overtime message.
Further, as shown in fig. 7, the test apparatus may further include: one or more input devices 703 (only one shown in fig. 7) and one or more output devices 704 (only one shown in fig. 7). The memory 701, processor 702, input device 703 and output device 704 are connected by a bus 705.
It should be understood that in the present embodiment, the Processor 702 may be a Central Processing Unit (CPU), and the Processor may be other general 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 the processor may be any conventional processor or the like.
The input device 703 may include a keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 704 may include a display, a speaker, etc.
Memory 701 may include both read-only memory and random access memory and provides instructions and data to processor 702. Some or all of memory 701 may also include non-volatile random access memory. For example, memory 701 may also store information of device types.
Therefore, through the embodiment of the application, the tested equipment only needs to send the dormancy message and the awakening message to the testing equipment during each round of testing, the testing equipment automatically calculates the testing result of each round of testing through the dormancy message and the awakening message, the user does not need to manually time, compare and calculate in the process, and the labor cost is greatly saved on the premise of improving the accuracy of the testing result.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium and can implement the steps of the embodiments of the method when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium described above may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media excludes electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for testing the wake-up function of a real-time clock module is applied to a device to be tested, and comprises the following steps:
setting a target awakening mode of the tested equipment to determine the awakening time and the pseudo-sleep duration of the tested equipment;
sending a sleep message to a test device and triggering the tested device to enter a sleep state, wherein the sleep message carries a message type identifier and a pseudo-sleep duration;
when the tested equipment is awakened from the dormant state, sending an awakening message to the testing equipment so that the testing equipment obtains a testing result of the current round based on the dormant message and the awakening message, wherein the awakening message carries a message type identifier and a pseudo-dormant duration, and the length of the awakening message is equal to that of the dormant message;
and after waiting for a preset time, repeatedly executing the step of setting the target awakening mode of the tested equipment, and determining the awakening time and the pseudo-dormancy time of the tested equipment and the subsequent steps until reaching the preset number of test rounds or test time.
2. The method of claim 1, wherein the setting of the target wake-up mode of the device under test for determining the wake-up time and the pseudo-sleep duration of the device under test comprises:
receiving an input awakening mode selection instruction;
determining a target awakening mode in more than two preset awakening modes based on the awakening mode selection instruction;
and setting the awakening time and the pseudo-sleep duration of the tested equipment according to the target awakening mode.
3. The method of claim 1, wherein the method further comprises:
acquiring a communication mode between the tested equipment and the testing equipment;
and in the tested equipment, opening a communication port related to the communication mode so that the tested equipment sends a message to the testing equipment through the communication port.
4. A method for testing the wake-up function of a real-time clock module is applied to test equipment and comprises the following steps:
when a first message sent by a tested device is received, analyzing the first message, and determining the type of the first message based on a message type identifier carried in the first message;
if the first message is a dormancy message, recording the time of receiving the first message as first time, and acquiring the quasi-dormancy duration carried in the first message;
after receiving the first message, if a second message sent by the tested device is received, analyzing the second message, and determining the type of the second message based on a message type identifier carried in the second message;
if the second message is a wake-up message, recording the time of receiving the second message as second time, wherein the length of the wake-up message is equal to that of the dormant message;
calculating to obtain a test result of the current round based on the first time, the second time and the quasi-dormancy duration;
and repeatedly executing the step of analyzing the first message when the first message sent by the tested device is received, and determining the type of the first message based on the message type identifier carried in the first message and the subsequent steps until the preset number of testing rounds or the testing time is reached.
5. The method of claim 4, wherein the method further comprises:
acquiring a communication mode between the test equipment and the tested equipment;
in the test equipment, opening a communication port related to the communication mode;
and receiving the message sent by the tested equipment through the communication port.
6. The method of claim 4, wherein the method further comprises:
the method comprises the steps that in the process that the test equipment waits for receiving a message sent by tested equipment, the receiving waiting time of the test equipment is obtained in real time, wherein the message comprises a first message and a second message;
and if the receiving waiting time exceeds a preset receiving waiting time threshold, outputting a receiving overtime message.
7. A device under test comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 3 are implemented when the computer program is executed by the processor.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
9. A test apparatus comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 4 to 6 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 4 to 6.
CN201910014718.9A 2019-01-08 2019-01-08 Method and device for testing wake-up function of real-time clock module and electronic equipment Active CN109921915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910014718.9A CN109921915B (en) 2019-01-08 2019-01-08 Method and device for testing wake-up function of real-time clock module and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910014718.9A CN109921915B (en) 2019-01-08 2019-01-08 Method and device for testing wake-up function of real-time clock module and electronic equipment

Publications (2)

Publication Number Publication Date
CN109921915A CN109921915A (en) 2019-06-21
CN109921915B true CN109921915B (en) 2021-04-23

Family

ID=66960181

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910014718.9A Active CN109921915B (en) 2019-01-08 2019-01-08 Method and device for testing wake-up function of real-time clock module and electronic equipment

Country Status (1)

Country Link
CN (1) CN109921915B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333766B (en) * 2020-11-13 2022-02-11 北京美斯顿科技开发有限公司 Wireless communication method, system, terminal communication equipment and electronic equipment
CN113207148B (en) * 2021-03-19 2023-09-01 深圳市有方科技股份有限公司 Data transmission method, device, communication equipment and storage medium
CN113391936A (en) * 2021-06-15 2021-09-14 西安联乘智能科技有限公司 Reliability test method and system for vehicle-mounted intelligent antenna equipment
CN113965484A (en) * 2021-10-21 2022-01-21 奇瑞商用车(安徽)有限公司 Test method and system for automobile bus dormancy awakening rack
CN113965483B (en) * 2021-10-21 2023-10-31 奇瑞商用车(安徽)有限公司 AUTOSAR network management pre-dormancy to dormancy time testing device and method
CN113992555A (en) * 2021-10-27 2022-01-28 奇瑞商用车(安徽)有限公司 Automatic testing method and system for main node network
CN114124767A (en) * 2021-11-29 2022-03-01 奇瑞商用车(安徽)有限公司 Automatic testing method and device for gateway network management strategy

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662777B (en) * 2009-09-11 2012-01-11 北京交通大学 Wireless sensor network distributed hibernation method based on probability statistics
CN102023912B (en) * 2009-09-11 2013-11-20 鸿富锦精密工业(深圳)有限公司 Dormancy wake-up testing system and method
WO2011093901A1 (en) * 2010-02-01 2011-08-04 Hewlett-Packard Development Company, L.P. Deep sleep mode management for a network switch
CN105302726A (en) * 2015-11-13 2016-02-03 浪潮电子信息产业股份有限公司 Test method and device

Also Published As

Publication number Publication date
CN109921915A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN109921915B (en) Method and device for testing wake-up function of real-time clock module and electronic equipment
CN111181801B (en) Node cluster testing method and device, electronic equipment and storage medium
JP5364776B2 (en) Technology for merging multiple log entries
CN108092854B (en) Test method and device for train-level Ethernet equipment based on IEC61375 protocol
US9218259B2 (en) Computing device and method for testing SOL function of a motherboard of the computing device
CN107070940B (en) Method and device for judging malicious login IP address from streaming login log
CN112256542B (en) eBPF-based micro-service system performance detection method, device and system
WO2017084523A1 (en) Method and device for system on chip bus activity detection and computer storage medium
US20180101631A1 (en) Methods, systems, and computer readable media for obtaining power consumption data associated with packet processing
CN108197002B (en) Mobile device non-buried point data statistical method, system, terminal and medium
CN114328122A (en) IO full life cycle time delay monitoring method and related device
CN113965904A (en) Device registration method, device and storage medium
CN111210817B (en) Data processing method and device
CN115658446A (en) WDT simulation verification method, device, equipment and medium
CN111556535B (en) Communication method, communication device, electronic equipment and storage medium
CN110413461B (en) System and method for measuring transmission delay between accelerator card and host and accelerator card
CN115221071A (en) Chip verification method and device, electronic equipment and storage medium
US20120240128A1 (en) Memory Access Performance Diagnosis
CN113593549A (en) Method and device for determining awakening rate of voice equipment
CN109471663B (en) Method and device for executing single chip microcomputer program
CN115599722B (en) Method and device for realizing accurate transmission of serial port data based on kernel of operating system
CN114124334B (en) Processing method, client, equipment and medium of air interface data packet
TWI704784B (en) Device, method and non-transitory tangible machine-readable medium for traffic monitoring
CN113225228B (en) Data processing method and device
CN116880332A (en) Controller low-power consumption mode awakening method and device, electrical equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant