Electronic device and method for diagnosing faults

A method for diagnosing faults in products of one type includes determining a fault type of the products and all of the underlying reasons for the fault which correspond to the fault type. A probability of each underlying reason is calculated and a decision tree is constructed, a root node of the decision tree being the determined fault type and all the underlying reasons being child nodes of the root node. When the decision tree is solved, the underlying reasons for the fault of that type of product can be presented.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No. 201710611753.X filed on Jul. 25, 2017, the contents of which are incorporated by reference herein.

FIELD

The subject matter herein generally relates to fault diagnosis technology, and particularly to an electronic device and a method for diagnosing faults using the electronic device.

BACKGROUND

Mobile phones are widespread, production of such electronic devices is scaling up, and production efficiency is more demanding. At present, when the electronic device fails, a user may analyze the failure of the electronic device by checking each fault and underlying reasons through a test. It may be very time-consuming and inefficient to find a root cause of the failure.

DETAILED DESCRIPTION

FIG. 1is a block diagram of one embodiment of an electronic device1. Depending on the embodiment, the electronic device1can include, but is not limited to, a fault diagnosing system10, a storage device11, at least one processor12, a display device13, and a database14. The above components communicate with each other through a system bus. In at least one embodiment, the electronic device1can be a mobile phone, a tablet computer, a personal digital assistant, or any other suitable device.FIG. 1illustrates only one example of the electronic device1that can include more or fewer components than illustrated, or have a different configuration of the various components in other embodiments.

In at least one embodiment, the storage device11can be a memory of the electronic device1. In other embodiments, the storage device11can be a secure digital card, or other external storage device such as a smart media card.

The at least one processor12can be a central processing unit (CPU), a microprocessor, or other data processor chip that performs functions of the electronic device1.

In at least one embodiment, the display device13can be a liquid crystal display (LCD) device or an organic light-emitting diode (OLED) display device. The display device13can display diagnosis results of the products.

In at least one embodiment, the database14can store fault types and underlying reasons or possible reasons for the same (fault reasons) in products. The number of the products is high. The fault reasons of the products can be divided into many levels according to the fault types. For example, the levels can include a first level, a second level, a third level, and so on. Each level of the fault reasons can include one or more reasons. The fault types and fault reasons of the products can be dynamically added to the database14as the products are produced. A user can record fault types and fault reasons and store the fault types and fault reasons into the database14.

In at least one embodiment, a fault type may be that a target product cannot be recharged for example. When the fault type of the target product is that the product cannot be recharged, the reasons for such inability can be divided into first level reasons, second level reasons, and so on. The first level reasons can include a reason that a test device for the products was broken, that hardware element has failed, and that software of the product is malfunctioning. A probability of the reason that the test device was broken is 0.7. A probability of the reason that hardware element has failed is 0.2. A probability of the failed connecting cable reason is 0.6. A probability of the abnormal workstation reason is 0.4. When the first level reason is the hardware element failure, the second level reasons can include a broken motherboard as a reason, and that a battery of the product is worn out as an additional reason. A probability of the fault reason that the motherboard of the target product was broken is 0.6, and a probability of the worn-out battery as a fault reason is 0.4. When the first level reason is software failure, the second level reasons can include a reason that a script (e.g., Smokey script) is not working. A probability of such fault reason is 1.

FIG. 2illustrates a block diagram of one embodiment of modules of the fault diagnosing system10. In at least one embodiment, the fault diagnosing system10can include a calculating module101, a constructing module102, and a solving module103. The modules101-103include computerized codes in the form of one or more programs that may be stored in the storage device11. The computerized codes include instructions that are executed by the at least one processor12.

FIG. 3illustrates a flowchart which is presented in accordance with an example embodiment. The example method300is provided by way of example, as there are a variety of ways to carry out the method. The method300described below can be carried out using the configurations illustrated inFIG. 1, for example, and various elements of these figures are referenced in explaining example method300. Each block shown inFIG. 3represents one or more processes, methods, or subroutines, carried out in the example method300. Additionally, the illustrated order of blocks is by example only and the order of the blocks can be changed according to the present disclosure. The example method300can begin at block31. Depending on the embodiment, additional steps can be added, others removed, and the ordering of the steps can be changed.

At block31, the calculating module101can calculate a probability of each fault reason of each fault type of the products. In at least one embodiment, the probability of each fault reason is a ratio between the number of times that each fault reason appears and total number of times that all the fault reasons appear in the corresponding level of fault reasons. For example, when the first level reasons include R1, R2, and R3, the number of the fault reason R1 which may appear in the first level reasons is n1, the number of the fault reason R2 is n2, and the number of the fault reason R3 is n3. The probability of the fault reason R1 is calculated by formula

n⁢⁢1n⁢⁢1+n⁢⁢2+n⁢⁢3,
the probability of the fault reason R2 is calculated by formula

n⁢⁢2n⁢⁢1+n⁢⁢2+n⁢⁢3,
and the probability of the fault reason R3 is calculated by formula

n⁢⁢3n⁢⁢1+n⁢⁢2+n⁢⁢3.
The calculation module101can dynamically update the probability of each fault reason of each fault type of the product as additional fault types and reasons are added into the database14.

At block32, the constructing module102can construct a decision tree. A root node of the decision tree is the fault type, and all the fault reasons of that fault type are child nodes of the root node.

