CN109446008B - Fault reason detection method, fault reason detection device and terminal equipment - Google Patents

Fault reason detection method, fault reason detection device and terminal equipment Download PDF

Info

Publication number
CN109446008B
CN109446008B CN201811284661.6A CN201811284661A CN109446008B CN 109446008 B CN109446008 B CN 109446008B CN 201811284661 A CN201811284661 A CN 201811284661A CN 109446008 B CN109446008 B CN 109446008B
Authority
CN
China
Prior art keywords
system image
image file
file
machine
fault
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
CN201811284661.6A
Other languages
Chinese (zh)
Other versions
CN109446008A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811284661.6A priority Critical patent/CN109446008B/en
Publication of CN109446008A publication Critical patent/CN109446008A/en
Application granted granted Critical
Publication of CN109446008B publication Critical patent/CN109446008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a fault cause detection method, a fault cause detection device and terminal equipment, wherein the method comprises the following steps: acquiring a file name of a first system image file of a fault machine; acquiring a second system image file which is corresponding to the file name and is not damaged; sending the second system image file to the fault machine to instruct the fault machine to execute the operation of replacing the first system image file with the second system image file; sending a starting-up instruction to the fault machine to indicate the fault machine to execute a starting-up operation; judging whether the fault machine is started successfully or not; if the starting is failed, when the obtained file name does not traverse the file names of all system image files in the fault machine, the file name is obtained, the system image file corresponding to the file name is the first system image file, and the second step of returning and executing the application can improve the checking efficiency of the system image file in the fault machine which cannot be started to a certain extent.

Description

