WO2022211483A1 - Method and apparatus for avoiding exception - Google Patents

Method and apparatus for avoiding exception Download PDF

Info

Publication number
WO2022211483A1
WO2022211483A1 PCT/KR2022/004494 KR2022004494W WO2022211483A1 WO 2022211483 A1 WO2022211483 A1 WO 2022211483A1 KR 2022004494 W KR2022004494 W KR 2022004494W WO 2022211483 A1 WO2022211483 A1 WO 2022211483A1
Authority
WO
WIPO (PCT)
Prior art keywords
exceptional
avoidance scheme
information
exceptional situation
feature
Prior art date
Application number
PCT/KR2022/004494
Other languages
French (fr)
Inventor
Xiaodi HE
Mujun ZHANG
Cao CHEN
Jin Guo
Original Assignee
Samsung Electronics 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 Samsung Electronics Co., Ltd. filed Critical Samsung Electronics Co., Ltd.
Publication of WO2022211483A1 publication Critical patent/WO2022211483A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/004Error avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0736Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0736Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
    • G06F11/0742Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function in a data processing system embedded in a mobile device, e.g. mobile phones, handheld devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0772Means for error signaling, e.g. using interrupts, exception flags, dedicated error registers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound

Definitions

  • the present disclosure relates to the field of electronic technology. More specifically, the present disclosure relates to a method and apparatus for avoiding an exception, in particular, a system exception.
  • Exemplary embodiments according to the present disclosure provide a method and apparatus for avoiding an exception that are used to address a system exception, to solve at least the problems mentioned above.
  • a method for avoiding an exception of an electronic device may comprise: acquiring, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; determining, based on the information, an avoidance scheme for addressing the exceptional situation; and restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation.
  • the determining, based on the information, an avoidance scheme for addressing the exceptional situation may comprise: extracting an exceptional feature from the information; and determining the avoidance scheme by comparing the exceptional feature with a preset key feature.
  • the information comprises stack data
  • the exceptional feature comprises a function name contained in the stack data
  • the determining the avoidance scheme by comparing the exceptional feature with a preset key feature comprises: determining, when the exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features as the avoidance scheme.
  • the determining, based on the information, an avoidance scheme for addressing the exceptional situation may comprise: determining, based on the information, the avoidance scheme for addressing the exceptional situation and identifier information, the identifier information being used to indicate the avoidance scheme.
  • the restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation may comprise: restarting the system or the application program; and determining the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again.
  • the determining the avoidance scheme based on the identifier information to avoide the exceptional situation may comprise: determining whether to enter an exception processing function according to the identifier information; and determining, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined
  • the determining, based on the information, an avoidance scheme for addressing the exceptional situation may comprise: extracting the exceptional feature from the information; and using, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
  • the exception processing model may be obtained by: acquiring a stack associated with a plurality of exceptional situations and a corresponding avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model.
  • a training sample may comprise a key feature variable value associated with the exceptional situation and a corresponding avoidance scheme, and the key feature variable value associated with the exceptional situation is determined according to a comparison result of the exceptional feature and the preset key feature.
  • the exception processing model may be a decision tree model.
  • the avoidance scheme comprises at least one of skipping exception processing or disabling an exception to start.
  • the method for avoiding an exception may further comprise: prompting, after the exceptional situation is successfully avoided, a user that the exceptional situation is avoided and further repair processing is required.
  • an apparatus for avoiding an exception may comprise: an acquiring module, configured to acquire, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; a determining module, configured to determine, based on the information, an avoidance scheme for addressing the exceptional situation; and a processing module, configured to restart the system or the application program and use the avoidance scheme to avoid the exceptional situation.
  • the determining module may be configured to: extract an exceptional feature from the information; and determine the avoidance scheme by comparing the exceptional feature with a preset key feature.
  • the information may comprise stack data
  • the exceptional feature may comprise a function name contained in the stack data
  • the determining module may be configured to: determine, when the exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features as the avoidance scheme.
  • the determining module may be configured to: determine, based on the information, the avoidance scheme for addressing the exceptional situation and identifier information, the identifier information being used to indicate the avoidance scheme.
  • the processing module may be configured to: restart the system or the application program; and determine the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again.
  • the processing module may be configured to: determine whether to enter an exception processing function according to the identifier information; and determine, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined.
  • the determining module may be configured to: extract the exceptional feature from the information; and use, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
  • the exception processing model may be obtained by: acquiring a stack associated with a plurality of exceptional situations and a corresponding avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model.
  • the exception processing model may be a decision tree model.
  • the avoidance scheme may comprise at least one of skipping exception processing or disabling an exception to start.
  • the apparatus may further comprise a prompting module.
  • the prompting module is configured to: prompt, after the exceptional situation is successfully avoided, a user that the exceptional situation is avoided and further repair processing is required.
  • a computer readable storage medium storing an instruction.
  • the instruction when executed by a processor, implements the method for avoiding an exception according to the exemplary embodiment of the present disclosure.
  • a computing apparatus comprises a processor, and a storage device storing an instruction.
  • the instruction when executed by the processor, implements the method for avoiding an exception according to the exemplary embodiment of the present disclosure.
  • a computer program product is provided.
  • An instruction in the computer program product is run by at least one processor in an electronic apparatus, to perform the method for avoiding an exception as described above.
  • the system is automatically repaired when a system failure occurs in the electronic device, such that the electronic device can be started normally, thereby improving the user experience.
  • Fig. 1 is a flowchart of a method for avoiding an exception according to an exemplary embodiment of the present disclosure
  • Fig. 2 is a flowchart of training for an exception processing model according to an exemplary embodiment of the present disclosure
  • Fig. 3 is a schematic diagram of the exception processing model according to an exemplary embodiment of the present disclosure.
  • Fig. 4 is a block diagram of an apparatus for avoiding an exception according to an exemplary embodiment of the present disclosure
  • Fig. 5 is a schematic structural diagram of an exception processing device according to an exemplary embodiment of the present disclosure.
  • Fig. 6 is a schematic diagram of a computing apparatus according to an exemplary embodiment of the present disclosure.
  • Fig. 1 is a flowchart of a method for avoiding an exception according to an exemplary embodiment of the present disclosure.
  • the method for avoiding an exception shown in Fig. 1 may be performed in any electronic device.
  • the electronic device may include, but not limited to, a portable communication apparatus (e.g., a smart phone), a computer apparatus, a portable multimedia apparatus, a portable medical apparatus, a camera, a wearable apparatus, and the like.
  • a portable communication apparatus e.g., a smart phone
  • step S101 when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation is acquired.
  • the exceptional situation may be caused by an application installed in an electronic device, or may be caused by a system failure of the electronic device. For example, when a lunar leap month calculation logic error occurs in the system of the electronic device, a black screen situation or a frequent restart sitaution will occur in the electronic device.
  • the electronic device enters a failure mode, and thus, a user cannot normally start the electronic device. In such a situation, the electronic device may use an exception catch function to acquire the information associated with the occurred exceptional situation.
  • the acquired information may be exceptional stack data.
  • the exception catch function may acquire the related stack data in the following form (table 1).
  • an avoidance scheme for addressing the exceptional situation is determined based on the acquired information. Specifically, an exceptional feature is extracted from the acquired information, and then the avoidance scheme is determined by comparing the extracted exceptional feature with a preset key feature.
  • the avoidance scheme is determined by comparing the extracted exceptional feature with a preset key feature.
  • different combinations of key features correspond to different avoidance schemes. Therefore, when the extracted exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features may be determined as an avoidance scheme this time. For example, a corresponding feature combination may be obtained by comparing the extracted exceptional feature with the preset key feature, to recognize a corresponding avoidance scheme.
  • the exceptional feature is first extracted from the acquired information, and a feature value of a key feature variable is determined by comparing the extracted exceptional feature with a preset key feature variable. Then, an avoidance scheme matching the determined feature value is searched in preset avoidance schemes to be used as an avoidance scheme for the processing this time.
  • the exceptional feature may be a function name included in the stack data.
  • the exceptional stack data is acquired when the system failure occurs in the electronic device.
  • a function i.e., a function name
  • the exception catch function may acquire the following exceptional stack data.
  • SystemServer.main SystemServer.run
  • Looper.loop Handler.dispatchMe
  • Handler.handleCallback PostNotificationRunnable.run
  • notifyPostedLocked updateUriPermissions, grantUriPermission, and checkGrantUriPermission.
  • a function repeated in the stack data may be first removed, and then, the function included in the stack data may be extracted from the stack data.
  • Valid data such as a thread name, a key function, and a network service may be selected from data of a problem found in a previous test and data of a problem fed back by the market, and a processing countermeasure corresponding to these problems may be selected according to the data. Then, a corresponding relationship may be established between a predetermined combination of key functions and an avoidance scheme according to the valid data and the corresponding processing countermeasure.
  • the key functions may include, but not limited to, a main function, a loop function, a doFrame function, a socket function, a grantUriPermission function, and the like.
  • the extracted function may be compared with the preset key feature variable (here, which may be a key function).
  • the predetermined avoidance scheme corresponding to the predetermined combination of key features may be determined as the current avoidance scheme.
  • an exception processing model may be used to obtain a corresponding avoidance scheme.
  • the exception processing model may be, for example, a decision tree model. The exception processing model will be described in detail later with reference to Figs. 2 and 3.
  • the obtained avoidance scheme may include: determining whether to avoid an exceptional situation and how to avoid the exceptional situation. For example, in a situation where the avoidance scheme indicates that no processing is to be performed on the exceptional situation, a specific avoidance scheme (also referred to as a system exception avoidance countermeasure) may not be provided, that is, the electronic device may not automatically avoid the occurred exceptional situation. When the avoidance scheme indicates that processing is to be performed on the exceptional situation, a specific avoidance scheme may be provided.
  • a specific avoidance scheme also referred to as a system exception avoidance countermeasure
  • an exceptional situation caused by the restart of the system may be avoided or an exceptional situation caused by the restart of application program may be avoided.
  • the avoidance scheme according to the present disclosure may include at least one of: skipping exception processing or disabling an exception to start. Skipping the exception processing may include: skipping exception view drawing, skipping exception message processing, and the like. Disabling the exception to start may include: disabling a network service to start, disabling a specific subpage (Activity) of an application to start, and the like.
  • the above examples are exemplary only, and the present disclosure is not limited thereto.
  • the avoidance scheme may include, for example, skipping a view drawing operation and performing a reactivation (SkipDraw), skipping a message processing function and performing a reactivation (SkipMessage), disabling the network service to start (DisableNetwork), and processing using a system native mode (Fallback).
  • the avoidance scheme may include: skipping an exceptional view, skipping message processing, disabling an exceptional subpage (Activity) to start, and the like.
  • the above examples are merely exemplary, and the present disclosure is not limited thereto.
  • the avoidance scheme for addressing the exceptional situation may be determined based on the acquired information, the identifier information being used to indicate the determined avoidance scheme.
  • the identifier information may include one flag bit or two flag bits for subsequent processing, which will be described later.
  • a special flag bit (i.e., the identifier information) may be automatically set.
  • the purpose of setting the special flag bit is to add a hook function at the time of the restart of the system or the application program, in the situation where it is determined that the processing is to be performed on the occurred exceptional situation.
  • the hook function it may be implemented that user-defined content is inserted at a special position (i.e., a mount point) in an ordered step.
  • step S103 the system or the application program is restarted, and the determined avoidance scheme is used to address the exceptional situation. Specifically, the electronic device restarts the system or the application program due to the exceptional situation. When the exceptional situation is caught again, the avoidance scheme may be determined based on the identifier information, to avoide the exceptional situation.
  • the identifier information may include one flag bit, the flag bit simultaneously representing whether to enter the hook function and which avoidance scheme is used. For example, when being 0, the flag bit may represent no entering to the hook function. When being not 0 (e.g., greater than 0), the flag bit may represent entering to the hook function. When being 1, the flag bit represents that an avoidance scheme 1 is used to avoid the exceptional situation, when being 2, the flag bit represents that an avoidance scheme 2 is used to avoid the exceptional situation, and so on.
  • the above examples are exemplary only, and the present disclosure is not limited thereto.
  • whether to enter an exception processing function may be determined according to the identifier information. If entering to the exception processing function is determined, in the exception processing function, an avoidance scheme is determined according to the identifier information to avoid the exceptional situation.
  • the exception processing function may be implemented by the hook function.
  • the system layer of the electronic device may use the identifier information to introduce a hook function including the determined avoidance scheme into a corresponding program. Therefore, when the exceptional situation is caught again, the program enters the hook function.
  • the avoidance scheme determined in step S102 is used to avoid the occurred exceptional situation.
  • an avoidance scheme may be obtained according to step S102, and at the same time, a special flag bit ISRB_enable may be set to be equal to 2. This indicates that the hook function is added when the application SystemUI is restarted.
  • the previously obtained avoidance scheme i.e., the avoidance scheme 2 corresponding to the special flag bit
  • the hook function may be used in the hook function to avoid the exceptional situation.
  • the operating system of the electronic device automatically restarts the application SystemUI.
  • a hook function interface of the system is used to set a special hook function according to the ISRB_ enable.
  • the special hook function may be used to avoid the exceptional situation.
  • the system skips a calendar-related view of the application SystemUI in a UI drawing process, and then reactivates Looper in the program.
  • the system may adopt a corresponding avoidance scheme in the hook function according to the previously determined avoidance scheme, and reactivate Looper in the exceptional program, instead of exiting directly, such that a crash situation is avoided.
  • the identifier information may include two flag bits.
  • a first flag bit may indicate whether to enter a hook function
  • a second flag bit may indicate a used avoidance scheme.
  • the flag bits in the identifier information may be differently set using the avoidance scheme determined in step S102.
  • the present disclosure is not limited thereto.
  • the electronic device may determine whether to enter the set hook function according to the identifier information when the exceptional situation is caught again, and determine, in the hook function, the avoidance scheme according to the identifier information to avoid the exceptional situation. That is, at the time of the restart and at the time that the exceptional situation is caught again, the set hook function may be used in place of the processing function of the system itself, such that the exceptional situation is addressed in the set hook function.
  • the user is prompted that the exceptional situation is already avoided and further repair processing is required.
  • the operating system may send a broadcast in which the exceptional situation is already addressed. If the broadcast is received, it is considered that the exceptional situation is successfully addressed (i.e., the electronic device is normally powered on). Otherwise, it is considered that the exceptional situation is not successfully addressed.
  • the electronic device may upload the processing result to a cloud for update training of the exception processing model. For example, the system of the electronic device may upload successful/unsuccessful processing result, a corresponding feature value and corresponding stack data to the cloud for the cloud to train a new exception processing model. Further, when an other electronic device is connected to a network and encounters a similar exceptional situation as described above, the corresponding avoidance scheme may be invoked directly.
  • the system may automatically catch the exceptional data, extract the function name from the exceptional data, and use the exception processing model to obtain the avoidance scheme of the exception in the system, such that the electronic device intelligently modifies the system and starts normally.
  • Fig. 2 is a flowchart of training for an exception processing model according to an exemplary embodiment of the present disclosure.
  • the training for the exception processing model may be performed locally in an electronic device.
  • the training for the exception processing model may be performed by an external server, and then, the external server transmits the trained exception processing model to the electronic device.
  • step S201 a training sample is acquired.
  • Stack data of a problem i.e., an exceptional event/anomal situation
  • stack data of a problem fed back by the market and a corresponding avoidance scheme may be used as basic data.
  • Each problem has corresponding stack data.
  • a function included in each piece of stack data may be extracted from various pieces of stack data.
  • valid data such as a thread name, a key function, a network service and an avoidance scheme of successfully processing an exceptional situation may be selected from the basic data.
  • the above valid data is selected from the basic data according to expert experience.
  • key functions may be selected from the above stack data as predetermined key feature variables such as, but not limited to, a main function, a loop function, a doFrame function, a socket function and a grantUriPermission function.
  • a predetermined key feature variable is assigned a value. For example, when the extracted function includes a certain key function, the feature variable corresponding to the key function may be assigned a first value (e.g. value Y). When the extracted function does not include a certain key function, the feature variable corresponding to the key function may be assigned a second value (e.g. value N).
  • a function name in a stack is extracted, a key function name is selected as a predefined key feature variable. Whether a predetermined key function name is present in the extracted function name includes is determined, and the predetermined key feature variable is assigned a value according to a determination result. The key feature variable assigned the value and a corresponding avoidance scheme are generated into the training sample.
  • the main function, the loop function, the doFrame function, the socket function, the grantUriPermission function, and the like are used as key feature variables.
  • stack For an exceptional stack (stack), whether stack includes the main function, whether stack includes the loop function, whether stack includes the doFrame function, whether stack includes the socket function, and whether stack includes the grantUriPermission function are determined.
  • the above examples are exemplary only, and the present disclosure is not limited thereto.
  • a sample set such as a sample set in the following form (table 2):
  • a portion of the training sample may be selected according to the expert experience, to be used to obtain the exception processing model, and the other portion of the training sample is selected as a verification sample to verify the generalization capability and accuracy of the exception processing model to obtain an ideal exception processing model.
  • a function name extracted from the each stack and a corresponding avoidance scheme may be used as the training sample.
  • step S202 the training sample is used to train an exception processing model.
  • An example in which a decision tree is used as the exception processing model is described.
  • a decision tree based on a stack information feature may be constructed by using an ID3 (information entropy gain) or CART (Gini coefficient).
  • ID3 information entropy gain
  • CART Gai coefficient
  • the generalization ability and accuracy of the decision tree is then verified by using the verification sample, for example, a P-R curve is constructed. The above process is repeated until an ideal decision tree is obtained.
  • a decision tree is generation based on an ID3 algorithm.
  • the process of training the exception processing model is described.
  • the core idea of the ID3 algorithm is to measure the selection of an attribute through an information gain, and select an attribute having a maximum information gain after splitting to perform splitting.
  • the algorithm adopts top-down greedy search to traverse possible decision spaces.
  • the information entropy of a sample set S is .
  • the sample set S may be divided into S1 and S2 by the value of a key feature variable X (such as, Y/N).
  • X such as, Y/N
  • the information entropy E S1 and the information entropy E S2 may be respectively obtained.
  • the sample set S has 100 samples.
  • the sample S may be divided into sub-sample sets S/main-Y and S/main-N according to the value Y or N of the main function.
  • the sub-sample set S/main-Y has 50 samples.
  • the sub-sample set S/main-N also has 50 samples.
  • the information entropies of the divided sub-sample sets S/main-Y and S/main-N are respectively:
  • E S/main-Y -0.4log 2 (0.4)-0.2log 2 (0.2)-0.24log 2 (0.24)-0.1log 2 (0.1);
  • E S/main-N -0.2log 2 (0.2)-0.4log 2 (0.4)-0.16log 2 (0.16)-0.3log 2 (0.3).
  • the entropy gains d ES/loop , d ES/doFrame ... generated by using the each key feature variable as a sample division condition are calculated in sequence according to the above rules.
  • a key feature having a maximum entropy gain is selected as a decision node of a first layer.
  • d ES/main is the maximum entropy gain.
  • the main function may be selected as the decision node of the first layer.
  • the above process may be respectively repeated on each divided sub-sample set (here, which refers to S/main-Y and S/main-N). That is, the information entropy of the sub-sample set such as E S/main-Y is calculated.
  • the sub-sample set S/main-Y is divided into S/X-Y and S/X-N according to the each key feature variable X such as the loop function and the doFrame function (the main function being used already, and thus being excluded), and a corresponding information entropy E S/X is calculated.
  • a key feature having a maximum information entropy gain is selected as a decision node of a new layer, and the decision node is linked to a decision node of a previous layer.
  • the above process is repeated until the key feature variables are used up (already as decision nodes of the decision tree) or an information entropy of a sub-sample set is 0 (the sub-sample set is empty or the countermeasures of all sub-sample sets are the same), thus generating the decision tree.
  • the trained decision tree may be shown in Fig. 3.
  • ⁇ R>> represents a symbol of a corresponding avoidance scheme.
  • the exception processing model may be implemented by using an other neural network algorithm.
  • a corresponding set of key feature variable values is obtained by extracting the information such as the function name in the stack when the exception occurs, and is inputted into the decision tree, and the corresponding avoidance scheme is obtained through the determination of the decision tree and outputted.
  • a corresponding countermeasure i.e., skipping a view causing an exception in the UI drawing process (SkipDraw)
  • a lunar leap month calculation logic error occurs in the system.
  • De-duplicate function names main and doFrame are acquired from an exceptional stack, and then compared with a predetermined key feature variable.
  • the corresponding countermeasure SkipDraw i.e., skipping the view causing the exception in the UI drawing process
  • a corresponding countermeasure i.e., directly skipping current message processing (SkipMessage) may be obtained.
  • a corresponding countermeasure i.e., avoding a network-related service to achieve a purpose of a boot (DisableNetwork) may be obtained.
  • the key feature variable assigned the value may be inputted into the exception processing model to obtain the corresponding avoidance scheme.
  • the function extracted from the exceptional stack data may be inputted into the exception processing model, and in the exception processing model, the key feature variable is assigned the value according to the inputted function. Then, the corresponding avoidance scheme is obtained.
  • the function name in each exceptional stack may be used as an input of the exception processing model, and the avoidance scheme may be used as an output of the exception processing model. Then, a predicted avoidance scheme is compared with a corresponding real avoidance scheme to train the exception processing model.
  • Fig. 4 is a block diagram of an apparatus for avoiding an exception according to an exemplary embodiment of the present disclosure.
  • the apparatus for avoiding an exception shown in Fig. 4 may be the above electronic device, or a portion of the above electronic device.
  • the apparatus 400 for avoiding an exception may include: an acquiring module 401, a determining module 402 and a processing module 403.
  • Each module in the apparatus 400 for avoiding an exception may be implemented by one or more modules, and the name corresponding to the module may vary depending on the type of the module. In various embodiments, some of the modules in the apparatus 400 for avoiding an exception may be omitted, or additional modules may be included in the apparatus 400 for avoiding an exception.
  • modules/elements according to various embodiments of the present disclosure may be combined to form a single entity, and thus the functions of the respective modules/elements before the combination may be performed equivalently.
  • the acquiring module 401 may acquire information associated with the exceptional situation.
  • the acquired information may include exceptional stack data. For example, when an exceptional situation causes the system or an application program to restart, information associated with the exceptional situation is acquired.
  • the determining module 402 may determine an avoidance scheme for addressing the exceptional situation.
  • the determining module 402 may extract an exceptional feature from the acquired information.
  • the exceptional feature may include a function name contained in the exceptional stack data.
  • the determining module 402 may determine the avoidance scheme by comparing the exceptional feature with a preset key feature. Specifically, when the extracted exceptional feature includes a predetermined combination of key features, the determining module 402 may determine a predetermined avoidance scheme corresponding to the predetermined combination of key features as an avoidance scheme this time. For example, the determining module 402 may determine a feature value of a key feature variable by comparing the extracted exceptional feature with a preset key feature variable. Then, an avoidance scheme matching the feature value is searched in preset avoidance schemes to be used as the avoidance scheme for addressing the exceptional situation. In the present disclosure, different combinations of key features correspond to different avoidance schemes. Therefore, a corresponding feature combination may be obtained by comparing the extracted feature with the key feature variable, to recognize a corresponding avoidance scheme.
  • the preset key feature variable may be obtained by using several function names pre-selected according to expert experience as key feature variables.
  • the determining module 402 may determine whether the extracted exceptional feature includes a corresponding key feature. The determining module 402 may assign a first value to a key feature variable corresponding to the key feature, if the corresponding key feature is present in the exceptional feature; otherwise, assign a second value to the key feature variable corresponding to the key feature. Then, the determining module 402 may recognize a corresponding avoidance scheme according to the key feature variable assigned the value.
  • the processing module 403 may restart the system or the application program and use the determined avoidance scheme to address the exceptional situation. Specifically, the processing module 403 restarts the system or the application program due to the exceptional situation, and when the exceptional situation is caught again, the processing module 403 may avoid the exceptional situation according to the avoidance scheme.
  • the determining module 402 may extract the exceptional feature from the extracted exceptional information, and use, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
  • the exception processing model may be obtained from an external device communicated with the electronic device, or may be obtained locally by the electronic device through training.
  • the exception processing model may bt obtained by: acquiring a stack associated with a plurality of exceptional situations and an avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model. For example, based on the extracted function, the exception processing model is used to obtain a predicted avoidance scheme. The exception processing model is trained by comparing the predicted avoidance scheme with a real avoidance scheme.
  • the exception processing model may be a decision tree model, such as the decision tree model shown in Fig. 3.
  • a system crash situation occurs after the system of the device encounters a leap April logic error.
  • the system of the device may automatically catch an exceptional stack, acquire a function name from the exceptional stack, and input the function name into a decision tree to obtain a system exception avoidance countermeasure (i.e., skipping a view of a string resource missing in a corresponding APP), such that the device may be started normally.
  • a system exception avoidance countermeasure i.e., skipping a view of a string resource missing in a corresponding APP
  • the determining module 402 may update the exception processing model according to the extracted information and the result of the processing for the exceptional situation.
  • the apparatus 400 for avoiding an exception may further include a prompting module (not shown). After the exceptional situation is successfully avoided, the prompting module may prompt a user that the exceptional situation is already avoided and further repair processing is required.
  • Fig. 5 is a schematic structural diagram of an exception processing device according to an exemplary embodiment of the present disclosure.
  • the device in Fig. 5 may automatically modify a system failure, thereby avoiding a crash situation or a situation of entering a failure model.
  • the exception processing device 500 may include a processing component 501, a communication bus 502, a network interface 503, an input/output interface 504, a storage device 505, and a power supply component 506.
  • the communication bus 502 is used to implement a connection communication between these components.
  • the input/output interface 504 may include a video display (e.g., a liquid crystal display), a microphone and speaker, and a user interaction interface (e.g., a keyboard, a mouse, a touch input apparatus).
  • the input/output interface 504 may further include a standard wired interface and a standard wireless interface.
  • the network interface 503 may alternatively include a standard wired interface and a standard wireless interface (e.g., a wireless fidelity interface).
  • the storage device 505 may be a high-speed random access memory or a stable non-volatile storage device.
  • the storage device 505 may alternatively also be a storage apparatus independent of the above processing component 501.
  • Fig. 5 does not constitute a limitation to the exception processing device 500, and may include more or less components than those illustrated, or a combination of some components, or different component arrangements.
  • the storage device 505 may include an operating system (e.g., an MAC operating system), a data storage module, a network communication module, a user interface module, an exception processing program, an application program and a database.
  • an operating system e.g., an MAC operating system
  • the network interface 503 is mainly used for data communication with an external device/terminal.
  • the input/output interface 504 is mainly used for data interaction with a user.
  • the processing component 501 and the storage device 505 in the exception processing device 500 may be provided in the exception processing device 500, and the exception processing device 500 calls the exception processing program stored in the storage device 505 through the processing component 501, to perform the method for avoiding an exception provided according to embodiments of the present disclosure.
  • the processing component 501 may include at least one processor, and the storage device 505 stores a computer executable instruction set.
  • the computer executable instruction set when executed by the at least one processor, performs the method for avoiding an exception according to the embodiments of the present disclosure.
  • the above examples are exemplary only, and the present disclosure is not limited thereto.
  • the processing component 501 may acquire information associated with the exceptional situation.
  • the acquired information may include exceptional stack data. For example, when an exceptional situation causes the system or an application program to restart, information associated with the exceptional situation is acquired.
  • the processing component 501 may determine an avoidance scheme for addressing the exceptional situation.
  • the processing component 501 may extract an exceptional feature from the acquired information.
  • the exceptional featu re may include a function name contained in the exceptional stack data.
  • the processing component 501 may determine the avoidance scheme by comparing the exceptional feature with a preset key feature.
  • the processing component 501 may determine a predetermined avoidance scheme corresponding to the predetermined combination of key features as an avoidance scheme this time. For example, the processing component 501 may determine a feature value of a key feature variable by comparing the extracted exceptional feature with a preset key feature variable. Then, an avoidance scheme matching the feature value is searched in preset avoidance schemes to be used as the avoidance scheme for addressing the exceptional situation.
  • the preset key feature variable may be obtained by using several function names pre-selected according to expert experience as key feature variables.
  • the processing component 501 may determine whether the extracted exceptional feature includes a corresponding key feature. The processing component 501 may assign a first value to a key feature variable corresponding to the key feature, if the corresponding key feature is present in the exceptional feature; otherwise, assign a second value to the key feature variable corresponding to the key feature.
  • the processing component 501 may use the determined avoidance scheme to address the exceptional situation. Specifically, the processing component 501 may restart the system or the application program, catch the exceptional situation again, and address the exceptional situation according to a system exception avoidance countermeasure in the avoidance scheme.
  • the processing component 501 when determining the avoidance scheme based on the extracted information, the processing component 501 further determines corresponding identifier information for subsequent processing.
  • the processing component 501 may extract the exceptional feature from the extracted exceptional information, and use, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
  • the exception processing model may be obtained from an external device communicated with the exception processing device, or may be obtained locally by the exception processing device through training.
  • the exception processing model may bt obtained by: acquiring a stack associated with a plurality of exceptional situations and an avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model.
  • the exception processing model is used to obtain a predicted avoidance scheme.
  • the exception processing model is trained by comparing the predicted avoidance scheme with a real avoidance scheme.
  • the exception processing model may be a decision tree model, such as the decision tree model shown in Fig. 3.
  • the processing component 501 restarts the system or the application program due to the exceptional situation; and determines the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again.
  • the processing component 501 may determine whether to enter an exception processing function according to the identifier information; and determine, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined.
  • the processing component 501 may update the exception processing model according to the extracted information and the result of the processing for the exceptional situation.
  • the processing component 501 may send, via the input/output interface 504, information (e.g., stack data) and a processing result for an exceptional situation addressed this time to an external device having the exception processing model, for the external device to perform update training on the exception processing model.
  • the exception processing device 500 may be a PC computer, a tablet, a personal digital assistant, a smart phone, or other apparatuses capable of executing the above instruction set.
  • the exception processing device 500 is not necessarily a single electronic device, but may be any collection of apparatuses or circuits capable of separately or jointly executing the above instruction (or instruction set).
  • the exception processing device 500 may also be a portion of an integrated control system or system manager, or may be configured as a portable electronic device interconnected locally or remotely (e.g., via wireless transmission) through an interface.
  • the processing component 501 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic apparatus, a dedicated processor system, a microcontroller, or a microprocessor.
  • the processing component 501 may further include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and the like.
  • the processing component 501 may run the instructions or codes stored in the storage device.
  • the storage device 505 may further store data.
  • the instructions and data may also be transmitted and received over the network via the network interface 503.
  • the network interface 503 may employ any known transmission protocol.
  • the storage device 505 may be integrated with a processor, for example, a RAM or flash memory is disposed within an integrated circuit microprocessor or the like.
  • the storage device 505 may include a separate apparatus, such as an external disk drive, a storage array, or other storage apparatuses that any database system may use.
  • the storage device and the processing component 501 may be operatively coupled, or may communicate with each other (e.g., through an I/O port and a network connection), to enable the processing component 501 to read the data stored in the storage device 505.
  • Fig. 6 is a schematic diagram of a computing apparatus according to an exemplary embodiment of the present disclosure.
  • the computing apparatus 600 includes a storage device 601 storing a computer program, and a processor 602.
  • the computer program when executed by the processor 602, implements the method for avoiding an exception according to the exemplary embodiments of the present disclosure.
  • the computer program when executed by the processor 602, the computer program may implement: acquiring, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; determining, based on the information, an avoidance scheme for addressing the exceptional situation; and restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation.
  • the system may catch exception information and analyze the exception information, and then obtain an avoidance scheme using a decision tree and according to the analysis result.
  • the system may set a special flag bit.
  • the system or an APP is restarted due to an exceptional situation, the system may set a user-defined exception processing function (add a hook function) according to the special flag bit.
  • the program enters the hook function, and in the hook function, a corresponding countermeasure in the avoidance scheme is used to address/avoid the caught exceptional situation.
  • the electronic device may determine whether the system or the APP is normally started according to the above processing, and then record a successful or unsuccessful processing scheme and upload the processing scheme to a cloud. When an other device encounters a similar problem, the corresponding processing scheme may be called directly.
  • the computing apparatus in the embodiment of the present disclosure may include, but not limited to, an apparatus such as a mobile phone, a notebook computer, a PDA (Personal Digital Assistant), a PAD (tablet computer), and a desktop computer.
  • an apparatus such as a mobile phone, a notebook computer, a PDA (Personal Digital Assistant), a PAD (tablet computer), and a desktop computer.
  • the computing apparatus shown in Fig. 6 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • module may include a unit implemented by hardware, software or firmware, and may interchangeably be used with other terms, for example, “logic,” “logic block,” “portion,” or “circuit.”
  • the module may be a single integrated part or a minimum unit or portion of the part, adapted to perform one or more functions.
  • the module may be implemented in the form of an application specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • Various embodiments as set forth herein may be implemented as software including one or more instructions stored in a storage medium and readable by a machine (e.g., a mobile apparatus).
  • a processor of the machine may call and execute at least one of the one or more instructions stored in the storage medium, with or without using one or more other parts under the control of the processor. This enables the machine to be operated to perform at least one function according to the at least one called instruction.
  • the one or more instructions may include a code generated by a complier or a code executable by an interpreter.
  • a machine readable storage medium may be provided in the form of a non-transitory storage medium.
  • non-transitory simply means that the storage medium is a tangible apparatus, and does not include a signal (e.g., an electromagnetic wave), but this term does not differentiate between a case where data is semi-permanently stored in the storage medium and a case where the data is temporarily stored in the storage medium.
  • a signal e.g., an electromagnetic wave
  • a method may be included and provided in a computer program product.
  • the computer program product may be traded as a product between a seller and a buyer.
  • the computer program product may be distributed in the form of a machine readable storage medium (e.g., compact disc read only memory (CD-ROM)), or distributed (e.g., downloaded or uploaded) online via an application store (e.g., Play Store TM ), or between two user apparatuses (e.g., smart phones) directly. If the computer program product is distributed online, at least portion of the computer program product may be temporarily generated or at least temporarily stored in the machine readable storage medium such as a storage device of a server of the manufacturer, a server of the application store, or a relay server.
  • CD-ROM compact disc read only memory
  • an application store e.g., Play Store TM
  • two user apparatuses e.g., smart phones
  • each part (e.g., module or program) of the above parts may include a single entity or a plurality of entities.
  • the storage device 601 may include one or more storage devices, and the processor 602 may include one or more processors.
  • one or more of the above parts may be omitted, or one or more other parts may be added.
  • a plurality of parts e.g., modules or programs
  • the integrated part may still perform one or more functions of each of the plurality of parts in the same or similar way as that in which the one or more functions are performed by a corresponding one of the plurality of parts before the integration.
  • operations performed by the module, the program, or an other part may be performed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations may be executed in a different order, or omitted, or one or more other operations may be added.
  • At least one of the plurality of modules may be implemented by an AI model.
  • the function associated with the AI may be performed by a non-volatile storage device, a volatile storage device, and a processor.
  • the processor may include one or more processors.
  • the one or more processors may be a general purpose processor (e.g., a central processing unit (CPU) and an application processor (AP)), a processor for graphics only (e.g., a graphics processing unit (GPU), a visual processing unit (VPU)), and/or an AI application specific processor (e.g., a neural processing unit (NPU)).
  • a general purpose processor e.g., a central processing unit (CPU) and an application processor (AP)
  • a processor for graphics only e.g., a graphics processing unit (GPU), a visual processing unit (VPU)
  • an AI application specific processor e.g., a neural processing unit (NPU)
  • the one or more processors control the processing on inputted data according to a predefined operating rule or the artificial intelligence (AI) model stored in the non-volatile storage device and the volatile storage device.
  • the predefined operating rule or the artificial intelligence model may be provided through training or learning.
  • the providing through the learning means that a predefined operation rule or an AI model with an expected characteristic is formed by applying a learning algorithm to a plurality of pieces of learning data.
  • the learning may be performed in a device performing the AI according to an embodiment, and/or may be implemented by a separate server/device/system.
  • the artificial intelligence model may consist of a plurality of neural network layers. Each layer has a plurality of weight values, and a layer operation is performed through a calculation of the previous layer and an operation of the plurality of weight values.
  • a neural network include, but not limited to, a convolutional neural network (CNN), a deep neural network (DNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a depth belief network (DBN), a bidirectional recurrent depth neural network (BRDNN), a generative adversarial network (GAN), and a deep Q network.
  • a learning algorithm may refer to a method of using a plurality of pieces of learning data to train a predetermined target device (e.g., a robot) to cause, allow, or control the target device to make a determination or prediction.
  • a predetermined target device e.g., a robot
  • Examples of the learning algorithm include, but not limited to, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning.
  • an image matching corresponding time or a corresponding place can be quickly and precisely selected for a user, which saves the operating time of the user, thus improving the user experience.

Abstract

The present disclosure provides a method and apparatus for avoiding an exception. The method for avoiding an exception may comprise: acquiring, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; determining, based on the information, an avoidance scheme for addressing the exceptional situation; and restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation. According to the present disclosure, the exceptional situation occurring in the electronic device may be automatically repaired, which avoids the problem that the device cannot be normally started and even the system crashes, thereby improving the user experience.

Description

METHOD AND APPARATUS FOR AVOIDING EXCEPTION
The present disclosure relates to the field of electronic technology. More specifically, the present disclosure relates to a method and apparatus for avoiding an exception, in particular, a system exception.
With the development of electronic technology, there are a large number of APPs/Services on a system platform, such as an Android platform. When these APPs/Services run on a system of an electronic device, an exceptional situation may occur or the system may be crashed, thus making the electronic device work slowly, and even preventing the electronic device from being started normally. When the system are frequently crashed, the electronic device would eventually enter a failure mode.
When a failure occurs in the system of the electronic device, the most manufacturers will adopt a method of mainly restoring settings that the factory originally configured, to repair the failure of the system, which however would waste the time of a user, and lose the customer data, etc.
Exemplary embodiments according to the present disclosure provide a method and apparatus for avoiding an exception that are used to address a system exception, to solve at least the problems mentioned above.
According to an exemplary embodiment of the present disclosure, a method for avoiding an exception of an electronic device is provided. The method for avoiding an exception may comprise: acquiring, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; determining, based on the information, an avoidance scheme for addressing the exceptional situation; and restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation.
Alternatively, the determining, based on the information, an avoidance scheme for addressing the exceptional situation may comprise: extracting an exceptional feature from the information; and determining the avoidance scheme by comparing the exceptional feature with a preset key feature.
Alternatively, the information comprises stack data, and the exceptional feature comprises a function name contained in the stack data.
Alternatively, the determining the avoidance scheme by comparing the exceptional feature with a preset key feature comprises: determining, when the exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features as the avoidance scheme.
Alternatively, the determining, based on the information, an avoidance scheme for addressing the exceptional situation may comprise: determining, based on the information, the avoidance scheme for addressing the exceptional situation and identifier information, the identifier information being used to indicate the avoidance scheme. Here, the restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation may comprise: restarting the system or the application program; and determining the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again.
Alternatively, the determining the avoidance scheme based on the identifier information to avoide the exceptional situation may comprise: determining whether to enter an exception processing function according to the identifier information; and determining, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined
Alternatively, the determining, based on the information, an avoidance scheme for addressing the exceptional situation may comprise: extracting the exceptional feature from the information; and using, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
Alternatively, the exception processing model may be obtained by: acquiring a stack associated with a plurality of exceptional situations and a corresponding avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model.
Alternatively, a training sample may comprise a key feature variable value associated with the exceptional situation and a corresponding avoidance scheme, and the key feature variable value associated with the exceptional situation is determined according to a comparison result of the exceptional feature and the preset key feature.
Alternatively, the exception processing model may be a decision tree model.
Alternatively, the avoidance scheme comprises at least one of skipping exception processing or disabling an exception to start.
Alternatively, the method for avoiding an exception may further comprise: prompting, after the exceptional situation is successfully avoided, a user that the exceptional situation is avoided and further repair processing is required.
According to another exemplary embodiment of the present disclosure, an apparatus for avoiding an exception is provided. The apparatus may comprise: an acquiring module, configured to acquire, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; a determining module, configured to determine, based on the information, an avoidance scheme for addressing the exceptional situation; and a processing module, configured to restart the system or the application program and use the avoidance scheme to avoid the exceptional situation.
Alternatively, the determining module may be configured to: extract an exceptional feature from the information; and determine the avoidance scheme by comparing the exceptional feature with a preset key feature.
Alternatively, the information may comprise stack data, and the exceptional feature may comprise a function name contained in the stack data.
Alternatively, the determining module may be configured to: determine, when the exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features as the avoidance scheme.
Alternatively, the determining module may be configured to: determine, based on the information, the avoidance scheme for addressing the exceptional situation and identifier information, the identifier information being used to indicate the avoidance scheme. Here, the processing module may be configured to: restart the system or the application program; and determine the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again.
Alternatively, the processing module may be configured to: determine whether to enter an exception processing function according to the identifier information; and determine, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined.
Alternatively, the determining module may be configured to: extract the exceptional feature from the information; and use, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
Alternatively, the exception processing model may be obtained by: acquiring a stack associated with a plurality of exceptional situations and a corresponding avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model.
Alternatively, the exception processing model may be a decision tree model.
Alternatively, the avoidance scheme may comprise at least one of skipping exception processing or disabling an exception to start.
Alternatively, the apparatus may further comprise a prompting module. The prompting module is configured to: prompt, after the exceptional situation is successfully avoided, a user that the exceptional situation is avoided and further repair processing is required.
According to an exemplary embodiment of the present disclosure, a computer readable storage medium storing an instruction is provided. The instruction, when executed by a processor, implements the method for avoiding an exception according to the exemplary embodiment of the present disclosure.
According to an exemplary embodiment of the present disclosure, a computing apparatus is provided. The computing apparatus comprises a processor, and a storage device storing an instruction. The instruction, when executed by the processor, implements the method for avoiding an exception according to the exemplary embodiment of the present disclosure.
According to an exemplary embodiment of the present disclosure, a computer program product is provided. An instruction in the computer program product is run by at least one processor in an electronic apparatus, to perform the method for avoiding an exception as described above.
According to the present disclosure, the system is automatically repaired when a system failure occurs in the electronic device, such that the electronic device can be started normally, thereby improving the user experience.
A portion of other aspects and/or advantages of the overall concept of the present disclosure will be explained in the following description, and an other portion of the other aspects and/or advantages will be apparent through the description or may be learned through the implementation of the overall concept of the present disclosure.
By combining the accompanying drawings, these and/or other aspects and advantages of the present disclosure will become apparent and more readily understood from the following description of the embodiments. In the accompanying drawings:
Fig. 1 is a flowchart of a method for avoiding an exception according to an exemplary embodiment of the present disclosure;
Fig. 2 is a flowchart of training for an exception processing model according to an exemplary embodiment of the present disclosure;
Fig. 3 is a schematic diagram of the exception processing model according to an exemplary embodiment of the present disclosure;
Fig. 4 is a block diagram of an apparatus for avoiding an exception according to an exemplary embodiment of the present disclosure;
Fig. 5 is a schematic structural diagram of an exception processing device according to an exemplary embodiment of the present disclosure; and
Fig. 6 is a schematic diagram of a computing apparatus according to an exemplary embodiment of the present disclosure.
The following specific embodiments are provided to help the reader obtain an overall understanding of the method, device and/or system described herein. However, after the understanding for the disclosure of the present application, various changes, modifications and equivalents of the method, device and/or system described herein will be apparent. For example, the order of operations described herein is exemplary only and not limited to the order set forth herein, but may be changed as apparent from the understanding of the disclosure of the present application, except for the operations that must occur in a particular order. Furthermore, for clarity and conciseness, descriptions for features known in the art may be omitted.
The features described herein may be implemented in different forms and should not be construed as being limited to the examples described herein. Rather, the examples described herein are provided to illustrate only some of many possible ways of implementing the method, device and/or system described herein, and the many possible ways will be apparent after the understanding of the disclosure of the present application.
The term used herein is only for describing various examples and is not intended to limit the present disclosure. The singular form is intended to include the plural form, unless the context clearly indicates otherwise. The terms "include," "comprise" and "have" indicate the presence of the stated features, numbers, operations, members, elements, and/or groups thereof, but do not preclude the presence or addition of one or more other features, numbers, operations, members, elements, and/or groups thereof.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present disclosure belongs. Terms such as those defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and should not be interpreted in an idealized or overly formal sense, unless expressly so defined herein.
It should be noted that the terms "first," "second" and the like in the specification and claims of the present disclosure and the accompanying drawings are used to distinguish similar objects, and not necessarily used to describe a specific order or an order of priority. It should be understood that the data used in this way may be interchanged in an appropriate situation, such that the embodiments of the present disclosure that are described herein can be implemented in an order other than that illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, the implementations are merely examples of the apparatus and method consistent with some aspects of the present disclosure and described in detail in the claims.
Furthermore, in the description for the examples, when it is considered that the detailed description for the well-known related structure or function will lead to an ambiguous explanation for the present disclosure, such detailed description will be omitted.
Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings However, the embodiments may be implemented in various forms, and are not limited to the examples described herein.
Fig. 1 is a flowchart of a method for avoiding an exception according to an exemplary embodiment of the present disclosure. Here, the method for avoiding an exception shown in Fig. 1 may be performed in any electronic device.
In the exemplary embodiment of the present disclosure, the electronic device may include, but not limited to, a portable communication apparatus (e.g., a smart phone), a computer apparatus, a portable multimedia apparatus, a portable medical apparatus, a camera, a wearable apparatus, and the like.
Referring to Fig. 1, in step S101, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation is acquired. According to an embodiment of the present disclosure, the exceptional situation may be caused by an application installed in an electronic device, or may be caused by a system failure of the electronic device. For example, when a lunar leap month calculation logic error occurs in the system of the electronic device, a black screen situation or a frequent restart sitaution will occur in the electronic device. Finally, the electronic device enters a failure mode, and thus, a user cannot normally start the electronic device. In such a situation, the electronic device may use an exception catch function to acquire the information associated with the occurred exceptional situation.
In the present disclosure, the acquired information may be exceptional stack data. For example, when the lunar leap month calculation logic error occurs in the system of the electronic device, the exception catch function may acquire the related stack data in the following form (table 1).
[8.086222][iF-A][6oo1] Process: com.android.systemui, PID: 7514
[8.086274][iF-A][6oo1]java.lang.NoSuchFieldError : No static field common_date_leap_month of type I in class Lcom/samsung/android/uniform/R$string; or its superclasses (declaration of 'com.samsung.android.uniform.R$string' appears in /system/priv-app/AODService_v40/AODService_v40.apk)
[ 8.086424][iF-A][6oo1] at com.samsung.android.uniform.widget.LocalDateView.getLunarCalendarInChina(LocalDateView.java:319)
[ 8.086515][iF-A][6oo1] at com.samsung.android.uniform.widget.LocalDateView.updateLocaleDate(LocalDateView.java:69)
[ 8.086602][iF-A][6oo1] at com.samsung.android.uniform.widget.LocalDateView.onFinishInflate(LocalDateView.java:46)
[ 8.086693][iF-A][6oo1] at android.view.LayoutInflater.rInflate(LayoutInflater.java:876)
[ 8.086768][iF-A][6oo1] at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
...
[ 8.090357][iF-A][6oo1] at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2295)
[ 8.090432][iF-A][6oo1] at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1853)
[ 8.090504][iF-A][6oo1] at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8476)
[ 8.090582][iF-A][6oo1] at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
[ 8.090658][iF-A][6oo1] at android.view.Choreographer.doCallbacks(Choreographer.java:761)
[ 8.090732][iF-A][6oo1] at android.view.Choreographer.doFrame(Choreographer.java:696)
[ 8.090804][iF-A][6oo1] at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
[ 8.090883][iF-A][6oo1] at android.os.Handler.handleCallback(Handler.java:873)
[ 8.090939][iF-A][6oo1] at android.os.Handler.dispatchMessage(Handler.java:99)
[ 8.090996][iF-A][6oo1] at android.os.Looper.loop(Looper.java:214)
[ 8.091048][iF-A][6oo1] at android.app.ActivityThread.main(ActivityThread.java:7045)
[ 8.091107][iF-A][6oo1] at java.lang.reflect.Method.invoke(Native Method)
[ 8.091162][iF-A][6oo1] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[ 8.091229][iF-A][6oo1] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
However, the above example is exemplary only, and the present disclosure is not limited thereto.
In step S102, an avoidance scheme for addressing the exceptional situation is determined based on the acquired information. Specifically, an exceptional feature is extracted from the acquired information, and then the avoidance scheme is determined by comparing the extracted exceptional feature with a preset key feature. Here, different combinations of key features correspond to different avoidance schemes. Therefore, when the extracted exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features may be determined as an avoidance scheme this time. For example, a corresponding feature combination may be obtained by comparing the extracted exceptional feature with the preset key feature, to recognize a corresponding avoidance scheme.
As an example, the exceptional feature is first extracted from the acquired information, and a feature value of a key feature variable is determined by comparing the extracted exceptional feature with a preset key feature variable. Then, an avoidance scheme matching the determined feature value is searched in preset avoidance schemes to be used as an avoidance scheme for the processing this time. Here, the exceptional feature may be a function name included in the stack data.
As an example, the exceptional stack data is acquired when the system failure occurs in the electronic device. A function (i.e., a function name) included in this stack may be extracted from the stack. For example, in an exceptional situation where a boot failure is caused by a permission exception, the exception catch function may acquire the following exceptional stack data.
E AndroidRuntime:!@***FATAL EXCEPTION IN SYSTEM PROCESS: main
E:java.lang.SecurityException: UID 1010308 does not have permission to content://media/external/audio/media/390 [user 0]
E: at com.android.server.uri.UriGrantsManagerService.checkGrantUriPermission(UriGrantsManagerService.java:1202)
E: at com.android.server.uri.UriGrantsManagerService.grantUriPermission(UriGrantsManagerService.java:771)
E: at com.android.server.uri.UriGrantsManagerService.grantUriPermissionFromOwner(UriGrantsManagerService.java:212)
E: at com.android.server.notification.NotificationManagerService.grantUriPermission(NotificationManagerService.java:7675)
E: at com.android.server.notification.NotificationManagerService.updateUriPermissions(NotificationManagerService.java:7647)
E: at com.android.server.notification.NotificationManagerService$NotificationListeners.notifyPostedLocked(NotificationManagerService.java:9055)
E: at com.android.server.notification.NotificationManagerService$NotificationListeners.notifyPostedLocked(NotificationManagerService.java:9001)
E: at com.android.server.notification.NotificationManagerService$PostNotificationRunnable.run(NotificationManagerService.java:6123)
E: at android.os.Handler.handleCallback(Handler.java:883)
E: at android.os.Handler.dispatchMessage(Handler.java:100)
E: at android.os.Looper.loop(Looper.java:237)
E: at com.android.server.SystemServer.run(SystemServer.java:932)
E: at com.android.server.SystemServer.main(SystemServer.java:726)
E: at java.lang.reflect.Method.invoke(Native Method)
By analyzing the exceptional stack data, the following functions may be extracted: SystemServer.main, SystemServer.run, Looper.loop, Handler.dispatchMe, Handler.handleCallback, PostNotificationRunnable.run, notifyPostedLocked, updateUriPermissions, grantUriPermission, and checkGrantUriPermission.
Further, after the exceptional stack data is acquired, a function repeated in the stack data may be first removed, and then, the function included in the stack data may be extracted from the stack data.
Valid data such as a thread name, a key function, and a network service may be selected from data of a problem found in a previous test and data of a problem fed back by the market, and a processing countermeasure corresponding to these problems may be selected according to the data. Then, a corresponding relationship may be established between a predetermined combination of key functions and an avoidance scheme according to the valid data and the corresponding processing countermeasure. For example, the key functions may include, but not limited to, a main function, a loop function, a doFrame function, a socket function, a grantUriPermission function, and the like.
For example, after the extraction for the function in the exceptional stack data is completed, the extracted function may be compared with the preset key feature variable (here, which may be a key function). When the extracted function includes the predetermined combination of key features, the predetermined avoidance scheme corresponding to the predetermined combination of key features may be determined as the current avoidance scheme.
As another example, based on the extracted feature, an exception processing model may be used to obtain a corresponding avoidance scheme. The exception processing model may be, for example, a decision tree model. The exception processing model will be described in detail later with reference to Figs. 2 and 3.
According to an embodiment of the present disclosure, the obtained avoidance scheme may include: determining whether to avoid an exceptional situation and how to avoid the exceptional situation. For example, in a situation where the avoidance scheme indicates that no processing is to be performed on the exceptional situation, a specific avoidance scheme (also referred to as a system exception avoidance countermeasure) may not be provided, that is, the electronic device may not automatically avoid the occurred exceptional situation. When the avoidance scheme indicates that processing is to be performed on the exceptional situation, a specific avoidance scheme may be provided.
According to an embodiment of the present disclosure, an exceptional situation caused by the restart of the system may be avoided or an exceptional situation caused by the restart of application program may be avoided. The avoidance scheme according to the present disclosure may include at least one of: skipping exception processing or disabling an exception to start. Skipping the exception processing may include: skipping exception view drawing, skipping exception message processing, and the like. Disabling the exception to start may include: disabling a network service to start, disabling a specific subpage (Activity) of an application to start, and the like. The above examples are exemplary only, and the present disclosure is not limited thereto.
For the exceptional situation caused by the restart of the system, the avoidance scheme may include, for example, skipping a view drawing operation and performing a reactivation (SkipDraw), skipping a message processing function and performing a reactivation (SkipMessage), disabling the network service to start (DisableNetwork), and processing using a system native mode (Fallback). However, the above examples are merely exemplary, and the present disclosure is not limited thereto. For the exceptional situation caused by the restart of the application, the avoidance scheme may include: skipping an exceptional view, skipping message processing, disabling an exceptional subpage (Activity) to start, and the like. However, the above examples are merely exemplary, and the present disclosure is not limited thereto.
In addition, in the process of determining, based on the acquired information, the avoidance scheme for addressing the exceptional situation, the avoidance scheme for addressing the exceptional situation and the identifier information may be determined based on the acquired information, the identifier information being used to indicate the determined avoidance scheme. Here, the identifier information may include one flag bit or two flag bits for subsequent processing, which will be described later.
As an example, when the determined avoidance scheme indicates that the processing is to be performed on the exceptional situation, a special flag bit (i.e., the identifier information) may be automatically set. The purpose of setting the special flag bit is to add a hook function at the time of the restart of the system or the application program, in the situation where it is determined that the processing is to be performed on the occurred exceptional situation. According to the hook function, it may be implemented that user-defined content is inserted at a special position (i.e., a mount point) in an ordered step. When an event is triggered, and the event is caught at a system level, the hook function performs some operations accordingly.
In step S103, the system or the application program is restarted, and the determined avoidance scheme is used to address the exceptional situation. Specifically, the electronic device restarts the system or the application program due to the exceptional situation. When the exceptional situation is caught again, the avoidance scheme may be determined based on the identifier information, to avoide the exceptional situation.
As an example, the identifier information may include one flag bit, the flag bit simultaneously representing whether to enter the hook function and which avoidance scheme is used. For example, when being 0, the flag bit may represent no entering to the hook function. When being not 0 (e.g., greater than 0), the flag bit may represent entering to the hook function. When being 1, the flag bit represents that an avoidance scheme 1 is used to avoid the exceptional situation, when being 2, the flag bit represents that an avoidance scheme 2 is used to avoid the exceptional situation, and so on. However, the above examples are exemplary only, and the present disclosure is not limited thereto.
In this situation, whether to enter an exception processing function may be determined according to the identifier information. If entering to the exception processing function is determined, in the exception processing function, an avoidance scheme is determined according to the identifier information to avoid the exceptional situation. Here, the exception processing function may be implemented by the hook function. When the system or application is restarted, the system layer of the electronic device may use the identifier information to introduce a hook function including the determined avoidance scheme into a corresponding program. Therefore, when the exceptional situation is caught again, the program enters the hook function. In the hook function, the avoidance scheme determined in step S102 is used to avoid the occurred exceptional situation.
For example, after an exception occurs in an application SystemUI of the electronic device, an avoidance scheme may be obtained according to step S102, and at the same time, a special flag bit ISRB_enable may be set to be equal to 2. This indicates that the hook function is added when the application SystemUI is restarted. When a corresponding exceptional situation is caught again, the previously obtained avoidance scheme (i.e., the avoidance scheme 2 corresponding to the special flag bit) may be used in the hook function to avoid the exceptional situation.
Next, the operating system of the electronic device automatically restarts the application SystemUI. At the initial stage of the restart of the application SystemUI, a hook function interface of the system is used to set a special hook function according to the ISRB_ enable. When the exceptional situation is caught again, the special hook function may be used to avoid the exceptional situation.
For example, after the exceptional situation is intercepted, according to the avoidance scheme SkipDraw determined in step S102, the system skips a calendar-related view of the application SystemUI in a UI drawing process, and then reactivates Looper in the program.
According to an embodiment of the present disclosure, when an exception occurs, exceptional data will be intercepted by an inserted hook function. In this case, the system may adopt a corresponding avoidance scheme in the hook function according to the previously determined avoidance scheme, and reactivate Looper in the exceptional program, instead of exiting directly, such that a crash situation is avoided.
As another embodiment, the identifier information may include two flag bits. Here, a first flag bit may indicate whether to enter a hook function, and a second flag bit may indicate a used avoidance scheme. The flag bits in the identifier information may be differently set using the avoidance scheme determined in step S102. However, the present disclosure is not limited thereto.
When the application program or the system is restarted due to the exceptional situation, the electronic device may determine whether to enter the set hook function according to the identifier information when the exceptional situation is caught again, and determine, in the hook function, the avoidance scheme according to the identifier information to avoid the exceptional situation. That is, at the time of the restart and at the time that the exceptional situation is caught again, the set hook function may be used in place of the processing function of the system itself, such that the exceptional situation is addressed in the set hook function.
After the exceptional situation is successfully avoided, the user is prompted that the exceptional situation is already avoided and further repair processing is required. For example, when the electronic device is normally powered on after the above processing, the operating system may send a broadcast in which the exceptional situation is already addressed. If the broadcast is received, it is considered that the exceptional situation is successfully addressed (i.e., the electronic device is normally powered on). Otherwise, it is considered that the exceptional situation is not successfully addressed. The electronic device may upload the processing result to a cloud for update training of the exception processing model. For example, the system of the electronic device may upload successful/unsuccessful processing result, a corresponding feature value and corresponding stack data to the cloud for the cloud to train a new exception processing model. Further, when an other electronic device is connected to a network and encounters a similar exceptional situation as described above, the corresponding avoidance scheme may be invoked directly.
According to an embodiment of the present disclosure, when the exception occurs in the system of the electronic device, the system may automatically catch the exceptional data, extract the function name from the exceptional data, and use the exception processing model to obtain the avoidance scheme of the exception in the system, such that the electronic device intelligently modifies the system and starts normally.
Fig. 2 is a flowchart of training for an exception processing model according to an exemplary embodiment of the present disclosure. Here, the training for the exception processing model may be performed locally in an electronic device. Alternatively, the training for the exception processing model may be performed by an external server, and then, the external server transmits the trained exception processing model to the electronic device.
In step S201, a training sample is acquired. Stack data of a problem (i.e., an exceptional event/anomal situation) found in a test, stack data of a problem fed back by the market, and a corresponding avoidance scheme may be used as basic data. Each problem has corresponding stack data. For the stack data of the each problem, a function included in each piece of stack data may be extracted from various pieces of stack data.
In addition, valid data such as a thread name, a key function, a network service and an avoidance scheme of successfully processing an exceptional situation may be selected from the basic data. For example, the above valid data is selected from the basic data according to expert experience. For example, several key functions may be selected from the above stack data as predetermined key feature variables such as, but not limited to, a main function, a loop function, a doFrame function, a socket function and a grantUriPermission function.
Then, by determining whether a function extracted from each stack includes a predetermined key function, a predetermined key feature variable is assigned a value. For example, when the extracted function includes a certain key function, the feature variable corresponding to the key function may be assigned a first value (e.g. value Y). When the extracted function does not include a certain key function, the feature variable corresponding to the key function may be assigned a second value (e.g. value N).
For example, a function name in a stack is extracted, a key function name is selected as a predefined key feature variable. Whether a predetermined key function name is present in the extracted function name includes is determined, and the predetermined key feature variable is assigned a value according to a determination result. The key feature variable assigned the value and a corresponding avoidance scheme are generated into the training sample.For example, the main function, the loop function, the doFrame function, the socket function, the grantUriPermission function, and the like are used as key feature variables. For an exceptional stack (stack), whether stack includes the main function, whether stack includes the loop function, whether stack includes the doFrame function, whether stack includes the socket function, and whether stack includes the grantUriPermission function are determined. It is assumed that a boot failure is caused by a permission exception, sample feature values [main=Y, loop=Y, doFrame=N, socket=N, grantUriPermission=Y, ...] may be obtained according to the above approach, and a countermeasure for this exceptional situation is SkipMessage. However, the above examples are exemplary only, and the present disclosure is not limited thereto.
In the process of obtaining the training sample, a large number of problem cases may be tagged, thus obtaining a sample set such as a sample set in the following form (table 2):
Key feature variable Main Loop DoFrame Socket GrantUriPermission ... Decision result
Feature value of training sample 1 Y Y N N Y ... Looper Activator
Feature value of training sample 2 Y Y Y N N ... SkipDraw
Message
Feature value of training sample 3 N N N N N ... Fallback
Draw
... ... ... ... ... ... ... ...
However, the above examples are exemplary only, and the present disclosure is not limited thereto.
A portion of the training sample may be selected according to the expert experience, to be used to obtain the exception processing model, and the other portion of the training sample is selected as a verification sample to verify the generalization capability and accuracy of the exception processing model to obtain an ideal exception processing model.
Alternatively, a function name extracted from the each stack and a corresponding avoidance scheme may be used as the training sample.
In step S202, the training sample is used to train an exception processing model. An example in which a decision tree is used as the exception processing model is described. A decision tree based on a stack information feature may be constructed by using an ID3 (information entropy gain) or CART (Gini coefficient). The generalization ability and accuracy of the decision tree is then verified by using the verification sample, for example, a P-R curve is constructed. The above process is repeated until an ideal decision tree is obtained.
For example, a decision tree is generation based on an ID3 algorithm. On this basis, the process of training the exception processing model is described. The core idea of the ID3 algorithm is to measure the selection of an attribute through an information gain, and select an attribute having a maximum information gain after splitting to perform splitting. The algorithm adopts top-down greedy search to traverse possible decision spaces.
The information entropy of a sample set S is
Figure PCTKR2022004494-appb-img-000001
. Here,
Figure PCTKR2022004494-appb-img-000002
represents a probability that a countermeasure (i.e., an avoidance scheme) of a sample is i. It is assumed that the sample set S may be divided into S1 and S2 by the value of a key feature variable X (such as, Y/N). According to the above equation, the information entropy ES1 and the information entropy ES2 may be respectively obtained. The information entropy after the division is ES/X= ES1+ES2, and thus the information entropy gain dES/X =ES/X-ES may be obtained.
It is assumed that the sample set S has 100 samples. Here, there are 30 samples of which the countermeasures are SkipDraw, and the probability of such kind of samples is 0.3. There are 30 samples of which the countermeasures are SkipMessage, and the probability of such kind of samples is 0.3. There are 20 samples of which the countermeasures are DisableNetwork, and the probability of such kind of samples is 0.2. There are 20 samples of which the countermeasures are Fallback, and the probability of such kind of samples is 0.2. At this point, the information entropy is ES=-0.3log2(0.3)-0.3log2(0.3)-0.2log2(0.2)-0.2log2(0.2).
It is also assumed that the sample S may be divided into sub-sample sets S/main-Y and S/main-N according to the value Y or N of the main function. The sub-sample set S/main-Y has 50 samples. Here, there are 20 samples of which the countermeasures are SkipDraw, and the probability of such kind of samples is 0.4. There are 10 samples of which the countermeasures are SkipMessage, and the probability of such kind of samples is 0.2. There are 12 samples of which the countermeasures are DisableNetwork, and the probability of such kind of samples is 0.24. There are 5 samples of which the countermeasures are Fallback, and the probability of such kind of samples is 0.1. The sub-sample set S/main-N also has 50 samples. Here, there are 10 samples of which the countermeasures are SkipDraw, and the probability of such kind of samples is 0.2. There are 20 samples of which the countermeasures are SkipMessage, and the probability of such kind of samples is 0.4. There are 8 samples of which the countermeasures are DisableNetwork, and the probability of such kind of samples is 0.16. There are 15 samples of which the countermeasures are Fallback, and the probability of such kind of samples is 0.3.
The information entropies of the divided sub-sample sets S/main-Y and S/main-N are respectively:
ES/main-Y=-0.4log2(0.4)-0.2log2(0.2)-0.24log2(0.24)-0.1log2(0.1); and
ES/main-N=-0.2log2(0.2)-0.4log2(0.4)-0.16log2(0.16)-0.3log2(0.3).
The total information entropy after the division is ES/main = ES/main-Y + ES/main-N. Thus, the information entropy gain after the division is performed according the main function may be obtained as dES/main =ES/main -ES.
The entropy gains dES/loop, dES/doFrame ... generated by using the each key feature variable as a sample division condition are calculated in sequence according to the above rules. A key feature having a maximum entropy gain is selected as a decision node of a first layer. For example, dES/main is the maximum entropy gain. Thus, the main function may be selected as the decision node of the first layer.
The above process may be respectively repeated on each divided sub-sample set (here, which refers to S/main-Y and S/main-N). That is, the information entropy of the sub-sample set such as ES/main-Y is calculated. The sub-sample set S/main-Y is divided into S/X-Y and S/X-N according to the each key feature variable X such as the loop function and the doFrame function (the main function being used already, and thus being excluded), and a corresponding information entropy ES/X is calculated. The information entropy gain dES/X=ES/X-ES is calculated. A key feature having a maximum information entropy gain is selected as a decision node of a new layer, and the decision node is linked to a decision node of a previous layer.
The above process is repeated until the key feature variables are used up (already as decision nodes of the decision tree) or an information entropy of a sub-sample set is 0 (the sub-sample set is empty or the countermeasures of all sub-sample sets are the same), thus generating the decision tree. The trained decision tree may be shown in Fig. 3. Here, <<R>> represents a symbol of a corresponding avoidance scheme. The above example is exemplary only, and the present disclosure is not limited thereto. Alternatively, the exception processing model may be implemented by using an other neural network algorithm.
After the decision tree is trained, a corresponding set of key feature variable values is obtained by extracting the information such as the function name in the stack when the exception occurs, and is inputted into the decision tree, and the corresponding avoidance scheme is obtained through the determination of the decision tree and outputted.
As an example, according to a decision tree shown in Fig. 3, whether an exceptional APP is in a main thread (main) is determined. After it is determined that the exceptional APP is in the main thread, whether the exceptional APP is in a UI drawing process (doFrame) is determined. After it is determined that the exceptional APP is in the UI drawing process, a corresponding countermeasure (i.e., skipping a view causing an exception in the UI drawing process (SkipDraw)) may be obtained. For example, a lunar leap month calculation logic error occurs in the system. De-duplicate function names main and doFrame are acquired from an exceptional stack, and then compared with a predetermined key feature variable. All predetermined key feature variables are assigned values, thus obtaining feature values [main=Y, loop=N, doFrame=Y, socket=N, grantUriPermission=N, ...]. By inputting the feature values into a trained decision tree, the corresponding countermeasure SkipDraw (i.e., skipping the view causing the exception in the UI drawing process) may be obtained, such that the system is repaired to be normal.
As another example, according to the decision tree shown in Fig. 3, whether the exceptional APP is in the main thread (main) is determined. After it is determined that the exceptional APP is in the main thread, whether the exceptional APP is in the UI drawing process (doFrame) is determined. After it is determined that the exceptional APP is not in the UI drawing process, whether there is a permission exception (grantUriPermission) is determined. After the permission exception is determined, a corresponding countermeasure (i.e., directly skipping current message processing (SkipMessage)) may be obtained.
As yet another example, according to the decision tree shown in Fig. 3, whether the exceptional APP is in the main thread (main) is determined. After it is determined that the exceptional APP is not in the main thread, whether the exceptional APP is currently in a network thread (socket) is determined. After it is determined that the exceptional APP is currently in the network thread, a corresponding countermeasure (i.e., avoding a network-related service to achieve a purpose of a boot (DisableNetwork) may be obtained.
According to the above embodiment, the key feature variable assigned the value may be inputted into the exception processing model to obtain the corresponding avoidance scheme. Alternatively, the function extracted from the exceptional stack data may be inputted into the exception processing model, and in the exception processing model, the key feature variable is assigned the value according to the inputted function. Then, the corresponding avoidance scheme is obtained.
According to an embodiment of the present disclosure, the function name in each exceptional stack may be used as an input of the exception processing model, and the avoidance scheme may be used as an output of the exception processing model. Then, a predicted avoidance scheme is compared with a corresponding real avoidance scheme to train the exception processing model.
Fig. 4 is a block diagram of an apparatus for avoiding an exception according to an exemplary embodiment of the present disclosure. The apparatus for avoiding an exception shown in Fig. 4 may be the above electronic device, or a portion of the above electronic device.
Referring to Fig. 4, the apparatus 400 for avoiding an exception may include: an acquiring module 401, a determining module 402 and a processing module 403. Each module in the apparatus 400 for avoiding an exception may be implemented by one or more modules, and the name corresponding to the module may vary depending on the type of the module. In various embodiments, some of the modules in the apparatus 400 for avoiding an exception may be omitted, or additional modules may be included in the apparatus 400 for avoiding an exception. Furthermore, modules/elements according to various embodiments of the present disclosure may be combined to form a single entity, and thus the functions of the respective modules/elements before the combination may be performed equivalently.
When an exceptional situation occurs in a system of an electronic device, the acquiring module 401 may acquire information associated with the exceptional situation. Here, the acquired information may include exceptional stack data. For example, when an exceptional situation causes the system or an application program to restart, information associated with the exceptional situation is acquired.
Based on the acquired information, the determining module 402 may determine an avoidance scheme for addressing the exceptional situation.
The determining module 402 may extract an exceptional feature from the acquired information. Here, the exceptional feature may include a function name contained in the exceptional stack data.
The determining module 402 may determine the avoidance scheme by comparing the exceptional feature with a preset key feature. Specifically, when the extracted exceptional feature includes a predetermined combination of key features, the determining module 402 may determine a predetermined avoidance scheme corresponding to the predetermined combination of key features as an avoidance scheme this time. For example, the determining module 402 may determine a feature value of a key feature variable by comparing the extracted exceptional feature with a preset key feature variable. Then, an avoidance scheme matching the feature value is searched in preset avoidance schemes to be used as the avoidance scheme for addressing the exceptional situation. In the present disclosure, different combinations of key features correspond to different avoidance schemes. Therefore, a corresponding feature combination may be obtained by comparing the extracted feature with the key feature variable, to recognize a corresponding avoidance scheme.
In a situation where the exceptional feature is the function name included in the exceptional stack data, the preset key feature variable may be obtained by using several function names pre-selected according to expert experience as key feature variables.
The determining module 402 may determine whether the extracted exceptional feature includes a corresponding key feature. The determining module 402 may assign a first value to a key feature variable corresponding to the key feature, if the corresponding key feature is present in the exceptional feature; otherwise, assign a second value to the key feature variable corresponding to the key feature. Then, the determining module 402 may recognize a corresponding avoidance scheme according to the key feature variable assigned the value.
The processing module 403 may restart the system or the application program and use the determined avoidance scheme to address the exceptional situation. Specifically, the processing module 403 restarts the system or the application program due to the exceptional situation, and when the exceptional situation is caught again, the processing module 403 may avoid the exceptional situation according to the avoidance scheme.
As another example, the determining module 402 may extract the exceptional feature from the extracted exceptional information, and use, based on the exceptional feature, an exception processing model to obtain the avoidance scheme. The exception processing model may be obtained from an external device communicated with the electronic device, or may be obtained locally by the electronic device through training.
The exception processing model may bt obtained by: acquiring a stack associated with a plurality of exceptional situations and an avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model. For example, based on the extracted function, the exception processing model is used to obtain a predicted avoidance scheme. The exception processing model is trained by comparing the predicted avoidance scheme with a real avoidance scheme. For example, the exception processing model may be a decision tree model, such as the decision tree model shown in Fig. 3.
As an example, a system crash situation occurs after the system of the device encounters a leap April logic error. At this point, the system of the device may automatically catch an exceptional stack, acquire a function name from the exceptional stack, and input the function name into a decision tree to obtain a system exception avoidance countermeasure (i.e., skipping a view of a string resource missing in a corresponding APP), such that the device may be started normally.
In addition, the determining module 402 may update the exception processing model according to the extracted information and the result of the processing for the exceptional situation.
In addition, the apparatus 400 for avoiding an exception may further include a prompting module (not shown). After the exceptional situation is successfully avoided, the prompting module may prompt a user that the exceptional situation is already avoided and further repair processing is required.
Fig. 5 is a schematic structural diagram of an exception processing device according to an exemplary embodiment of the present disclosure. The device in Fig. 5 may automatically modify a system failure, thereby avoiding a crash situation or a situation of entering a failure model.
As shown in Fig. 5, the exception processing device 500 may include a processing component 501, a communication bus 502, a network interface 503, an input/output interface 504, a storage device 505, and a power supply component 506. Here, the communication bus 502 is used to implement a connection communication between these components. The input/output interface 504 may include a video display (e.g., a liquid crystal display), a microphone and speaker, and a user interaction interface (e.g., a keyboard, a mouse, a touch input apparatus). Alternatively, the input/output interface 504 may further include a standard wired interface and a standard wireless interface. The network interface 503 may alternatively include a standard wired interface and a standard wireless interface (e.g., a wireless fidelity interface). The storage device 505 may be a high-speed random access memory or a stable non-volatile storage device. The storage device 505 may alternatively also be a storage apparatus independent of the above processing component 501.
It may be appreciated by those skilled in the art that the structure shown in Fig. 5 does not constitute a limitation to the exception processing device 500, and may include more or less components than those illustrated, or a combination of some components, or different component arrangements.
As shown in Fig. 5, the storage device 505, as a storage medium, may include an operating system (e.g., an MAC operating system), a data storage module, a network communication module, a user interface module, an exception processing program, an application program and a database.
In the exception processing device 500 shown in Fig. 5, the network interface 503 is mainly used for data communication with an external device/terminal. The input/output interface 504 is mainly used for data interaction with a user. The processing component 501 and the storage device 505 in the exception processing device 500 may be provided in the exception processing device 500, and the exception processing device 500 calls the exception processing program stored in the storage device 505 through the processing component 501, to perform the method for avoiding an exception provided according to embodiments of the present disclosure.
The processing component 501 may include at least one processor, and the storage device 505 stores a computer executable instruction set. The computer executable instruction set, when executed by the at least one processor, performs the method for avoiding an exception according to the embodiments of the present disclosure. However, the above examples are exemplary only, and the present disclosure is not limited thereto.
When an exceptional situation occurs in a system of an electronic device, the processing component 501 may acquire information associated with the exceptional situation. Here, the acquired information may include exceptional stack data. For example, when an exceptional situation causes the system or an application program to restart, information associated with the exceptional situation is acquired.
Based on the acquired information, the processing component 501 may determine an avoidance scheme for addressing the exceptional situation.
The processing component 501 may extract an exceptional feature from the acquired information. Here, the exceptional featu re may include a function name contained in the exceptional stack data.
The processing component 501 may determine the avoidance scheme by comparing the exceptional feature with a preset key feature. When the extracted exceptional feature includes a predetermined combination of key features, the processing component 501 may determine a predetermined avoidance scheme corresponding to the predetermined combination of key features as an avoidance scheme this time. For example, the processing component 501 may determine a feature value of a key feature variable by comparing the extracted exceptional feature with a preset key feature variable. Then, an avoidance scheme matching the feature value is searched in preset avoidance schemes to be used as the avoidance scheme for addressing the exceptional situation. In a situation where the exceptional feature is the function name included in the exceptional stack data, the preset key feature variable may be obtained by using several function names pre-selected according to expert experience as key feature variables.
The processing component 501 may determine whether the extracted exceptional feature includes a corresponding key feature. The processing component 501 may assign a first value to a key feature variable corresponding to the key feature, if the corresponding key feature is present in the exceptional feature; otherwise, assign a second value to the key feature variable corresponding to the key feature.
When the system or the application program is restarted due to the exceptional situation, the processing component 501 may use the determined avoidance scheme to address the exceptional situation. Specifically, the processing component 501 may restart the system or the application program, catch the exceptional situation again, and address the exceptional situation according to a system exception avoidance countermeasure in the avoidance scheme.
In addition, when determining the avoidance scheme based on the extracted information, the processing component 501 further determines corresponding identifier information for subsequent processing.
As another example, the processing component 501 may extract the exceptional feature from the extracted exceptional information, and use, based on the exceptional feature, an exception processing model to obtain the avoidance scheme. The exception processing model may be obtained from an external device communicated with the exception processing device, or may be obtained locally by the exception processing device through training. The exception processing model may bt obtained by: acquiring a stack associated with a plurality of exceptional situations and an avoidance scheme; extracting a function from the stack; assigning, by comparing the extracted function with a preset key function variable, a value to a key function variable; and using the key function variable assigned the value and a corresponding avoidance scheme to train the exception processing model. In addition, based on the extracted function, the exception processing model is used to obtain a predicted avoidance scheme. The exception processing model is trained by comparing the predicted avoidance scheme with a real avoidance scheme. For example, the exception processing model may be a decision tree model, such as the decision tree model shown in Fig. 3.
The processing component 501 restarts the system or the application program due to the exceptional situation; and determines the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again. The processing component 501 may determine whether to enter an exception processing function according to the identifier information; and determine, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined.
In addition, the processing component 501 may update the exception processing model according to the extracted information and the result of the processing for the exceptional situation. Alternatively, the processing component 501 may send, via the input/output interface 504, information (e.g., stack data) and a processing result for an exceptional situation addressed this time to an external device having the exception processing model, for the external device to perform update training on the exception processing model.
As an example, the exception processing device 500 may be a PC computer, a tablet, a personal digital assistant, a smart phone, or other apparatuses capable of executing the above instruction set. Here, the exception processing device 500 is not necessarily a single electronic device, but may be any collection of apparatuses or circuits capable of separately or jointly executing the above instruction (or instruction set). The exception processing device 500 may also be a portion of an integrated control system or system manager, or may be configured as a portable electronic device interconnected locally or remotely (e.g., via wireless transmission) through an interface.
In the exception processing device 500, the processing component 501 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic apparatus, a dedicated processor system, a microcontroller, or a microprocessor. As an example rather than a limitation, the processing component 501 may further include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and the like.
The processing component 501 may run the instructions or codes stored in the storage device. Here, the storage device 505 may further store data. The instructions and data may also be transmitted and received over the network via the network interface 503. Here, the network interface 503 may employ any known transmission protocol.
The storage device 505 may be integrated with a processor, for example, a RAM or flash memory is disposed within an integrated circuit microprocessor or the like. In addition, the storage device 505 may include a separate apparatus, such as an external disk drive, a storage array, or other storage apparatuses that any database system may use. The storage device and the processing component 501 may be operatively coupled, or may communicate with each other (e.g., through an I/O port and a network connection), to enable the processing component 501 to read the data stored in the storage device 505.
Fig. 6 is a schematic diagram of a computing apparatus according to an exemplary embodiment of the present disclosure.
Referring to Fig. 6, the computing apparatus 600 according to the exemplary embodiment of the present disclosure includes a storage device 601 storing a computer program, and a processor 602. The computer program, when executed by the processor 602, implements the method for avoiding an exception according to the exemplary embodiments of the present disclosure.
As an example, when executed by the processor 602, the computer program may implement: acquiring, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation; determining, based on the information, an avoidance scheme for addressing the exceptional situation; and restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation.
When an exception occurs in a system of an electronic device, the system may catch exception information and analyze the exception information, and then obtain an avoidance scheme using a decision tree and according to the analysis result. When the avoidance scheme indicates that processing is to be performed on the exception, the system may set a special flag bit. When the system or an APP is restarted due to an exceptional situation, the system may set a user-defined exception processing function (add a hook function) according to the special flag bit. When the exceptional situation is caught again, the program enters the hook function, and in the hook function, a corresponding countermeasure in the avoidance scheme is used to address/avoid the caught exceptional situation. The electronic device may determine whether the system or the APP is normally started according to the above processing, and then record a successful or unsuccessful processing scheme and upload the processing scheme to a cloud. When an other device encounters a similar problem, the corresponding processing scheme may be called directly.
The computing apparatus in the embodiment of the present disclosure may include, but not limited to, an apparatus such as a mobile phone, a notebook computer, a PDA (Personal Digital Assistant), a PAD (tablet computer), and a desktop computer. The computing apparatus shown in Fig. 6 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
As used herein, the term "module" may include a unit implemented by hardware, software or firmware, and may interchangeably be used with other terms, for example, "logic," "logic block," "portion," or "circuit." The module may be a single integrated part or a minimum unit or portion of the part, adapted to perform one or more functions. For example, according to an embodiment, the module may be implemented in the form of an application specific integrated circuit (ASIC).
Various embodiments as set forth herein may be implemented as software including one or more instructions stored in a storage medium and readable by a machine (e.g., a mobile apparatus). For example, a processor of the machine may call and execute at least one of the one or more instructions stored in the storage medium, with or without using one or more other parts under the control of the processor. This enables the machine to be operated to perform at least one function according to the at least one called instruction. The one or more instructions may include a code generated by a complier or a code executable by an interpreter. A machine readable storage medium may be provided in the form of a non-transitory storage medium. Here, the term "non-transitory" simply means that the storage medium is a tangible apparatus, and does not include a signal (e.g., an electromagnetic wave), but this term does not differentiate between a case where data is semi-permanently stored in the storage medium and a case where the data is temporarily stored in the storage medium.
According to an embodiment, a method according to various embodiments of the present disclosure may be included and provided in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a machine readable storage medium (e.g., compact disc read only memory (CD-ROM)), or distributed (e.g., downloaded or uploaded) online via an application store (e.g., Play StoreTM), or between two user apparatuses (e.g., smart phones) directly. If the computer program product is distributed online, at least portion of the computer program product may be temporarily generated or at least temporarily stored in the machine readable storage medium such as a storage device of a server of the manufacturer, a server of the application store, or a relay server.
According to various embodiments, each part (e.g., module or program) of the above parts may include a single entity or a plurality of entities. For example, in Fig. 6, the storage device 601 may include one or more storage devices, and the processor 602 may include one or more processors. According to various embodiments, one or more of the above parts may be omitted, or one or more other parts may be added. Alternatively or additionally, a plurality of parts (e.g., modules or programs) may be integrated into a single part. In this case, according to various embodiments, the integrated part may still perform one or more functions of each of the plurality of parts in the same or similar way as that in which the one or more functions are performed by a corresponding one of the plurality of parts before the integration. According to various embodiments, operations performed by the module, the program, or an other part may be performed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations may be executed in a different order, or omitted, or one or more other operations may be added.
At least one of the plurality of modules may be implemented by an AI model. The function associated with the AI may be performed by a non-volatile storage device, a volatile storage device, and a processor.
The processor may include one or more processors. At this time, the one or more processors may be a general purpose processor (e.g., a central processing unit (CPU) and an application processor (AP)), a processor for graphics only (e.g., a graphics processing unit (GPU), a visual processing unit (VPU)), and/or an AI application specific processor (e.g., a neural processing unit (NPU)).
The one or more processors control the processing on inputted data according to a predefined operating rule or the artificial intelligence (AI) model stored in the non-volatile storage device and the volatile storage device. The predefined operating rule or the artificial intelligence model may be provided through training or learning. Here, the providing through the learning means that a predefined operation rule or an AI model with an expected characteristic is formed by applying a learning algorithm to a plurality of pieces of learning data. The learning may be performed in a device performing the AI according to an embodiment, and/or may be implemented by a separate server/device/system.
As an example, the artificial intelligence model may consist of a plurality of neural network layers. Each layer has a plurality of weight values, and a layer operation is performed through a calculation of the previous layer and an operation of the plurality of weight values. Examples of a neural network include, but not limited to, a convolutional neural network (CNN), a deep neural network (DNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a depth belief network (DBN), a bidirectional recurrent depth neural network (BRDNN), a generative adversarial network (GAN), and a deep Q network.
A learning algorithm may refer to a method of using a plurality of pieces of learning data to train a predetermined target device (e.g., a robot) to cause, allow, or control the target device to make a determination or prediction. Examples of the learning algorithm include, but not limited to, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning.
According to the present disclosure, an image matching corresponding time or a corresponding place can be quickly and precisely selected for a user, which saves the operating time of the user, thus improving the user experience.
The present disclosure is shown and described with reference to the exemplary embodiments thereof. However, it should be appreciated by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure as defined by the claims.

Claims (15)

  1. A method for avoiding an exception of an electronic device, comprising:
    acquiring, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation;
    determining, based on the information, an avoidance scheme for addressing the exceptional situation; and
    restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation.
  2. The method according to claim 1, wherein the determining, based on the information, an avoidance scheme for addressing the exceptional situation comprises:
    extracting an exceptional feature from the information; and
    determining the avoidance scheme by comparing the exceptional feature with a preset key feature.
  3. The method according to claim 2, wherein the information comprises stack data, and the exceptional feature comprises a function name contained in the stack data.
  4. The method according to claim 2, wherein the determining the avoidance scheme by comparing the exceptional feature with a preset key feature comprises:
    determining, when the exceptional feature includes a predetermined combination of key features, a predetermined avoidance scheme corresponding to the predetermined combination of key features as the avoidance scheme.
  5. The method according to claim 1, wherein the determining, based on the information, an avoidance scheme for addressing the exceptional situation comprises:
    determining, based on the information, the avoidance scheme for addressing the exceptional situation and identifier information,
    wherein the identifier information is used to indicate the avoidance scheme,
    wherein the restarting the system or the application program and using the avoidance scheme to avoid the exceptional situation comprises:
    restarting the system or the application program; and determining the avoidance scheme based on the identifier information to avoide the exceptional situation, when the exceptional situation occurs again.
  6. The method according to claim 5, wherein the determining the avoidance scheme based on the identifier information to avoide the exceptional situation comprises:
    determining whether to enter an exception processing function according to the identifier information; and determining, in the exception processing function, the avoidance scheme according to the identifier information to avoid the exceptional situation, if entering to the exception processing function is determined.
  7. The method according to claim 1, wherein the determining, based on the information, an avoidance scheme for addressing the exceptional situation comprises:
    extracting the exceptional feature from the information; and
    using, based on the exceptional feature, an exception processing model to obtain the avoidance scheme.
  8. The method according to claim 7, wherein the exception processing model is obtained by:
    acquiring training data, the training data including a plurality of groups of training samples; and
    using the training data to train the exception processing model.
  9. The method according to claim 8, wherein the training samples comprise a key feature variable value associated with the exceptional situation and a corresponding avoidance scheme,
    wherein the key feature variable value associated with the exceptional situation is determined according to a comparison result of the exceptional feature and the preset key feature.
  10. The method according to claim 7, wherein the exception processing model is a decision tree model.
  11. The method according to claim 1, wherein the avoidance scheme comprises at least one of skipping exception processing or disabling an exception to start.
  12. The method according to claim 1, further comprising:
    prompting, after the exceptional situation is successfully avoided, a user that the exceptional situation is avoided and further repair processing is required.
  13. An apparatus for avoiding an exception, comprising:
    an acquiring module, configured to acquire, when an exceptional situation causes a system or an application program to restart, information associated with the exceptional situation;
    a determining module, configured to determine, based on the information, an avoidance scheme for addressing the exceptional situation; and
    a processing module, configured to restart the system or the application program and use the avoidance scheme to avoid the exceptional situation.
  14. The apparatus according to claim 13, wherein the determining module is configured to:
    extract an exceptional feature from the information; and
    determine the avoidance scheme by comparing the exceptional feature with a preset key feature.
  15. The apparatus according to claim 14, wherein the information comprises stack data, and the exceptional feature comprises a function name contained in the stack data.
PCT/KR2022/004494 2021-04-02 2022-03-30 Method and apparatus for avoiding exception WO2022211483A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110363082.6A CN115185722A (en) 2021-04-02 2021-04-02 Abnormality avoidance method and abnormality avoidance device
CN202110363082.6 2021-04-02

Publications (1)

Publication Number Publication Date
WO2022211483A1 true WO2022211483A1 (en) 2022-10-06

Family

ID=83459407

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/004494 WO2022211483A1 (en) 2021-04-02 2022-03-30 Method and apparatus for avoiding exception

Country Status (2)

Country Link
CN (1) CN115185722A (en)
WO (1) WO2022211483A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140365823A1 (en) * 2012-01-05 2014-12-11 Mitsubishi Electric Corporation Information processing device, information processing method, and computer program
JP2015138512A (en) * 2014-01-24 2015-07-30 富士通株式会社 State monitoring device, state monitoring method, and state monitoring program
JP2017058943A (en) * 2015-09-16 2017-03-23 富士ゼロックス株式会社 Control device and robot
CN106648730A (en) * 2016-09-26 2017-05-10 北京小米移动软件有限公司 Processing method and device of abnormal application
CN111796960A (en) * 2020-07-01 2020-10-20 中国建设银行股份有限公司 Method and system for automatically recovering robot equipment abnormity

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140365823A1 (en) * 2012-01-05 2014-12-11 Mitsubishi Electric Corporation Information processing device, information processing method, and computer program
JP2015138512A (en) * 2014-01-24 2015-07-30 富士通株式会社 State monitoring device, state monitoring method, and state monitoring program
JP2017058943A (en) * 2015-09-16 2017-03-23 富士ゼロックス株式会社 Control device and robot
CN106648730A (en) * 2016-09-26 2017-05-10 北京小米移动软件有限公司 Processing method and device of abnormal application
CN111796960A (en) * 2020-07-01 2020-10-20 中国建设银行股份有限公司 Method and system for automatically recovering robot equipment abnormity

Also Published As

Publication number Publication date
CN115185722A (en) 2022-10-14

Similar Documents

Publication Publication Date Title
WO2017111312A1 (en) Electronic device and method of managing application programs thereof
WO2020017898A1 (en) Electronic apparatus and control method thereof
WO2018082484A1 (en) Screen capturing method and system for electronic device, and electronic device
WO2018076865A1 (en) Data sharing method, device, storage medium, and electronic device
WO2020149520A1 (en) Firmware updating method, and electronic apparatus and storage media for same
WO2014189275A1 (en) Apparatus and method of recognizing external device in a communication system
WO2020087981A1 (en) Method and apparatus for generating risk control audit model, device and readable storage medium
WO2019119624A1 (en) Excel table-based calculation method and apparatus, device, and storage medium
WO2018201774A1 (en) Data approval method, apparatus, device, and computer readable storage medium
WO2020233060A1 (en) Event notification method and apparatus, event notification server, and storage medium
WO2021045428A1 (en) Method and apparatus for improving runtime performance after application update in electronic device
WO2020231177A1 (en) Electronic device and method for receiving push message stored in blockchain
WO2018026164A1 (en) Method of processing touch events and electronic device adapted thereto
WO2020062554A1 (en) Data reading method for memory, display apparatus, and computer readable storage medium
WO2018236141A1 (en) Crash report grouping method, server and computer program
WO2018079999A1 (en) Electronic device and method for operating the same
WO2017175965A1 (en) Electronic device and method of receiving user input thereof
WO2022211483A1 (en) Method and apparatus for avoiding exception
WO2021002724A1 (en) Electronic apparatus and control method thereof
WO2022244997A1 (en) Method and apparatus for processing data
WO2020237849A1 (en) Snapshot read-write method for network block device, apparatus, device, and storage medium
WO2017150841A1 (en) Electronic device, application execution system, and control method therefor
WO2020213885A1 (en) Server and control method thereof
WO2021015403A1 (en) Electronic apparatus and controlling method thereof
WO2021158068A1 (en) Electronic device and method for operating clipboard of electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22781602

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22781602

Country of ref document: EP

Kind code of ref document: A1