CN111208363B - Test method and electronic device - Google Patents

Test method and electronic device Download PDF

Info

Publication number
CN111208363B
CN111208363B CN201911284509.2A CN201911284509A CN111208363B CN 111208363 B CN111208363 B CN 111208363B CN 201911284509 A CN201911284509 A CN 201911284509A CN 111208363 B CN111208363 B CN 111208363B
Authority
CN
China
Prior art keywords
test
instruction
recording
sleep
file
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
CN201911284509.2A
Other languages
Chinese (zh)
Other versions
CN111208363A (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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology 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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN201911284509.2A priority Critical patent/CN111208363B/en
Publication of CN111208363A publication Critical patent/CN111208363A/en
Application granted granted Critical
Publication of CN111208363B publication Critical patent/CN111208363B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/005Testing of electric installations on transport means
    • G01R31/006Testing of electric installations on transport means on road vehicles, e.g. automobiles or trucks
    • G01R31/007Testing of electric installations on transport means on road vehicles, e.g. automobiles or trucks using microprocessors or computers
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/003Environmental or reliability tests

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Chemical & Material Sciences (AREA)
  • Combustion & Propulsion (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a test method and electronic equipment, wherein the test method is applied to the electronic equipment and comprises the following steps: acquiring a starting instruction and correspondingly storing a weblog according to the starting instruction; acquiring a test instruction and carrying out operation test according to the test instruction; recording instruction information corresponding to the test instruction to a first recording file and recording corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode; judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file; when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file.

Description

Test method and electronic device
Technical Field
The present application relates to the field of system wake-up detection technologies, and in particular, to a test method and an electronic device.
Background
Generally, an electronic device has two power consumption modes, i.e., a sleep mode and an awake mode, and the power consumption of the electronic device is lower in the sleep mode than in the awake mode. The vehicle-mounted device is used as an electronic device which is used for acquiring vehicle data or is arranged on a vehicle for enabling the vehicle to have a certain function, the vehicle-mounted device can be powered by a storage battery arranged on the vehicle when the vehicle is started, when the vehicle is flamed out, the storage battery of the vehicle is enabled to have enough electric quantity, the vehicle-mounted device needs to enter a sleep mode to reduce power consumption, when the vehicle is restarted, the vehicle-mounted device can be awakened from the sleep mode, if the sleep is awakened to be unreliable, the vehicle cannot enter the sleep mode after the flamed out, the power consumption is overlarge, the storage battery is slightly dead, the vehicle cannot be started, and the service life of the storage battery of the vehicle is influenced.
Based on the working requirement, it is very important that research and development personnel can accurately detect the reliability of sleep and wake-up of the vehicle-mounted equipment and quickly position the vehicle-mounted equipment when the vehicle-mounted equipment is not in sleep or abnormally wakened in the research and development and test processes of the vehicle-mounted equipment.
Therefore, how to achieve accurate detection of sleep and wake-up of the electronic device and accurate positioning of an abnormality during the detection process is a popular topic that is being researched by those skilled in the art.
Disclosure of Invention
The present application provides a testing method and an electronic device.
In order to achieve the above object, the present application provides a testing method applied to an electronic device, the testing method including:
acquiring a starting instruction and correspondingly storing a weblog according to the starting instruction;
acquiring a test instruction and carrying out operation test according to the test instruction;
recording instruction information corresponding to the test instruction to a first recording file and recording corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode;
judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file;
when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file. Preferably, the correspondingly storing the weblog according to the starting instruction specifically includes:
and calling a packet capturing command according to the starting instruction to start a corresponding packet capturing process and store the corresponding weblog.
Preferably, the test mode includes a sleep mode, the test instruction includes a sleep instruction, and recording instruction information corresponding to the test instruction in a first record file and recording corresponding test mode information in a second record file after the electronic device executes the test instruction and enters the corresponding test mode includes:
recording a first sleep time and a first sleep event corresponding to the sleep instruction to the first recording file and detecting whether the packet capturing process exits;
when the packet capturing process exits, restarting the packet capturing process and executing the operation corresponding to the dormancy instruction;
when the electronic equipment enters the sleep mode, recording a second sleep time and a second sleep event corresponding to the electronic equipment entering the sleep mode to the second recording file.
Preferably, the electronic device is installed with an application program, and the executing the operation corresponding to the hibernation instruction specifically includes:
controlling the application program to release a dormant lock and recording lock holding information of the application program into the first recording file;
and calling a preset sleep command according to the sleep instruction so as to enable the electronic equipment to enter the sleep mode.
Preferably, the test exception includes a sleep exception, and the determining whether the test exception exists in the electronic device in the test process according to the first record file and the second record file specifically includes:
judging whether the first dormancy time in the first record file is matched with the second dormancy time in the second record file;
and when the first sleep time and the second sleep time are not matched, judging that the electronic equipment has sleep abnormity in the test process.
Preferably, the locating the test exception according to at least one of the weblog, the first log file, and the second log file specifically includes:
and when the electronic equipment has abnormal dormancy in the test process, positioning the abnormal dormancy according to the first record file or the weblog.
Preferably, the test mode includes an awake mode, the test instruction includes an awake instruction, the recording instruction information corresponding to the test instruction in a first record file and recording corresponding test mode information in a second record file after the electronic device executes the test instruction and enters the corresponding test mode includes:
recording a first wake-up time and a first wake-up event corresponding to the wake-up instruction to the first record file;
calling a preset wake-up command according to the wake-up instruction so as to enable the electronic equipment to enter the wake-up mode;
and when the electronic equipment enters the awakening mode, recording a second awakening time and a second awakening event corresponding to the fact that the electronic equipment enters the awakening mode into the second recording file.
Preferably, the test exception includes a wakeup exception, and the determining whether the test exception exists in the electronic device in the test process according to the first record file and the second record file specifically includes:
judging whether a corresponding second wake-up time exists in the second recording file in a time period from the first sleep time to the first wake-up time in the first recording file;
and when the corresponding second wake-up time exists in the second record file in the time period, judging that the electronic equipment has wake-up abnormity in the test process.
Preferably, the locating the test exception according to at least one of the weblog, the first log file, and the second log file specifically includes:
and when the electronic equipment has the abnormal awakening in the test process, positioning the abnormal awakening according to the second record file or the network log.
The present application further provides a testing device, the testing device includes:
the weblog module is used for acquiring a starting instruction and correspondingly storing the weblog according to the starting instruction;
the operation test module is used for acquiring a test instruction and carrying out operation test according to the test instruction;
the information recording module is used for recording the instruction information corresponding to the test instruction into a first recording file and recording the corresponding test mode information into a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode;
the abnormality detection module is used for judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file;
and the abnormity positioning module is used for positioning the test abnormity according to at least one of the weblog, the first record file and the second record file when the test abnormity exists in the test process of the electronic equipment.
Preferably, the weblog module is further configured to:
and calling a packet capturing command according to the starting instruction to start a corresponding packet capturing process and store the corresponding weblog.
Preferably, the test mode includes a sleep mode, the test instruction includes a sleep instruction, and the information recording module is further configured to:
recording a first sleep time and a first sleep event corresponding to the sleep instruction to the first record file and detecting whether the packet capturing process exits or not;
when the packet capturing process exits, restarting the packet capturing process and executing the operation corresponding to the dormancy instruction;
when the electronic equipment enters the sleep mode, recording a second sleep time and a second sleep event corresponding to the electronic equipment entering the sleep mode to the second recording file.
Preferably, the information recording module is further configured to:
controlling the application program to release a dormant lock and recording lock holding information of the application program into the first recording file;
and calling a preset sleep command according to the sleep instruction so as to enable the electronic equipment to enter the sleep mode.
Preferably, the test mode includes a wake-up mode, the test instruction includes a wake-up instruction, and the information recording module is further configured to:
recording a first awakening time and a first awakening event corresponding to the awakening instruction to the first recording file;
calling a preset wake-up command according to the wake-up instruction so as to enable the electronic equipment to enter the wake-up mode;
and when the electronic equipment enters the awakening mode, recording a second awakening time and a second awakening event corresponding to the fact that the electronic equipment enters the awakening mode into the second recording file.
Preferably, the test exception comprises a sleep exception, and the exception detection module is further configured to:
judging whether the first dormancy time in the first record file is matched with the second dormancy time in the second record file;
and when the first sleep time and the second sleep time are not matched, judging that the electronic equipment has sleep abnormity in the test process.
Preferably, the test exception comprises a wake-up exception, and the exception detecting module is further configured to:
judging whether a corresponding second wake-up time exists in the second recording file in a time period from the first sleep time to the first wake-up time in the first recording file;
and when the corresponding second wake-up time exists in the second record file in the time period, judging that the electronic equipment has wake-up abnormity in the test process.
Preferably, the anomaly locating module is further configured to:
and when the electronic equipment has abnormal dormancy in the test process, positioning the abnormal dormancy according to the first record file or the weblog.
Preferably, the anomaly locating module is further configured to:
and when the electronic equipment has the abnormal awakening in the test process, positioning the abnormal awakening according to the second record file or the network log.
The present application further provides an electronic device, the electronic device including:
a memory for storing a computer-executable test program;
the processor is used for calling the test program stored in the memory to execute the test method.
Compared with the prior art, the test method provided by the application obtains the starting instruction and correspondingly stores the weblog according to the starting instruction; acquiring a test instruction and carrying out operation test according to the test instruction; recording instruction information corresponding to the test instruction to a first recording file and recording corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode; judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file; when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file. According to the method, the relevant test information is automatically recorded into the corresponding first recording file and the second recording file in the test process, whether the electronic equipment has test abnormity in the test process is known by comparing the information recorded in the first recording file with the information recorded in the second recording file, and the abnormity problem can be quickly positioned when the test abnormity is stored, so that the subsequent correction of the corresponding abnormity problem is facilitated.
Drawings
FIG. 1 is a flow chart illustrating the steps of a testing method provided herein;
FIG. 2A is a flow diagram of sub-steps of one embodiment of step S3 of FIG. 1;
FIG. 2B is a flowchart illustrating sub-steps of another embodiment of step S3 of FIG. 1;
FIG. 3A is a flow diagram of sub-steps of one embodiment of step S4 of FIG. 1;
FIG. 3B is a flow diagram of sub-steps of another embodiment of step S4 of FIG. 1;
FIG. 4 is a block diagram of a test apparatus according to an embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
The application provides a test method, a test device and electronic equipment, wherein the test method is applied to the electronic equipment, and the test method comprises the steps of obtaining a starting instruction and correspondingly storing a weblog according to the starting instruction; acquiring a test instruction and carrying out operation test according to the test instruction; recording instruction information corresponding to the test instruction to a first recording file and recording corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode; judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file; when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file. According to the method, the relevant test information is automatically recorded into the corresponding first recording file and the second recording file in the test process, whether the electronic equipment has test abnormity in the test process is known by comparing the information recorded in the first recording file with the information recorded in the second recording file, and the abnormity problem can be quickly positioned when the test abnormity is stored, so that the subsequent correction of the corresponding abnormity problem is facilitated.
Referring to fig. 1, fig. 1 shows a testing method applied to an electronic device, where the testing method is executed by a processor of the electronic device, where the electronic device may be a vehicle-mounted device, a Personal Computer (PC), a mobile terminal, or a personal digital assistant PDA, which is not limited herein.
The electronic equipment is provided with a sleep mode and an awakening mode, the power consumption corresponding to the sleep mode is different from that corresponding to the awakening mode, and the power consumption of the electronic equipment in the sleep mode is smaller than that in the awakening mode.
The electronic device is required to enter a sleep mode when receiving a sleep command and enter a wake mode when receiving a wake command. If the electronic equipment receives the sleep command but does not enter the sleep mode or receives the sleep command but abnormally enters the sleep mode, the surface electronic equipment has the design defect of abnormal sleep; if the electronic device receives the wake-up command but does not enter the wake-up mode or receives the wake-up command but is awakened, the surface electronic device has a design defect of abnormal wake-up. In order to obtain an electronic device that meets the design requirements, the electronic device needs to be subjected to relevant tests.
In the present application, the electronic device is an in-vehicle device, and a processor of the in-vehicle device is a high-pass processor, but the electronic device is not limited to only the in-vehicle device, and the processor is only the high-pass processor.
As shown in fig. 1, the testing method includes:
step S1: and acquiring a starting instruction and correspondingly storing the weblog according to the starting instruction.
When the test is started, the electronic equipment receives a starting instruction for starting the test and correspondingly stores a weblog according to the starting, wherein the weblog is a file which is generated when the electronic equipment and the external equipment are in communication interaction and used for recording related interaction information.
In some embodiments, the correspondingly storing the weblog according to the start instruction specifically includes:
and calling a packet capturing command according to the starting instruction to start a corresponding packet capturing process and store the corresponding weblog.
The processor of the electronic device is taken as a high-pass processor for illustration, but the processor of the electronic device is not limited to only a high-pass processor.
When the test is started, the electronic equipment calls a packet capturing command, such as a tcpdump-w command, to store the weblog by receiving an external starting instruction.
Step S2: and acquiring a test instruction and carrying out operation test according to the test instruction.
The test instruction is an instruction which is sent to the electronic equipment by a user according to a project to be tested of the electronic equipment so as to control the electronic equipment to perform a certain functional test.
In this embodiment, the test instruction includes a wake-up test instruction and a sleep test instruction, and after receiving the test instruction, the electronic device performs a corresponding operation test according to the test instruction.
Step S3: and recording the instruction information corresponding to the test instruction to a first recording file, and recording the corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode.
Referring to fig. 2A, in some embodiments, the test mode includes a sleep mode, the test instruction includes a sleep instruction, and recording instruction information corresponding to the test instruction in a first recording file and recording corresponding test mode information in a second recording file after the electronic device executes the test instruction and enters the corresponding test mode includes:
step S31 a: recording a first sleep time and a first sleep event corresponding to the sleep instruction to the first recording file and detecting whether the packet capturing process exits;
step S32 a: when the packet capturing process exits, restarting the packet capturing process and executing the operation corresponding to the dormancy instruction;
step S33 a: when the electronic equipment enters the sleep mode, recording a second sleep time and a second sleep event corresponding to the electronic equipment entering the sleep mode to the second recording file.
In some embodiments, the electronic device is installed with an application program, and the executing the operation corresponding to the hibernation instruction specifically includes:
controlling the application program to release a dormant lock and recording lock holding information of the application program into the first recording file;
and calling a preset sleep command according to the sleep instruction so as to enable the electronic equipment to enter the sleep mode.
Illustratively, the electronic equipment is provided with a signal interface and is in communication connection with an external instruction sending device through the signal interface.
The electronic equipment is internally provided with a plurality of application programs, when testing whether the electronic equipment can enter a sleep mode according to a sleep instruction or not, a user sends the sleep instruction to the electronic equipment through a signal interface by controlling an instruction sending device, and after receiving the sleep instruction, the electronic equipment records a first sleep time and a first sleep event corresponding to the sleep instruction into a first record file, such as a record file named power.
After the first record file is recorded, whether a packet capturing process such as a tcpdump process exits or not is detected, when the packet capturing process exits, the packet capturing process is restarted to save a corresponding weblog in real time, an application program installed in the electronic equipment is controlled to release a sleep lock so as to ensure that the electronic equipment can enter a sleep mode, meanwhile, lock holding information of the application program is recorded into the first record file, and a preset sleep command is called according to a sleep command so as to detect whether the electronic equipment can enter the corresponding sleep mode according to the sleep command.
When the electronic device enters the hibernation mode, the electronic device records a corresponding second hibernation time and a second hibernation event of entering the hibernation mode into the second recording file, e.g., a file named dmesg.
Referring to fig. 2B, in some embodiments, the test mode includes an awake mode, the test instruction includes an awake instruction, and recording instruction information corresponding to the test instruction in a first record file and recording corresponding test mode information in a second record file after the electronic device executes the test instruction and enters the corresponding test mode includes:
step S31 b: recording a first awakening time and a first awakening event corresponding to the awakening instruction to the first recording file;
step S32 b: calling a preset wake-up command according to the wake-up instruction so as to enable the electronic equipment to enter the wake-up mode;
step S33 b: and when the electronic equipment enters the awakening mode, recording a second awakening time and a second awakening event corresponding to the fact that the electronic equipment enters the awakening mode into the second recording file.
When the electronic equipment is tested whether to enter the awakening mode according to the awakening instruction, a user sends the awakening instruction to the electronic equipment through the signal interface by controlling the instruction sending equipment, and after the electronic equipment receives the awakening instruction, the first awakening time and the first awakening event corresponding to the awakening instruction are recorded in a first recording file, such as a recording file named power.
After the first recording file is recorded, calling a preset awakening command according to the awakening command to detect whether the electronic equipment can enter a corresponding awakening mode according to the awakening command.
When the electronic device enters the wake-up mode, the electronic device records a corresponding second wake-up time and a second wake-up event, which correspond to the wake-up mode, into the second record file, i.e., the dmesg.
Step S4: and judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file.
The test exception comprises a sleep exception and a wake-up exception, wherein the sleep exception is the defect that the electronic equipment cannot enter a sleep mode according to a sleep instruction, and the wake-up exception is the defect that the electronic equipment cannot enter a wake-up mode according to a wake-up instruction.
Referring to fig. 3A, in some embodiments, the determining whether the test exception exists in the test process of the electronic device according to the first record file and the second record file includes:
step S41 a: judging whether the first dormancy time in the first record file is matched with the second dormancy time in the second record file;
step S42 a: and when the first dormancy time is not matched with the second dormancy time in the second record file, judging that the electronic equipment has dormancy abnormity in the test process.
Illustratively, whether a first sleep time recorded in a power.log file and a second sleep time recorded in a dmesg.log file are matched or not is compared, if the first sleep time is recorded in the power.log file and the second time of the electronic device entering into the sleep mode is not indicated in the dmesg.log file, the first sleep time is not matched with the second sleep time in the second record file, and the electronic device is judged to have a sleep exception in the test process.
Referring to fig. 3B, in some embodiments, the test exception includes a wakeup exception, and the determining whether the test exception exists in the test process of the electronic device according to the first record file and the second record file specifically includes:
step S41 b: judging whether a corresponding second wake-up time exists in the second recording file in a time period from the first sleep time to the first wake-up time in the first recording file;
step S42 b: and when the corresponding second wake-up time exists in the second record file in the time period, judging that the electronic equipment has wake-up abnormity in the test process.
Log file, whether there is a second wake-up time in the dmesg log file, if there is a second wake-up time, it indicates that the electronic device is abnormally waken, and there is a wake-up abnormality defect.
Step S5: when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file. In some embodiments, the locating the test exception according to at least one of the weblog, the first log file, and the second log file specifically includes:
and when the electronic equipment has abnormal dormancy in the test process, positioning the abnormal dormancy according to the first record file or the weblog.
Illustratively, for the sleep exception, there are two cases, one of which is that the application program does not release the sleep lock according to the instruction, and the corresponding application program holds the lock after receiving the sleep test instruction. And secondly, the electronic equipment also carries out information interaction with external equipment, so that the electronic equipment cannot enter a sleep mode.
When the application program does not release the dormant lock according to the instruction, the electronic device cannot enter the dormant mode, the lock holding information of the application program is searched at the corresponding time point in the power log, whether the corresponding application program does not release the dormant lock after receiving the dormant test instruction or not is determined, and the design of the corresponding application program can be positioned to have defects.
When the electronic equipment is in information interaction with external equipment, the network log of the packet capturing process, namely the network log of tcpdump, is found, the domain name or the IP of the access network of the corresponding time period is obtained from the network log, and the addresses accessed by the application programs can be checked according to the addresses, so that the corresponding abnormal sleep problem is found.
In some embodiments, the locating the test exception according to at least one of the weblog, the first log file, and the second log file specifically includes:
and when the electronic equipment has the abnormal awakening in the test process, positioning the abnormal awakening according to the second record file or the network log.
For example, regarding the wake-up exception, there are two main cases, in which when the electronic device receives a wake-up command, the electronic device is interrupted by the abnormal wake-up interrupt source to cause the wake-up exception. Secondly, the electronic device is awakened by abnormal data sent by the external device, thereby causing the awakening abnormality of the electronic device.
When the electronic equipment is abnormally awakened due to the interruption of the awakening interrupt source, the corresponding awakening source can be found out by searching the awakening interrupt source in the corresponding time period in the dmesg log file, and the corresponding defect can be corrected by modifying the code to close the unneeded awakening source.
When the electronic equipment is awakened by abnormal data sent by external equipment, a corresponding time period in a weblog of the tcpdump is found, a domain name or an IP address of a network is accessed, namely, which IP addresses send data to awaken the electronic equipment can be known, and socket connection with the IP addresses can be disconnected before dormancy according to business needs.
Referring to fig. 4, the present application further provides a testing apparatus 101 applied to an electronic device, the testing apparatus including:
the weblog module 1011 is configured to obtain a start instruction and correspondingly store a weblog according to the start instruction;
an operation test module 1012, configured to obtain a test instruction and perform an operation test according to the test instruction;
the information recording module 1013 is configured to record instruction information corresponding to the test instruction to a first recording file and record corresponding test mode information to a second recording file after the electronic device executes the test instruction and enters a corresponding test mode;
an anomaly detection module 1014, configured to determine whether the electronic device has a test anomaly in the test process according to the first record file and the second record file;
an exception positioning module 1015, configured to, when the electronic device has a test exception during a test process, position the test exception according to at least one of the weblog, the first log file, and the second log file.
In some embodiments, the weblog module 1011 is further configured to:
and calling a packet capturing command according to the starting instruction to start a corresponding packet capturing process and store the corresponding weblog.
In some embodiments, the test mode includes a sleep mode, the test instruction includes a sleep instruction, and the information recording module 1013 is further configured to:
recording a first sleep time and a first sleep event corresponding to the sleep instruction to the first recording file and detecting whether the packet capturing process exits;
when the packet capturing process exits, restarting the packet capturing process and executing the operation corresponding to the dormancy instruction;
when the electronic equipment enters the sleep mode, recording a second sleep time and a second sleep event corresponding to the electronic equipment entering the sleep mode to the second recording file.
In some embodiments, the information recording module 1013 is further configured to:
controlling the application program to release a dormant lock and recording lock holding information of the application program into the first recording file;
and calling a preset sleep command according to the sleep instruction to enable the electronic equipment to enter the sleep mode.
In some embodiments, the test mode includes a wake-up mode, the test instruction includes a wake-up instruction, and the information recording module 1013 is further configured to:
recording a first awakening time and a first awakening event corresponding to the awakening instruction to the first recording file;
calling a preset wake-up command according to the wake-up instruction so as to enable the electronic equipment to enter the wake-up mode;
and when the electronic equipment enters the awakening mode, recording a second awakening time and a second awakening event corresponding to the fact that the electronic equipment enters the awakening mode into the second recording file.
In some embodiments, the test exception comprises a sleep exception, and the exception detection module 1014 is further configured to:
judging whether the first dormancy time in the first record file is matched with the second dormancy time in the second record file;
and when the first sleep time is not matched with the second sleep time, judging that sleep abnormality exists in the electronic equipment in the test process.
In some embodiments, the test exception comprises a wake exception, and the exception detection module 1014 is further configured to:
judging whether a corresponding second wake-up time exists in the second recording file in a time period from the first sleep time to the first wake-up time in the first recording file;
and when the corresponding second wake-up time exists in the second record file in the time period, judging that the electronic equipment has wake-up abnormity in the test process.
In some embodiments, the anomaly locating module 1015 is further configured to:
and when the electronic equipment has abnormal dormancy in the test process, positioning the abnormal dormancy according to the first record file or the weblog.
In some embodiments, the anomaly locating module 1015 is further configured to:
and when the electronic equipment has the abnormal awakening in the test process, positioning the abnormal awakening according to the second record file or the network log.
Referring to fig. 5, the present application further provides an electronic device 30, where the electronic device 30 includes a memory 301 and a processor 302 communicatively connected to the memory 301.
The memory 301 includes at least one type of readable storage medium, which includes flash memory, hard disk, multi-media card, card type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like. The memory 301 may in some embodiments be an internal memory of the electronic device 30, such as a hard disk of the electronic device 30. The memory 301 may also be an external storage device of the electronic device 30 in other embodiments, such as a plug-in hard disk provided on the electronic device 30, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and so on.
The memory 301 may be used to store not only the application software installed in the electronic device 30 and various data, such as codes of a computer-readable program, but also data that has been output or will be output temporarily, that is, the first memory may be used as a storage medium storing a computer-executable test program.
Processor 302, which in some embodiments may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip, may invoke a test program stored in memory 301 to implement the following method steps:
acquiring a starting instruction and correspondingly storing a weblog according to the starting instruction;
acquiring a test instruction and carrying out operation test according to the test instruction;
recording instruction information corresponding to the test instruction to a first recording file and recording corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode;
judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file;
when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file. In some embodiments, the processor 302 is further configured to perform the following method steps:
and calling a packet capturing command according to the starting instruction to start a corresponding packet capturing process and store the corresponding weblog.
In some embodiments, the test mode comprises a sleep mode, the test instructions comprise sleep instructions, and the processor 302 is further configured to perform the method steps of:
recording a first sleep time and a first sleep event corresponding to the sleep instruction to the first recording file and detecting whether the packet capturing process exits;
when the packet capturing process exits, restarting the packet capturing process and executing the operation corresponding to the dormancy instruction;
when the electronic equipment enters the sleep mode, recording a second sleep time and a second sleep event corresponding to the electronic equipment entering the sleep mode to the second recording file.
In some embodiments, the processor 302 is further configured to perform the following method steps:
controlling the application program to release a dormant lock and recording lock holding information of the application program into the first recording file;
and calling a preset sleep command according to the sleep instruction so as to enable the electronic equipment to enter the sleep mode.
In some embodiments, the test exception comprises a sleep exception, and the processor 302 is further configured to perform the method steps of:
judging whether the first dormancy time in the first record file is matched with the second dormancy time in the second record file;
and when the first sleep time is not matched with the second sleep time, judging that sleep abnormality exists in the electronic equipment in the test process.
In some embodiments, the processor 302 is further configured to perform the following method steps:
and when the electronic equipment has abnormal dormancy in the test process, positioning the abnormal dormancy according to the first record file or the weblog.
In some embodiments, the test mode comprises a wake-up mode, the test instructions comprise wake-up instructions, and the processor 302 is further configured to perform the following method steps:
recording a first awakening time and a first awakening event corresponding to the awakening instruction to the first recording file;
calling a preset wake-up command according to the wake-up instruction so as to enable the electronic equipment to enter the wake-up mode;
and when the electronic equipment enters the awakening mode, recording a second awakening time and a second awakening event corresponding to the fact that the electronic equipment enters the awakening mode into the second recording file.
In some embodiments, the test exception comprises a wake exception, and the processor 302 is further configured to perform the following method steps:
judging whether a corresponding second wake-up time exists in the second recording file in a time period from the first sleep time to the first wake-up time in the first recording file;
and when the corresponding second wake-up time exists in the second record file in the time period, judging that the electronic equipment has wake-up abnormity in the test process.
In some embodiments, the processor 302 is further configured to perform the following method steps:
and when the electronic equipment has the abnormal awakening in the test process, positioning the abnormal awakening according to the second record file or the network log.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A test method is applied to electronic equipment, and is characterized by comprising the following steps:
acquiring a starting instruction and correspondingly storing a weblog according to the starting instruction;
acquiring a test instruction and carrying out operation test according to the test instruction;
recording instruction information corresponding to the test instruction to a first recording file and recording corresponding test mode information to a second recording file after the electronic equipment executes the test instruction and enters a corresponding test mode;
judging whether the electronic equipment has test abnormality in the test process according to the first record file and the second record file;
when the electronic equipment has test abnormality in the test process, the test abnormality is positioned according to at least one of the weblog, the first record file and the second record file.
2. The method according to claim 1, wherein the correspondingly saving the blog according to the start instruction specifically includes:
and calling a packet capturing command according to the starting instruction to start a corresponding packet capturing process and store the corresponding weblog.
3. The method as claimed in claim 2, wherein the test mode includes a sleep mode, the test command includes a sleep command, and the recording the command information corresponding to the test command into a first log file and recording the corresponding test mode information into a second log file after the electronic device executes the test command into a corresponding test mode comprises:
recording a first sleep time and a first sleep event corresponding to the sleep instruction to the first recording file and detecting whether the packet capturing process exits;
when the packet capturing process exits, restarting the packet capturing process and executing the operation corresponding to the dormancy instruction;
when the electronic equipment enters the sleep mode, recording a second sleep time and a second sleep event corresponding to the electronic equipment entering the sleep mode to the second recording file.
4. The method of claim 3, wherein the electronic device is installed with an application program, and the executing the operation corresponding to the hibernation instruction specifically includes:
controlling the application program to release a dormant lock and recording lock holding information of the application program into the first recording file;
and calling a preset sleep command according to the sleep instruction so as to enable the electronic equipment to enter the sleep mode.
5. The method according to claim 3, wherein the test exception includes a sleep exception, and the determining whether the test exception exists in the electronic device in the test process according to the first log file and the second log file specifically includes:
judging whether the first dormancy time in the first record file is matched with the second dormancy time in the second record file;
and when the first sleep time and the second sleep time are not matched, judging that the electronic equipment has sleep abnormity in the test process.
6. The method of claim 5, wherein locating the test exception based on at least one of the weblog, the first log file, and the second log file comprises:
and when the electronic equipment has abnormal dormancy in the test process, positioning the abnormal dormancy according to the first record file or the weblog.
7. The method of claim 2, wherein the test mode comprises an awake mode, the test instruction comprises an awake instruction, and recording instruction information corresponding to the test instruction in a first log file and recording corresponding test mode information in a second log file after the electronic device executes the test instruction to enter the corresponding test mode comprises:
recording a first awakening time and a first awakening event corresponding to the awakening instruction to the first recording file;
calling a preset wake-up command according to the wake-up instruction so as to enable the electronic equipment to enter the wake-up mode;
and when the electronic equipment enters the awakening mode, recording a second awakening time and a second awakening event corresponding to the fact that the electronic equipment enters the awakening mode into the second recording file.
8. The method according to claim 7, wherein the test exception includes a wake-up exception, and the determining whether the test exception exists in the electronic device in the test process according to the first log file and the second log file specifically includes:
judging whether a corresponding second wake-up time exists in the second recording file in a time period from a first sleep time in the first recording file to the first wake-up time;
and when the corresponding second wake-up time exists in the second record file in the time period, judging that the electronic equipment has wake-up abnormity in the test process.
9. The method of claim 8, wherein locating the test exception from at least one of the weblog, the first log file, and the second log file comprises:
and when the electronic equipment has the awakening abnormity in the test process, positioning the awakening abnormity according to the second recording file or the network log.
10. An electronic device, characterized in that the electronic device comprises:
a memory for storing a computer-executable test program;
a processor for calling a test program stored in the memory to perform a test method according to any one of claims 1-9.
CN201911284509.2A 2019-12-13 2019-12-13 Test method and electronic device Active CN111208363B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911284509.2A CN111208363B (en) 2019-12-13 2019-12-13 Test method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911284509.2A CN111208363B (en) 2019-12-13 2019-12-13 Test method and electronic device

Publications (2)

Publication Number Publication Date
CN111208363A CN111208363A (en) 2020-05-29
CN111208363B true CN111208363B (en) 2022-06-17

Family

ID=70782647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911284509.2A Active CN111208363B (en) 2019-12-13 2019-12-13 Test method and electronic device

Country Status (1)

Country Link
CN (1) CN111208363B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835735A (en) * 2021-01-04 2021-05-25 宝能(西安)汽车研究院有限公司 Method and system for solving abnormal sleeping and abnormal awakening of vehicle and vehicle

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271421A (en) * 2007-03-22 2008-09-24 北京邮电大学 Software fault test system and method
CN104516970A (en) * 2014-12-23 2015-04-15 广州酷狗计算机科技有限公司 Method and device both for log analysis
CN105335277A (en) * 2014-06-27 2016-02-17 可牛网络技术(北京)有限公司 Fault information processing method and device as well as terminal
CN106155885A (en) * 2015-03-31 2016-11-23 展讯通信(上海)有限公司 A kind of full-automatic test system and method for testing
CN106776179A (en) * 2016-12-17 2017-05-31 上海与德信息技术有限公司 The automatic testing method and device of electronic device failure
CN106844576A (en) * 2017-01-06 2017-06-13 北京蓝海讯通科技股份有限公司 A kind of method for detecting abnormality, device and monitoring device
CN107515808A (en) * 2017-08-08 2017-12-26 百富计算机技术(深圳)有限公司 Log recording method, device, computer equipment and computer-readable recording medium
CN109213667A (en) * 2018-09-17 2019-01-15 广东小天才科技有限公司 A kind of abnormality eliminating method and electronic equipment of android system
CN109525420A (en) * 2018-10-18 2019-03-26 北京长城华冠汽车技术开发有限公司 Fault data based on vehicle mounted communication module transfers method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468484B (en) * 2014-09-30 2020-07-28 伊姆西Ip控股有限责任公司 Method and apparatus for locating a fault in a storage system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271421A (en) * 2007-03-22 2008-09-24 北京邮电大学 Software fault test system and method
CN105335277A (en) * 2014-06-27 2016-02-17 可牛网络技术(北京)有限公司 Fault information processing method and device as well as terminal
CN104516970A (en) * 2014-12-23 2015-04-15 广州酷狗计算机科技有限公司 Method and device both for log analysis
CN106155885A (en) * 2015-03-31 2016-11-23 展讯通信(上海)有限公司 A kind of full-automatic test system and method for testing
CN106776179A (en) * 2016-12-17 2017-05-31 上海与德信息技术有限公司 The automatic testing method and device of electronic device failure
CN106844576A (en) * 2017-01-06 2017-06-13 北京蓝海讯通科技股份有限公司 A kind of method for detecting abnormality, device and monitoring device
CN107515808A (en) * 2017-08-08 2017-12-26 百富计算机技术(深圳)有限公司 Log recording method, device, computer equipment and computer-readable recording medium
CN109213667A (en) * 2018-09-17 2019-01-15 广东小天才科技有限公司 A kind of abnormality eliminating method and electronic equipment of android system
CN109525420A (en) * 2018-10-18 2019-03-26 北京长城华冠汽车技术开发有限公司 Fault data based on vehicle mounted communication module transfers method and apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"The Design and Implementation of Host-based Intrusion Detection System";LIN Ying et al.;《2010 Third International Symposium on Intelligent Information Technology and Security Informatics》;20100422;第595-598页 *
"基于XML的邮件群发系统设计";田原;《辽宁工程技术大学学报(自然科学版)》;20081231;第27卷(第6期);第889-891页 *

Also Published As

Publication number Publication date
CN111208363A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
CN102760090B (en) Debugging method and computer system
CN112241164A (en) Automobile network dormancy testing method, device, equipment and storage medium
US20120047401A1 (en) Test device and test method for testing computing device
CN101131662B (en) Computer automatic tour inspection system and method thereof
CN101576842A (en) System and method for monitoring baseboard management controller
CN104239079A (en) Electronic device operating system automatic awakening method and system
CN110457907B (en) Firmware program detection method and device
US10691569B2 (en) System and method for testing a data storage device
CN107590017B (en) Detection method and device for electronic equipment
CN102045211A (en) Power supply circulating pressure testing method
CN114978883B (en) Network wakeup management method and device, electronic equipment and storage medium
CN111208363B (en) Test method and electronic device
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
JP4896225B2 (en) Information processing terminal and falsification verification method
CN108364670B (en) Read-write pressure testing method, device, equipment and storage medium
CN110096882B (en) Safety measurement method in equipment operation process
US8738939B2 (en) System and method for testing WOL function of computers
TW201516665A (en) System and method for detecting system error of server
JP6583942B1 (en) BMC, determination method and BMC firmware
CN115728665A (en) Power failure detection circuit, method and system
CN112946562B (en) Power failure protection method and device for double-core intelligent electric meter and double-core intelligent electric meter
CN115437859A (en) Dormancy awakening processing method and device, electronic equipment and storage medium
WO2018137540A1 (en) Method and device for backing up data
CN111813748B (en) File system mounting method and device, electronic equipment and storage medium
CN114496053A (en) Data anomaly detection method, device and equipment and computer readable 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