Fault reason detection method, fault reason detection device and terminal equipment
Technical Field
The present application belongs to the field of electronic technologies, and in particular, relates to a fault cause detection method, a fault cause detection apparatus, a terminal device, and a computer-readable storage medium.
Background
At present, electronic devices such as smart phones are increasingly popular, and users sometimes use the electronic devices improperly to disable the electronic devices, for example, when the users upgrade their system versions, the electronic devices often become disabled machines due to the non-professional nature of the users.
In order to facilitate subsequent maintenance of a failed device which cannot be started, a reason why the failed device cannot be started needs to be determined, and for the failed device which cannot be started, a system image file is damaged, which is a common reason why the failed device cannot be started, so that the system image file of the failed device needs to be checked to determine whether the reason why the failed device cannot be started includes damage of the system image file, and in order to check the system image file of the failed device, a currently common method is as follows: manually acquiring each system image file of the fault machine by using an image file reading tool (such as MamReadPartitionData), and manually comparing each read system image file with the corresponding non-damaged system image file, so as to determine whether the fault machine has the damaged system image file and which of the damaged system image files are specific.
Therefore, when the reason that the fault machine cannot be started is detected, the system image file of the fault machine is often required to be checked, and the checking of the system image file at present depends on manpower to a large extent, so that the checking efficiency is low.
Disclosure of Invention
In view of this, the present application provides a method, a device, a terminal device and a computer readable storage medium for detecting a failure cause, which can improve the efficiency of checking a system image file in a failed device that cannot be booted to a certain extent.
The first aspect of the present application provides a method for detecting a failure cause, which is applied to a terminal device, where the terminal device is used to connect to a failure machine that cannot be started up, and the method for detecting a failure cause includes:
acquiring the file name of a first system image file of the fault machine;
acquiring a second system image file corresponding to the file name according to the file name, wherein the second system image file is a system image file without damage;
sending the second system image file to the fault machine to instruct the fault machine to execute the operation of replacing the first system image file with the second system image file;
after the second system image file is sent to the fault machine, sending a starting-up instruction to the fault machine, wherein the starting-up instruction is used for indicating the fault machine to execute a starting-up operation;
judging whether the fault machine is started successfully or not;
if the starting of the fault machine fails, the following steps:
judging whether the acquired file names traverse the file names of all system image files in the fault machine or not;
and if the file names of all the system image files in the fault machine are not traversed, removing the acquired file names, acquiring the file name of the system image file in the fault machine, wherein the system image file of the fault machine corresponding to the currently acquired file name is the first system image file, and returning to execute the step of acquiring the second system image file corresponding to the file name and the subsequent steps.
The second aspect of the present application provides a fault cause detection apparatus, which is applied to a terminal device, where the terminal device is used to connect to a faulty device that cannot be powered on, and the fault cause detection apparatus includes:
the file name acquisition module is used for acquiring the file name of the first system image file of the fault machine;
the lossless file acquisition module is used for acquiring a second system image file corresponding to the file name according to the file name, wherein the second system image file is a system image file without damage;
a lossless file sending module, configured to send the second system image file to the faulty machine, so as to instruct the faulty machine to perform an operation of replacing the first system image file with the second system image file;
a boot instruction sending module, configured to send a boot instruction to the faulty machine after sending the second system image file to the faulty machine, where the boot instruction is used to instruct the faulty machine to perform a boot operation;
the starting-up success judging module is used for judging whether the fault machine is started up successfully or not;
the name traversal judging module is used for judging whether the acquired file names traverse the file names of all system image files in the fault machine or not if the fault machine fails to start up;
and the file name reselection module is used for removing the acquired file name and acquiring the file name of the system image file in the fault machine if the file names of all the system image files in the fault machine are not traversed, wherein the system image file of the fault machine corresponding to the currently acquired file name is the first system image file.
A third aspect of the present application provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect as described above.
A fifth aspect of the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method of the first aspect as described above.
Therefore, the method for detecting the fault reason is applied to the terminal equipment, firstly, the terminal equipment acquires the file name of a certain system image file of a fault machine which cannot be started, and the system image file in the fault machine corresponding to the file name is the first system image file; secondly, the terminal device acquires a second system image file which is corresponding to the file name and is not damaged according to the file name, and sends the second system image file to the fault machine so as to instruct the fault machine to execute the operation of replacing the first system image file with the received second system image file; then, the terminal equipment sends a starting-up instruction to the fault machine to indicate the fault machine to execute the starting-up operation; and finally, the terminal equipment judges whether the fault machine is started successfully, if the fault machine is started unsuccessfully, when the obtained file names do not traverse all the file names of the system image files in the fault machine, the obtained file names are removed, the file name of the system image file in the fault machine is obtained, the system image file of the fault machine corresponding to the currently obtained file name is the first system image file, the second step is returned to be executed, namely the step of obtaining the second system image file corresponding to the file name and the subsequent steps are carried out according to the currently obtained file name. Therefore, the fault cause detection method provided by the application is completely automatically completed by the terminal equipment when detecting whether a certain system image file in the fault machine which cannot be started is damaged, and does not need excessive manual participation, so that the efficiency of checking the system image file in the fault machine which cannot be started can be improved to a certain extent.
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 flow chart illustrating an implementation of a fault cause detection method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a correspondence table stored in a terminal device according to an embodiment of the present application;
fig. 3 is a schematic flow chart illustrating an implementation of another fault cause detection method provided in the second embodiment of the present application;
fig. 4 is a schematic structural diagram of a failure cause detection apparatus according to a third embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to a fourth 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.
The fault cause detection method provided by the embodiment of the application is applicable to terminal equipment, and the terminal equipment includes but is not limited to: desktop computers, cloud servers, notebooks, palm top computers, smart phones, and the like.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In addition, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Example one
The fault cause detection method provided by the first embodiment of the present application is described below, and the fault cause detection method provided by the first embodiment of the present application is applied to a terminal device, where the terminal device is used to connect to a fault machine that cannot be powered on, so as to be able to communicate with the fault machine, where the fault machine may be a smart phone, a notebook, a smart wearable device, a palm computer, a desktop computer, a cloud server, and the like that cannot be powered on. Referring to fig. 1, a method for detecting a failure cause in an embodiment of the present application includes:
in step S101, a file name of a first system image file of the faulty machine is obtained;
in this embodiment of the present application, the terminal device may pre-store file names of system image files of the fault machine, and the terminal device selects a file name from the pre-stored file names as the file name acquired in step S101; alternatively, the file name obtained in step S101 may be manually input by a tester, for example, the tester knows the file names of the system image files of the fault machine in advance, and then inputs a file name on an input interface provided by the terminal device.
In addition, in general, for a failed device that cannot be booted, the file name of each system image file of the failed device is determined by the manufacturer of the failed device. Therefore, a correspondence table may be pre-stored in the terminal device, as shown in fig. 2, the correspondence table records file names of system image files corresponding to different manufacturers, in this case, the terminal device may first obtain a manufacturer of a faulty device that is to be detected and cannot be started (for example, a tester manually inputs the manufacturer of the faulty device), and then the terminal device obtains a file name of a system image file of the faulty device according to the manufacturer and the pre-stored correspondence table, so that the terminal device may perform fault cause detection on the faulty device that is not to be started of different manufacturers, and may not only perform fault cause detection on the faulty device that is not to be started of a fixed manufacturer.
In step S102, according to the file name, a second system image file corresponding to the file name is obtained, where the second system image file is an unbroken system image file;
in this embodiment of the application, the terminal device may download, from a server, a second system image file, to be detected, of a failed machine corresponding to the file name, where the second system image file is to be detected, for example, a preset server is preset, and a system image file corresponding to the file name of each system image file of the failed machine is stored in the preset server, and the terminal device may send the file name acquired in step S101 to the preset server, so that the preset server may find the second system image file, to which the file name corresponds, without damage according to the file name, and send the found second system image file to the terminal device; or the terminal device locally stores the system image files corresponding to the file names of the system image files of the fault machine, so that the terminal device can directly find the second system image file, corresponding to the file name, of the fault machine, which is not damaged, from the local according to the file name acquired in step S101.
In addition, in some cases, the faulty devices of different manufacturers may store system image files with the same file name but different file contents, so to ensure that the terminal device can detect the cause of the fault of the faulty device of different manufacturers, in step S102, the terminal device needs to search and acquire a second system image file without damage of the faulty device according to not only the file name acquired in step S101 but also the manufacturer of the faulty device to be detected.
In step S103, sending the second system image file to the failed machine to instruct the failed machine to perform an operation of replacing the first system image file with the second system image file;
in this embodiment of the present application, if an unbroken second system image file of the failed machine corresponding to the file name is locally obtained from a server or the terminal device, the second system image file is sent to the failed machine to instruct the failed machine to execute a file replacement operation.
For a failed machine which cannot be started, electronic devices such as a processor and a hard disk therein are generally in a power-off state, and if the processor of the failed machine is in the power-off state, a file replacement operation cannot be realized, and in addition, a system image file of the failed machine is usually stored in the hard disk of the failed machine, so that in order to enable the failed machine which cannot be started to execute the file replacement operation, the processor and the hard disk of the failed machine need to be powered on, so as to ensure that the processor of the failed machine can replace a first system image file stored in the hard disk with a second system image file after receiving the second system image file.
In the embodiment of the present application, if the failed device that cannot be powered on is a smart phone, the terminal device may supply power to the failed device through a USB interface of the smart phone (as is well known, the smart phone may be powered through the USB interface, and therefore, the terminal device may supply power to the failed device through the USB interface), so as to ensure that electronic devices such as a processor and a hard disk of the failed device are in a power-on state, and in addition, since the technical solution provided by the present application requires the above-mentioned terminal device to communicate with the faulty machine, and mutual communication can also be realized through the USB interface of the faulty machine, therefore, if the fault machine is a smart phone, the terminal equipment can be connected with the USB interface of the fault machine, therefore, the communication with the fault machine can be realized through the USB interface, and the power supply to the fault machine can also be realized through the USB interface.
In step S104, after sending the second system image file to the faulty device, sending a boot instruction to the faulty device, where the boot instruction is used to instruct the faulty device to perform a boot operation;
in this embodiment of the application, the step S104 may specifically be: after the second system image file is sent to the failed machine, determining whether feedback information sent by the failed machine is received within a first preset time period (for example, 10ms), where the feedback information is used to indicate that the failed machine has completed an operation of replacing the first system image file with the second system image file; and if the feedback information is received within the first preset time period, sending a starting-up instruction to the fault machine.
According to the technical scheme provided by the application, whether the reason why the fault machine cannot be started is caused by the damage of a certain system image file needs to be judged, so that in order to improve the detection accuracy of the reason why the fault machine cannot be started, a starting instruction needs to be sent to the fault machine as soon as possible after the fault machine completes the file replacement operation. In addition, in the embodiment of the present application, if the feedback information sent by the faulty machine is not received within the first preset time period, it may be considered that the faulty machine cannot replace the first system image file with the second system image file, or that a problem occurs in the communication interface of the faulty machine for communicating with the terminal device, it may be considered that a problem occurs in an electronic device such as a processor, a hard disk, and/or a communication interface for communicating with the terminal device of the faulty machine, and the terminal device may send a prompt message to prompt a tester that a fault occurs in the electronic device such as the processor, the hard disk, and/or the communication interface for communicating with the terminal device, and may suggest that the tester repairs the fault of the electronic device such as the processor, the hard disk, and/or the communication interface for communicating with the terminal device, and then, the system image file of the fault machine is checked.
In addition, in the embodiment of the present application, the step S104 may also specifically be: and sending a starting instruction to the fault machine after sending the second system image file to a preset time length after the fault machine. That is, after the second system image file is sent, a preset time duration, for example, 5ms, is waited, and then a boot instruction is sent to the faulty machine, so as to ensure that the faulty machine has enough time to complete the file replacement operation.
In step S105, whether the failed device is successfully powered on is determined;
in the embodiment of the present application, after the power-on command is sent to the faulty device, whether the faulty device is successfully powered on is determined. Generally, for most electronic devices, a register for indicating whether the booting is successful is provided, and therefore, in the embodiment of the present application, data in the register for indicating whether the booting is successful in the faulty device may be first obtained, and then whether the booting is successful in the faulty device may be determined according to the data in the register.
In step S106, if the failed machine fails to start, determining whether the obtained file name has traversed the file names of all system image files in the failed machine, if not, removing the obtained file name, obtaining the file name of a system image file of the failed machine, where the system image file of the failed machine corresponding to the currently obtained file name is the first system image file, and returning to execute step S102;
in the embodiment of the present application, when the failed device that cannot be booted replaces the first system image file with the second system image file, the failed device still cannot be booted successfully, the reason why the failed machine cannot be started is not caused by the current first system image file breakage, therefore, the file name of another system image file of the failed device that cannot be booted can be obtained again, the system image file of the failed device corresponding to the currently obtained file name is the first system image file, and the step S102 is returned to, so that the faulty machine executes the replacement operation to the current first system image file, and judges again whether the faulty machine can be successfully started, if the faulty machine still can not be successfully started, step S106 is executed again, and steps S102-S106 are executed continuously and circularly until all system image files of the failed machine are traversed.
In addition, in the embodiment of the present application, if the failed machine still fails to be successfully booted after traversing the file names of all the system image files in the failed machine, it is described that the reason that the failed machine cannot be booted is not a damage of a certain system image file, and may be a damage of a plurality of system image files together, or the system image files of the failed machine are not damaged, the terminal device may prompt the tester that the failed machine cannot be booted is not a damage of a certain system image file, and may further prompt the tester that the failed machine cannot be booted is a damage of a plurality of system image files, or none of the system image files of the failed machine is damaged, and is caused by other reasons.
After step S105, if it is determined that the booting of the failed device is successful, it is determined that the reason why the failed device cannot be booted is that the booting is successful after the failed device that cannot be booted replaces the first system image file with the second system image file in the embodiment of the present application, which indicates that the reason why the failed device cannot be booted is that the first system image file is damaged.
The fault cause detection method provided by the embodiment of the application is completely automatically completed by the terminal device without excessive manual participation when detecting whether a certain system image file in the fault machine which cannot be started is damaged, so that the efficiency of checking the system image file in the fault machine which cannot be started can be improved to a certain extent.
Example two
Another fault cause detection method provided in the second embodiment of the present application is described below, where the fault cause detection method provided in the second embodiment is applied to a terminal device, and the terminal device is used to connect to a fault machine that cannot be powered on, so as to be able to communicate with the fault machine, where a file name of each system image file of the fault machine is also stored in the terminal device in advance, and the fault machine may be a smart phone, a notebook, an intelligent wearable device, a palm computer, a desktop computer, a cloud server, and the like that cannot be powered on. Referring to fig. 3, a method for detecting a failure cause in the second embodiment of the present application includes:
in step S201, a file name is selected from the file names of the system image files pre-stored in the terminal device, and the system image file of the faulty machine corresponding to the selected file name is a first system image file;
in the second embodiment of the present application, the terminal device selects a file name from the file names of the system image files of the fault machine stored in advance, and may select a file name at will, or select a file name according to a preset selection sequence. And the system image file of the fault machine corresponding to the selected file name is the first system image file.
In step S202, sending the file name to the faulty machine to instruct the faulty machine to execute an operation of searching for the first system image file stored in the faulty machine according to the file name, and sending the first system image file to the terminal device after the first system image file is found;
in the technical solution provided in the second embodiment of the present application, the system image file of the failed machine needs to be read back in advance, so that when a system image file is detected to be damaged, specific damaged content of the damaged system image file can be further determined. Specifically, the file name obtained in step S201 is sent to the faulty machine to instruct the faulty machine to search for the first system image file according to the file name, and send the first system image file to the terminal device. Since in the second embodiment of the present application, the failed machine needs to perform an operation of searching for a system image file, as in the first embodiment, the processor and the hard disk in the failed machine need to be powered, so that the failed machine can perform the operation of searching for the system image file.
In step S203, after the file name is sent to the failed machine, it is determined whether the first system image file sent by the failed machine is received within a second preset time period, if not, step S204 is executed, and if so, step S205 is executed.
In step S204, sending a prompt message to prompt a tester that the processor, the hard disk, and/or the communication interface for communicating with the terminal device of the fault machine are/is faulty;
in the second embodiment of the present application, it needs to be determined whether the first system image file sent by the faulty machine is received within a second preset time period (for example, 5ms), and if the first system image file is not received, it indicates that the faulty machine does not find the first system image file, or a communication interface used for communicating with the terminal device in the faulty machine fails, a prompt message may be sent to prompt a tester that an electronic device such as a processor, a hard disk, and/or a communication interface used for communicating with the terminal device of the faulty machine fails, and the tester may be suggested to check the system image file of the faulty machine after repairing the failure of the electronic device such as the processor, the hard disk, and/or the communication interface used for communicating with the terminal device.
In step S205, according to the file name, acquiring an unbroken second system image file corresponding to the file name;
in step S206, sending the second system image file to the failed machine to instruct the failed machine to perform an operation of replacing the first system image file with the second system image file;
in step S207, after the second system image file is sent to the faulty device, a boot instruction is sent to the faulty device, where the boot instruction is used to instruct the faulty device to perform a boot operation;
in step S208, it is determined whether the failed device is successfully powered on, if so, step S209 is executed, otherwise, step S211 is executed;
in step S209, it is determined that the reason why the failed device cannot be booted is due to the damage of the first system image file;
the above steps S205 to S209 are performed in the same manner as the steps S102 to S106 in the first embodiment, and reference may be specifically made to the description of the first embodiment, and no further description is provided here.
In step S210, comparing the first system image file with the second system image file to obtain damaged content in the first system image file;
according to the technical scheme provided by the second embodiment of the application, the first system image file in the failed machine is obtained first, so that the first system image file and the second system image file can be compared, and the content of the first system image file different from the second system image file is obtained, wherein the content different from the second system image file is the damaged content of the first system image file.
In the second embodiment of the present application, the file name of the damaged system image file of the failed machine and the specific damaged content of the damaged system image file may be pushed to a tester, so that the tester further determines the root cause of the failed machine that cannot be booted, for example, when the system image file X of the failed machine is damaged and the damaged content is specifically Y, the root cause of the failed machine that cannot be booted is caused by a virus in the failed machine.
In step S211, it is determined whether the selected filename has traversed through the filenames pre-saved by the terminal device, if yes, step S212 is executed, otherwise, step S213 is executed.
In step S212, the tester is prompted that the reason why the faulty device cannot be started is not simply due to the damage of a system image file;
in step S213, removing the selected file name, and then selecting a file name from the file names pre-stored in the terminal device, where the system image file of the failed machine corresponding to the currently selected file name is the first system image file;
in the second embodiment of the present application, if it is determined in step S208 that the failed machine fails to boot, it is further determined whether the selected file name has traversed through each file name pre-stored in the terminal device, and if so, it is described that the reason why the failed machine cannot boot is not that a certain system image file is damaged, and may be that multiple system image files are damaged, or the system image files of the failed machine are not damaged, the terminal device may prompt a tester that the reason why the failed machine cannot boot is not that a certain system image file is damaged, and may further prompt the tester that the failed machine cannot boot is that multiple system image files are damaged, or the system image files of the failed machine are not damaged, and are caused by other reasons. If the selected file name does not traverse all the file names pre-stored by the terminal device, selecting another file name, and returning to execute step S202.
The second embodiment of the application provides another fault cause detection method, and compared with the first embodiment, the method can further determine the specific damaged content of the damaged system image file, so that a tester can be further helped to locate the root cause of the fault machine which cannot be started, and the subsequent maintenance of the fault machine is more convenient.
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.
EXAMPLE III
The third embodiment of the present application provides a fault cause detection device, which is applied to a terminal device, where the terminal device is used to connect to a fault machine that cannot be started up, and the fault cause detection device 300 includes:
a file name obtaining module 301, configured to obtain a file name of a first system image file of the faulty machine;
a lossless file obtaining module 302, configured to obtain, according to the file name, a second system image file corresponding to the file name, where the second system image file is an unbroken system image file;
a lossless file sending module 303, configured to send the second system image file to the faulty machine, so as to instruct the faulty machine to perform an operation of replacing the first system image file with the second system image file;
a boot instruction sending module 304, configured to send a boot instruction to the faulty device after sending the second system image file to the faulty device, where the boot instruction is used to instruct the faulty device to perform a boot operation;
a startup success judging module 305, configured to judge whether the above-mentioned faulty machine is successfully started;
a name traversal judging module 306, configured to, if the failed computer fails to boot, judge whether the obtained file name has traversed the file names of all system image files in the failed computer;
a file name reselecting module 307, configured to remove the obtained file name and obtain a file name of a system image file in the failed machine if the file names of all system image files in the failed machine are not traversed, where a system image file of the failed machine corresponding to the currently obtained file name is the first system image file.
Optionally, the power-on instruction sending module 304 includes:
a feedback information receiving unit, configured to determine whether feedback information sent by the faulty machine is received within a first preset time period after the second system image file is sent to the faulty machine, where the feedback information is used to indicate that the faulty machine has completed replacing the first system image file with the second system image file;
and the starting instruction sending unit is used for sending a starting instruction to the fault machine if the feedback information is received in the first preset time period.
Optionally, the boot instruction sending module 304 is specifically configured to:
and sending a starting instruction to the fault machine after sending the second system image file to a preset time length after the fault machine.
Optionally, the lossless file obtaining module 302 is specifically configured to:
downloading a second system image file corresponding to the file name from a server according to the file name;
correspondingly, the lossless file sending module 303 is specifically configured to:
and if the second system image file is acquired from the server, sending the second system image file to the fault machine.
Optionally, the terminal device may pre-store file names of the respective system image files of the faulty machine,
accordingly, the file name obtaining module 301 is specifically configured to:
and selecting a file name from the file names of the system image files prestored in the terminal equipment, wherein the system image file of the fault machine corresponding to the selected file name is the first system image file.
Optionally, the fault cause detection apparatus further includes:
and the failure cause confirming module is used for confirming that the failure machine cannot be started due to the damage of the first system image file if the failure machine is started successfully.
Optionally, the lossless file obtaining module 302 includes:
a file name sending unit, configured to send the file name to the faulty machine, so as to instruct the faulty machine to perform an operation of searching for the first system image file stored in the faulty machine according to the file name, and after the first system image file is found, sending the first system image file to the terminal device;
the first mirror image judging unit is used for judging whether a first system mirror image file sent by the fault machine is received in a second preset time period after the file name is sent to the fault machine;
a lossless file obtaining unit, configured to, if the first system image file is received within the second preset time period, obtain, according to the file name, a second system image file that is not damaged and corresponds to the file name;
correspondingly, the failure cause confirmation module is further configured to: and if the starting of the fault machine is successful, comparing the first system image file with the second system image file to obtain damaged contents in the first system image file.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Example four
Fig. 5 is a schematic diagram of a terminal device according to a fourth embodiment of the present application, where the terminal device is used to connect to a failed device that cannot be powered on. As shown in fig. 5, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40. The processor 40 implements the steps of the various method embodiments described above, such as steps 101 to 106 shown in fig. 1, when executing the computer program 42. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the device embodiments, such as the functions of the modules 301 to 307 shown in fig. 4.
Illustratively, the computer program 42 may be divided into one or more modules/units, which are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into a file name obtaining module, a lossless file sending module, a startup instruction sending module, a startup success determining module, and a failure cause confirming module, where the specific functions of the modules are as follows:
acquiring the file name of a first system image file of the fault machine;
acquiring a second system image file which is corresponding to the file name and is not damaged according to the file name;
sending the second system image file to the fault machine to instruct the fault machine to execute the operation of replacing the first system image file with the second system image file;
after the second system image file is sent to the fault machine, sending a starting-up instruction to the fault machine, wherein the starting-up instruction is used for indicating the fault machine to execute a starting-up operation;
judging whether the fault machine is started successfully or not;
if the starting of the fault machine fails, the following steps:
judging whether the acquired file names traverse the file names of all system image files in the fault machine or not;
and if the file names of all the system image files in the fault machine are not traversed, removing the acquired file names, acquiring the file name of the system image file in the fault machine, wherein the system image file of the fault machine corresponding to the currently acquired file name is the first system image file, and returning to execute the step of acquiring the second system image file corresponding to the file name and the subsequent steps.
The terminal device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that fig. 5 is merely an example of terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided in the terminal device 4. Further, the memory 41 may include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The above-mentioned memory 41 may also be used to temporarily store data that has been output or is to be output.
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 application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the above modules or units is only one logical function division, and there may be other division manners in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
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.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. 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 include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media that does not include 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 application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should 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 application and are intended to be included within the scope of the present application.