In at least one embodiment, the constructing module102can determine a fault type when the product is faulty, and find first level fault reasons (e.g. R1, R2, and R3) of the fault type. The calculating module101can calculate the probability of the first level fault reasons. The constructing module102further can construct the first layer of the decision tree, the root node of the first layer of the decision tree being the fault type, and all the first level fault reasons R1, R2, and R3 being the child nodes of the first layer of the decision tree. The probabilities of each of the first level fault reasons R1, R2, and R3 are weightings of the child nodes of the first layer. The constructing module102further can find second level fault reasons corresponding to the first level fault reasons, and calculate the probabilities of the second level fault reasons. The constructing module102further can construct the second layer of the decision tree, the root node of the second layer of the decision tree being each of the first level fault reasons R1, R2, and R3, and the child nodes of the second layer of the decision tree being the second level fault reasons. The probabilities of the second level fault reasons can be set by the constructing module102as weightings of the child nodes of the second layer, and so on. The decision tree will continue to be constructed until there are no other fault reasons.

FIG. 4illustrates a decision tree which fault type is the target product cannot be rechargeable. When the target product cannot be rechargeable, the fault reasons for why the target product cannot be rechargeable are divided into many levels. For example, the first level fault reasons include the reason that a test device for the products was broken, the reason that hardware of the products fails, and the reason that software of the products fails. The following text describes about a first branch of the decision tree. The first level fault reason of the first branch is that the test device for the products was broken. The constructing module102can construct the first layer of the first branch, the root node of the first layer of the first branch is that the target product cannot be rechargeable, the first level fault reason that the test device for the products was broken is the child node of the first layer of the first branch, the constructing module102can set the probability 0.7 of the first level fault reason as the weighting of the child node of the first layer of the first branch.

In at least one embodiment, when the first level fault reason is broken test device, the second level fault reasons corresponding to the first level fault reason are connecting cable failure, and abnormal workstation for the target product. The constructing module102can construct the second layer of the first branch of the decision tree. The root node of second layer of the first branch of the decision tree is broken test device, the child nodes of second layer of the first branch of the decision tree are the failed connecting cable, and the abnormal workstation. The constructing module102can set the probability 0.6 of the failed connecting cable as the weighting of the child node of the second layer of the first branch. The constructing module102can set the probability 0.4 of the abnormal workstation as the weighting of the child node of the second layer of the first branch.

In at least one embodiment, when the second level fault reason is failed connecting cable, the third level fault reasons corresponding to the second level fault reason include using a non-Kanzi cable as the fault reason, damaged cable as a fault reason, and connection of the cable wrongly as a fault reason. The constructing module102can construct the third layer of the first branch of the decision tree. The root node of third layer of the first branch of the decision tree is connecting cable failure, the child nodes of third layer of the first branch of the decision tree are the fault reasons of using non-Kanzi cable, damaged cable, and cable connection error. The constructing module102can set the probability 0.3 for using non-Kanzi cable as the weighting of the child node of the third layer of the first branch. The constructing module102can set the probability 0.4 for damaged cable as the weighting of the child node of the third layer of the first branch. The constructing module102can set the probability 0.3 for cable connection error as the weighting of the child node of the third layer of the first branch.

In at least one embodiment, when the second level fault reason is abnormal workstation, the third level fault reasons corresponding to the second level fault reason include test software failure, failed cladding, and too-slow USB charging. The constructing module102can construct the third layer of the first branch of the decision tree. The root node of third layer of the first branch of the decision tree is that abnormal workstation, and the child nodes of third layer of the first branch of the decision tree include software malfunction, cladding failure, and too-slow USB charging. The constructing module102can set the probability of 0.5 for software malfunction as the weighting of the child node of the third layer of the first branch. The constructing module102can set the probability of 0.2 for cladding failure as the weighting of the child node of the third layer of the first branch. The constructing module102can set the probability of 0.3 for too-slow USB charging as the weighting of the child node of the third layer of the first branch.

At block33, the solving module103can solve the decision tree to find the fault reason, and display the fault reason on the display device13.

In at least one embodiment, the solving module103can prune the decision tree to eliminate abnormal data. For example, the solving module103can set a predetermined probability value, and prune the branch of the decision tree when the probability of the branch is less than the predetermined probability value. The predetermined probability value can set by a user. The solving module103can calculate a probability value of each path of the decision tree by traversing the decision tree, and sort the probability values of all paths of the decision tree into a sequence of great to small, and select a top predetermined number of paths. Then the leaf nodes of the selected top predetermined number of paths correspond to the fault reason. The probability of each path of the decision tree forms the product of all the probabilities of all nodes of the path.

In at least one embodiment, the predetermined number of paths can be determined based on demand for the products. For example, when a user needs to find two fault reasons in the actual production, the solving module103can select two paths which have probability values and rank them first and second. The leaf node of the path of which the probability value is ranked first corresponds to a main reason of the fault type. The leaf node of the path of which the probability value is ranked second corresponds to a minor reason of the fault type. For example, inFIG. 4, when the predetermined probability is 0.2, the solving module103can prune the decision tree to eliminate the software malfunction, as the probability of such is less than the predetermined probability. When the predetermined number of paths is two, the solving module103can select two paths ranked first and second in terms of probability. For example, the probability of the first ranked path is 0.168, and the path includes the fault reasons as non-rechargeable product, test device failure, cable connection error, and damaged cable. The leaf node of damaged cable is the main fault reason why the product is not rechargeable. The probability of the first ranked path is 0.14, and the path includes the fault reasons as non-rechargeable product, test device failure, abnormal workstation, and software malfunction. The damaged cable leaf node is the minor reason for non-recharge ability.

In at least one embodiment, when the predetermined probability value is 0.2, the solving module103can prune the branch to remove software malfunction as a fault reason. When the predetermined number of paths is two, the solving module103can select two paths which have probability values and rank them first and second. The leaf node of the path of which the probability value is ranked first corresponds to a main reason of the fault type. The leaf node of the path of which the probability value is ranked second corresponds to a minor reason of the fault type.