Claims (9)

1. A fault cause detection method is applied to terminal equipment and is characterized in that the terminal equipment is used for being connected with a fault machine which cannot be started, and the fault cause detection method comprises the following steps:
acquiring a file name of a first system image file of the fault machine;
acquiring a second system image file corresponding to the file name according to the file name, wherein the second system image file is a system image file without damage;
sending the second system image file to the fault machine to instruct the fault machine to execute the operation of replacing the first system image file with the second system image file;
after the second system image file is sent to the faulty machine, sending a boot instruction to the faulty machine, including: after the second system image file is sent to the fault machine, judging whether feedback information sent by the fault machine is received within a first preset time period, wherein the feedback information is used for indicating that the fault machine finishes the operation of replacing the first system image file with the second system image file; if the feedback information is not received within the first preset time period, confirming that the fault machine cannot replace the first system image file with the second system image file, or confirming that a processor, a hard disk and/or a communication interface for communicating with the terminal equipment of the fault machine have a problem; if the feedback information is received within the first preset time period, sending a starting-up instruction to the fault machine; the starting-up instruction is used for indicating the fault machine to execute a starting-up operation;
judging whether the fault machine is started successfully or not;
if the starting of the fault machine fails, the following steps:
judging whether the acquired file names traverse the file names of all system image files in the fault machine or not;
if the file names of all system image files in the fault machine are not traversed, removing the acquired file names, acquiring the file name of the system image file in the fault machine, wherein the system image file of the fault machine corresponding to the currently acquired file name is the first system image file, and returning to execute the step of acquiring the second system image file corresponding to the file name and the subsequent steps;
if the starting of the fault machine is successful, determining that the fault machine cannot be started due to the damage of the first system image file;
and comparing the first system image file with the second system image file to obtain damaged contents in the first system image file.
2. The method for detecting the cause of the failure according to claim 1, wherein the sending a boot instruction to the failed machine after sending the second system image file to the failed machine comprises:
after the second system image file is sent to the fault machine, judging whether feedback information sent by the fault machine is received within a first preset time period, wherein the feedback information is used for indicating that the fault machine finishes replacing the first system image file with the second system image file;
and if the feedback information is received within the first preset time period, sending a starting-up instruction to the fault machine.
3. The method for detecting the cause of the failure according to claim 1, wherein the sending a boot instruction to the failed machine after sending the second system image file to the failed machine comprises:
and sending a starting-up instruction to the fault machine after a preset time length after the second system image file is sent to the fault machine.
4. The method for detecting the cause of the failure according to claim 1, wherein the obtaining the second system image file corresponding to the file name according to the file name includes:
downloading a second system image file corresponding to the file name from a server according to the file name;
correspondingly, sending the second system image file to the fault machine includes:
and if the second system image file is acquired from the server, sending the second system image file to the fault machine.
5. The method according to claim 1, wherein the file name of each system image file of the faulty machine is previously stored in the terminal device,
correspondingly, the obtaining the file name of the first system image file of the fault machine includes:
and selecting a file name from the file names of the system image files prestored in the terminal equipment, wherein the system image file of the fault machine corresponding to the selected file name is the first system image file.
6. The method for detecting the cause of the failure according to claim 1, wherein the obtaining the second system image file corresponding to the file name according to the file name includes:
sending the file name to the fault machine to instruct the fault machine to execute the operation of searching the first system image file stored in the fault machine according to the file name and sending the first system image file to the terminal equipment after the first system image file is searched;
after the file name is sent to the fault machine, whether a first system image file sent by the fault machine is received or not is judged within a second preset time period;
and if the first system image file is received within the second preset time period, acquiring a second system image file corresponding to the file name according to the file name.
7. The utility model provides a fault cause detection device, is applied to terminal equipment, its characterized in that, terminal equipment is used for linking to each other with the trouble machine that can't start, fault cause detection device includes:
the file name acquisition module is used for acquiring the file name of the first system image file of the fault machine;
the lossless file acquisition module is used for acquiring a second system image file corresponding to the file name according to the file name, wherein the second system image file is a system image file without damage;
the lossless file sending module is used for sending the second system image file to the fault machine so as to instruct the fault machine to execute the operation of replacing the first system image file with the second system image file;
the starting instruction sending module is used for sending a starting instruction to the fault machine after sending the second system image file to the fault machine, and comprises: after the second system image file is sent to the fault machine, judging whether feedback information sent by the fault machine is received within a first preset time period, wherein the feedback information is used for indicating that the fault machine finishes the operation of replacing the first system image file with the second system image file; if the feedback information is not received within the first preset time period, confirming that the fault machine cannot replace the first system image file with the second system image file, or confirming that a processor, a hard disk and/or a communication interface for communicating with the terminal equipment of the fault machine have a problem; if the feedback information is received within the first preset time period, sending a starting-up instruction to the fault machine; the starting-up instruction is used for indicating the fault machine to execute a starting-up operation;
the startup success judging module is used for judging whether the fault machine is started successfully or not;
the name traversal judging module is used for judging whether the acquired file names traverse the file names of all system image files in the fault machine or not if the fault machine fails to start up;
the file name reselection module is used for removing the acquired file name and acquiring the file name of a system image file in the fault machine if the file names of all the system image files in the fault machine are not traversed, wherein the system image file of the fault machine corresponding to the currently acquired file name is the first system image file;
the fault reason confirming module is used for confirming that the fault machine cannot be started due to the damage of the first system mirror image file if the fault machine is started successfully;
the failure cause confirming module is further configured to compare the first system image file with the second system image file, and acquire damaged content in the first system image file.
8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
9. 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 6.
CN201811284661.6A 2018-10-31 2018-10-31 Fault reason detection method, fault reason detection device and terminal equipment Active CN109446008B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811284661.6A CN109446008B (en) 2018-10-31 2018-10-31 Fault reason detection method, fault reason detection device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811284661.6A CN109446008B (en) 2018-10-31 2018-10-31 Fault reason detection method, fault reason detection device and terminal equipment

Publications (2)

Publication Number Publication Date
CN109446008A CN109446008A (en) 2019-03-08
CN109446008B true CN109446008B (en) 2022-02-08

Family

ID=65549040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811284661.6A Active CN109446008B (en) 2018-10-31 2018-10-31 Fault reason detection method, fault reason detection device and terminal equipment

Country Status (1)

Country Link
CN (1) CN109446008B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783699B (en) * 2021-02-20 2023-04-18 杭州迪普科技股份有限公司 Method and device for starting emergency mode of community enterprise operating system
CN112965847B (en) * 2021-03-03 2024-05-24 北京百度网讯科技有限公司 Fault processing method, device, equipment and storage medium of micro-service architecture

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019775A (en) * 2012-11-28 2013-04-03 北京小米科技有限责任公司 Method, device and equipment for flashing for terminal equipment
CN103310156A (en) * 2013-05-31 2013-09-18 东莞宇龙通信科技有限公司 Method and device for updating terminal system file
CN104636171A (en) * 2015-03-04 2015-05-20 深圳市欧珀通信软件有限公司 Upgrading method and device and mobile device
CN105630515A (en) * 2014-10-27 2016-06-01 西安景行数创信息科技有限公司 Dual-system mirror image guiding method
WO2016183721A1 (en) * 2015-05-15 2016-11-24 华为技术有限公司 Upgrade method, apparatus and device for terminal device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019775A (en) * 2012-11-28 2013-04-03 北京小米科技有限责任公司 Method, device and equipment for flashing for terminal equipment
CN103310156A (en) * 2013-05-31 2013-09-18 东莞宇龙通信科技有限公司 Method and device for updating terminal system file
CN105630515A (en) * 2014-10-27 2016-06-01 西安景行数创信息科技有限公司 Dual-system mirror image guiding method
CN104636171A (en) * 2015-03-04 2015-05-20 深圳市欧珀通信软件有限公司 Upgrading method and device and mobile device
WO2016183721A1 (en) * 2015-05-15 2016-11-24 华为技术有限公司 Upgrade method, apparatus and device for terminal device

Also Published As

Publication number Publication date
CN109446008A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
CN109814524B (en) Vehicle diagnosis method, device and system
CN110225078B (en) Application service updating method, system and terminal equipment
CN109446008B (en) Fault reason detection method, fault reason detection device and terminal equipment
CN111143150A (en) Method and system for testing PCBA (printed circuit board assembly), testing equipment and micro-control unit
CN108376110B (en) Automatic detection method, system and terminal equipment
CN106843947B (en) Method and device for processing code defects
CN113849272A (en) Method and device for adding GPU (graphics processing Unit) resources in virtual machine
CN106874196B (en) Automatic test exception handling method and automatic test system
CN113504932A (en) Firmware data updating method and device
CN112015587B (en) Method and device for enhancing reliability of operating system
KR102705465B1 (en) Methods for handling abnormalities, terminal devices and storage media
CN114185571A (en) Firmware upgrading method and device of CPLD, terminal and readable storage medium
CN112214413B (en) Application program testing method, device, equipment and storage medium
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
CN113485755A (en) Device driver verification method, device and storage medium
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN113515291A (en) Equipment online upgrading method and device
CN115495161B (en) BIOS option modification validation method and device and storage medium
CN113396391B (en) Application program starting method and device, electronic equipment and storage medium
CN107612786B (en) Method and system for testing router
CN114116033B (en) Method and device for modifying server configuration
CN107678917B (en) Test machine automation management method, device, equipment and storage medium
CN111124545A (en) Application program starting method and device, electronic equipment and storage medium
CN116149941A (en) Monitoring method and device of server component, server and storage medium
CN113721953A (en) Firmware program upgrading method and device and display control equipment

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