A mobile app crash management system and method
By real-time detection and collection of crash data of mobile mini programs, combined with deep learning technology and classification technology for cause analysis and classification, we will automatically distinguish the crash causes that can be processed by the mobile terminal or the development terminal, and use group intelligent algorithms to generate targeted crash repair strategies, solving the problem of difficult to effectively manage and repair applet crash in the existing technology, achieving efficient and automated crash repair, significantly improving the stability and user experience of the mini program.
Patent Information
- Application Number
- CN202411844708.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The existing technology is difficult to effectively manage and repair the crash problems caused by mobile mini programs due to network instability and insufficient memory when users do not operate, resulting in a decrease in application stability and a downgrade of user experience.
By real-time detection and collection of crash data from mobile mini-programs, and combining deep learning technology and classification technology for cause analysis and classification, we will automatically distinguish the crash reasons that can be processed by the mobile terminal or the development terminal, and use group intelligent algorithms to generate targeted flashback repair strategies.
It has achieved efficient, automated and comprehensive identification and repair of the crash problems of mini programs, improved the efficiency of crash recovery and repair, and significantly improved the stability and user experience of the mini program.
Smart Images

Figure CN119311597B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software engineering technology, and more specifically, to a mobile phone applet crash management system and method. Background Art
[0002] With the development of mobile Internet, mobile applets, as a lightweight application, have been widely used and promoted due to their convenience and fast loading characteristics. Whether on WeChat, Alipay or other platforms, applets provide users with rich functions and services. However, with the surge in the number of users and the diversification of application scenarios, the stability and user experience of applets are facing new challenges. Among them, app crash is one of the most common problems reported by users, that is, the application crashes abnormally during operation. Crash not only leads to user interruption, but also may cause user dissatisfaction and loss, seriously affecting the reputation and market performance of the application. The traditional management method of app crash mainly relies on manual reporting or application market feedback, which is inefficient and has lags, and it is impossible to obtain user feedback and related data in time when crash occurs.
[0003] Of course, there are also intelligent application crash management methods. For example, the patent with publication number CN116881028A discloses an application crash processing method, device, equipment, medium and program product; including: obtaining the current operation instruction for the target application, and obtaining the code running data of the target application; inputting the code running data into the crash analysis model to obtain the crash code snippet output by the crash analysis model, and the crash code snippet is the code snippet that is expected to cause the target application to crash; according to the current operation instruction and the crash code snippet, the target application is crashed; it can reduce the probability of application crash and improve the efficiency of application crash repair.
[0004] However, the above technology focuses on the management before the application crashes, and it is necessary to obtain the user's operating instructions for the application in order to implement subsequent crash processing; when the application has already crashed, it cannot be effectively managed, resulting in a lack of effective troubleshooting and a decline in user experience; in addition, the application of the above technology is premised on the user operating the application, but when the user does not operate, the application may still crash due to network instability, insufficient memory, etc.; therefore, it is impossible to fully monitor and process potential crash scenarios, thereby affecting the stability of the application.
[0005] In view of this, the present invention proposes a mobile phone mini-program crash management system and method to solve the above-mentioned problem. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art and achieve the above-mentioned purpose, the present invention provides the following technical solution: a method for managing the crash of a mobile app, applied to a mobile terminal, comprising:
[0007] Perform a crash detection on the mini program to determine whether a crash instruction is generated;
[0008] If a flash back instruction is generated, the flash back data is collected;
[0009] Analyze the causes of the crash based on the crash data and obtain the causes of the crash;
[0010] Analyze the cause of the crash and determine whether to send it to the development end;
[0011] The receiving developer completes the mini-program to fix the crash according to the cause of the crash;
[0012] Repair the crash according to the cause.
[0013] Furthermore, the method for determining whether to generate a flash back instruction includes:
[0014] Set the activity signal and the generation mechanism of the activity signal. The activity signal is an HTTP request, which includes a timestamp. The generation mechanism of the activity signal is as follows: when the user uses the mini program, the activity signal is continuously generated at frequency A; when the mini program is manually opened or closed by the user, the activity signal is also generated; obtain the timestamp of the generated activity signal, and calculate the time interval between the last two adjacent activity signals, and mark it as the adjacent interval; if the adjacent interval is less than frequency A, generate an exit instruction; if the adjacent interval is equal to frequency A, generate a preliminary flash exit instruction;
[0015] If a preliminary flash back instruction is generated, the last active signal is marked as the final signal; the time interval between the final signal and the next generated active signal is calculated and marked as the restart interval B; the restart interval B is compared with the preset interval threshold C; if B≤C, a flash back instruction is generated; if B>C, no flash back instruction is generated.
[0016] Furthermore, the crash data includes device information, version information, operation information and crash stack information;
[0017] The method for obtaining the flash back reason includes:
[0018] Different digital labels are set for data that are not numerical in device information, version information, and running information, and marked as information labels; the crash stack information is converted into a vector form and marked as a stack vector; the numerical data, information labels, and stack vectors in device information, version information, and running information are used as analysis data, and the analysis data is input into the trained cause analysis model to predict the corresponding cause label. The cause label is the digital label corresponding to the cause of the crash, and different causes of the crash have different corresponding digital labels;
[0019] The training methods of the cause analysis model include:
[0020] Collect g groups of analysis data in advance, set corresponding cause labels for all g groups of analysis data, where g is an integer greater than 1, and convert the analysis data and the corresponding cause labels into a corresponding set of feature vectors; use each set of feature vectors as the input of a cause analysis model, and the cause analysis model uses a set of predicted cause labels corresponding to each group of analysis data as output, and uses the actual cause labels corresponding to each group of analysis data as prediction targets, where the actual cause labels are the pre-set cause labels corresponding to the analysis data; minimize the sum of prediction errors of all analysis data as the training target; train the cause analysis model until the sum of prediction errors converges and the training is stopped; the cause analysis model is a deep neural network model.
[0021] Furthermore, the method for converting the crash stack information into a vector form includes:
[0022] Split the crash stack information by item and get the item ; Create a vocabulary table D for the crash stack information, including all the words in the crash stack information; calculate the word frequency of each word b, the expression of word frequency is: ; In the formula, is the word frequency of vocabulary b, For vocabulary b in the corresponding item The number of occurrences in For the corresponding The total number of words in ; calculate the prevalence of each word b, the expression of prevalence is: ; In the formula, is the prevalence of word b in the crash stack information E, is the number of items containing word b; according to the frequency and prevalence of each word b, calculate the number of items containing word b in the corresponding item The importance of ; the expression of importance is: ; In the formula For vocabulary b in the corresponding item The importance of each The importance of the corresponding vocabulary b is combined to obtain each item Corresponding vector, each target The corresponding vectors are combined to obtain the vector form corresponding to the crash stack information.
[0023] Furthermore, the method for determining whether to send the crash reason to the development end includes:
[0024] Classify all the reasons for the crash and obtain a classification set, which includes a mobile set and a development set; wherein the mobile set includes the reasons for the crash solved by the mobile end, and the development set includes the reasons for the crash solved by the development end; mark the obtained reasons for the crash as real-time reasons; if there is a crash reason in the mobile set that is the same as the real-time reason, the crash reason is not sent to the development end; if there is a crash reason in the development set that is the same as the real-time reason, the crash reason is sent to the development end;
[0025] The step of obtaining the classification set comprises:
[0026] Step A1: All the reasons for the crash are converted into corresponding vector forms and marked as crash vectors; all the crash vectors are used as sample points, two sample points are randomly selected as classification center points, and the two classification center points are marked as μ1 and μ2 in ascending order;
[0027] Step A2: Mark the sample points that are not used as classification center points as calculation points, and mark the calculation points in ascending order as δ1, δ2, …, δ H-2 , which is marked as δ h , h∈[1,H-2], H is the number of reason labels; calculate the distance from each calculation point to each classification center point in turn;
[0028] Step A3: Establish two corresponding sets according to the two classification center points;
[0029] Step A4: Calculate the point δ h The distance to each classification center point is compared, and the calculated point δ h Assign to the calculation point δ h The set corresponding to the nearest classification center point;
[0030] Step A5: set h=h+1 and jump back to step A4;
[0031] Step A6: Repeat the above steps A4 to A5 until the loop ends when h=H-2, and assign H-2 calculation points to the corresponding sets;
[0032] Step A7: Recalculate the new classification center point of each set;
[0033] Step A8: Repeat the above steps A2 to A7 until the new classification center point of each set recalculated in step A7 is consistent with the new classification center point of each set calculated in the previous cycle, the cycle ends, and the sample points in the two sets are obtained;
[0034] Step A9: Mark the crash cause solved by a random mobile terminal as the detection cause in advance, mark the set of the two sets that has the same crash cause as the detection cause as the mobile set, and mark the other set as the development set.
[0035] Furthermore, the distance between the calculated point and the classification center point is calculated by:
[0036] ;
[0037] Where, L hu To calculate the point δ h To the classification center point μ u The distance, U is the dimension of the sample point, δ hv To calculate the point δ h The value of the vth dimension, μ uv is the classification center point μ u The value of the vth dimension, u is 1 or 2, v∈[1,U];
[0038] The calculation method of the new classification center point of each set includes:
[0039] ;
[0040] ;
[0041] In the formula, is the new classification center of the u-th set, δ r is the rth calculation point in the uth set, R is the number of calculation points in the uth combination, r∈[1,R], To calculate the point δ r Values in different dimensions.
[0042] Furthermore, the steps for repairing the crash of the mini program include:
[0043] Step B1: Collect m crash recovery strategies, set different digital labels for different crash recovery strategies, and mark them as strategy labels; preset the population size Z and the number threshold T;
[0044] Step B2: Initialize the population, define the positions of individuals in the initialized population in a one-dimensional search space, the positions of individuals correspond to the strategy labels one by one, and the number of iterations t corresponding to the initialized population is 0;
[0045] Step B3: Determine the repair function;
[0046] Step B4: Select the follow target for each individual and update the position of each individual;
[0047] Step B5: Determine whether each individual moves independently and update the position of each individual;
[0048] Step B6: Set the number of iterations t=t+1 and jump back to step B4;
[0049] Step B7: loop steps 4 to 8 until t ≥ T, and then go to step B8;
[0050] Step B8: Calculate the repair degree corresponding to each individual position, sort all the repair degrees from large to small, obtain the individual position corresponding to the repair degree at the top, obtain the flashback repair strategy corresponding to the corresponding strategy label according to the obtained individual position, and perform flashback repair on the mini program;
[0051] In step B1, the crash repair strategy is a strategy for successfully repairing a crash when a crash occurs during the running of the historical mini program;
[0052] In step B2, the population S0 is initialized to {X1, X2, ..., X Z}, including Z individuals, X Z is the Zth individual; the range of the strategy label and the range of the one-dimensional search space are both [1,m]; the expression of each individual position is: ; In the formula, is the initial position of the ith individual, F i is a random number between [0,1], i∈[1,Z].
[0053] Furthermore, in step B3, the expression of the repair function is: f=sg; wherein f is the repair degree, and sg is the flash back probability; the method for obtaining the flash back probability is: using the analysis data and the cause label as the test data; obtaining the strategy label corresponding to the individual position, using the strategy label and the test data as the research data, inputting the research data into the trained probability prediction model, and predicting the corresponding flash back probability; the training process of the probability prediction model is consistent with the training process of the cause analysis model, and both are deep neural network models;
[0054] In step B4, the method of selecting a follow target for each individual includes:
[0055] Divide the individuals in the population into n sub-populations, where n is an integer greater than 1; the following targets include the first target and the second target; the first target is the individual with the highest degree of repair in the population, and the second target is the individual with the highest degree of repair in the sub-population; obtain the random number F corresponding to each individual iAnd perform rounding operation. If the rounded random number is 0, the target followed by the individual is the first target. If the rounded random number is 1, the target followed by the individual is the second target of the corresponding sub-population.
[0056] Methods for updating the location of each individual include:
[0057] Mark the location of the first target as , mark the position of the second target as , j∈[1,n];
[0058] If the target to be followed is the first target, the calculation method of the updated individual position includes:
[0059] ; ;
[0060] In the formula, is the position of the i-th individual after update, is the position of the i-th individual before the update, α is the search range adjustment coefficient, C' is a random number between [0,1], and e is a natural constant;
[0061] If the target to be followed is the second target, the calculation method of the updated individual position includes:
[0062] ;
[0063] In the formula, is the position of a random individual before updating, is the second target corresponding to the i-th individual.
[0064] Furthermore, in step B5, the method of determining whether each individual moves independently includes:
[0065] When an individual follows a target, it will make a tentative move based on the final position of the individual in the previous iteration and the individual's current position; calculate the position of the individual after the tentative move, and calculate the corresponding repair degree, marked as the tentative repair degree; mark the repair degree corresponding to the individual's current position as the current repair degree; compare the tentative repair degree with the current repair degree; if the tentative repair degree is greater than or equal to the current repair degree, the corresponding individual moves alone; if the tentative repair degree is less than the current repair degree, the corresponding individual does not move alone; the expression of the position of the individual after the tentative move is: ; In the formula, is the position of the ith individual after tentative movement, is the final position of the i-th individual in the last iteration, C1 is a random number with normal distribution between [0,1];
[0066] Methods for updating the location of each individual include:
[0067] Generate the corresponding individual speed for each individual moving separately. The method of generating individual speed is: ; In the formula, is the individual speed of the ith individual, C2 is a random number between [0,0.2]; each individual moving alone moves independently according to the corresponding individual speed, and the calculation method of the individual position after independent movement is: ; In the formula, is the position of the i-th individual after moving alone.
[0068] A mobile phone applet crash management system, which implements the mobile phone applet crash management method, is applied to a mobile terminal and includes:
[0069] A flash back detection module is used to detect the flash back of the mini program and determine whether to generate a flash back instruction;
[0070] The data collection module collects the flash back data if a flash back instruction is generated;
[0071] Cause analysis module, which analyzes the causes of crashes based on crash data and obtains the causes of crashes;
[0072] The reason judgment module is used to analyze the reason for the crash and determine whether to send the reason to the development end;
[0073] The first repair module is used to receive the small program that the developer completes the crash repair according to the crash cause;
[0074] The second repair module repairs the crash according to the cause of the crash.
[0075] The technical effects and advantages of a mobile phone applet crash management system and method of the present invention are as follows:
[0076] By real-time detection and collection of mobile app crash data, combined with deep learning technology and classification technology to analyze and classify the causes, it automatically distinguishes the crash causes that can be handled by the mobile end or the development end, and uses swarm intelligence algorithms to generate targeted crash repair strategies; it can efficiently, automatically and comprehensively identify and repair the crash problems of the mini program, improve the efficiency of crash repair, and effectively solve the problems of the strong lag of traditional crash management methods, thereby significantly improving the stability and user experience of the mini program and improving the market competitiveness of the mini program. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is a schematic diagram of a mobile app crash management system according to Embodiment 1 of the present invention;
[0078] Figure 2 This is a flow chart of a method for repairing a mini program crash according to Embodiment 1 of the present invention;
[0079] Figure 3 This is a flow chart of a method for managing the crash of a mobile app in Example 2 of the present invention. DETAILED DESCRIPTION
[0080] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0081] Example 1
[0082] See also Figure 1 As shown, a mobile app crash management system described in this embodiment includes a crash detection module, a data acquisition module, a cause analysis module, a cause judgment module, a first repair module and a second repair module; each module is connected by wire and / or wireless means to achieve data transmission between modules;
[0083] The flash back detection module is used for mobile terminal to detect the flash back of the mini program and determine whether to generate a flash back instruction.
[0084] The mobile terminal is the mobile phone used by the user, and the mobile phone and the mobile terminal correspond one to one.
[0085] Methods for determining whether to generate a flash back instruction include:
[0086] Set an activity signal and a generation mechanism for the activity signal. The activity signal is an HTTP request, which includes a timestamp and is used to reflect the running status of the mini program. The generation mechanism of the activity signal is as follows: when a user uses the mini program, an activity signal is continuously generated at a frequency A, and the frequency A is pre-set by a technician in this field according to actual conditions. When the mini program is manually opened or closed by the user, an activity signal is also generated. The timestamp of the generated activity signal is obtained, and the time interval between the last two adjacent activity signals is calculated and marked as an adjacent interval. If the adjacent interval is less than the frequency A, an exit instruction is generated, indicating that the user has actively exited the mini program. If the adjacent interval is equal to the frequency A, a preliminary flash back instruction is generated, indicating that the user may have actively exited the mini program or the mini program has flashed back, which requires further analysis. Since the activity signal is continuously generated at a frequency A, there is no situation where the time interval is greater than the frequency A during a user's use of the mini program.
[0087] If a preliminary flash back instruction is generated, the last activity signal is marked as the final signal; the time interval between the final signal and the next generated activity signal is calculated and marked as the restart interval B; the restart interval B is compared with the preset interval threshold C, and the interval threshold C is pre-set by technical personnel in this field according to actual conditions; if B≤C, a flash back instruction is generated, that is, the user opens the mini program again in a short time, indicating that the mini program flashes back; if B>C, no flash back instruction is generated, indicating that the preliminary flash back instruction is generated because when the user manually closes the mini program, the time interval with the last generated activity signal is exactly frequency A.
[0088] The data collection module collects the flash back data if a flash back instruction is generated.
[0089] Crash data includes device information, version information, running information, and crash stack information;
[0090] Device information includes device model (such as iPhone 16, Huawei p60, etc.), system version (such as iOS 17.1, Android 14, etc.), power status, memory size, etc.; helps to identify whether a crash is more likely to occur in a specific device or system environment; for example, some devices may crash due to insufficient resources or incompatibility when the battery is low or the memory is low; version information includes the mini program version, third-party library version (the version number of the external code library or framework used in the mini program), etc.; helps to determine whether there is a problem with a specific version, resulting in a crash; running information includes CPU usage, memory usage, network status (such as Wi-Fi, 5G, no network), etc.; helps to understand the running status of the mini program when it crashes; for example, if the CPU or memory usage is too high, or the network request is stuck, the mini program may crash due to insufficient system resources or network anomalies; crash stack information includes the error stack when the crash occurs (the call stack information when the mini program crashes, indicating the stack order of each function call when the crash occurs), error log (detailed log information recorded when the mini program crashes, usually including the environment, input, error information and system-level diagnostic information when the crash occurs), etc.; helps to directly obtain the code location that causes the mini program to crash.
[0091] The cause analysis module is used for mobile terminals to analyze the causes of crashes based on crash data and obtain the causes of crashes.
[0092] Methods for obtaining the reasons for the crash include:
[0093] Different digital labels are set for non-numeric data in the device information, version information, and operation information (such as device model, version model, mini-program version, network status, etc.), and marked as information labels; the crash stack information is converted into a vector form and marked as a stack vector; the numerical data, information labels, and stack vectors in the device information, version information, and operation information are used as analysis data, and the analysis data is input into the trained cause analysis model to predict the corresponding cause label. The cause label is the digital label corresponding to the cause of the crash, and different causes of the crash have different corresponding digital labels; for example, insufficient memory is set to 1, code abnormality is set to 2, network problem is set to 3, etc.
[0094] The training methods of the cause analysis model include:
[0095] Collect g groups of analysis data in advance, set corresponding reason labels for the g groups of analysis data, where g is an integer greater than 1, and convert the analysis data and the corresponding reason labels into a corresponding set of feature vectors; the reason labels corresponding to the analysis data are collected by technicians in this field during the historical mini-program crash analysis process, and each group of analysis data is analyzed in turn based on actual experience to obtain the crash cause corresponding to each group of analysis data, and the corresponding crash label is obtained, and the corresponding reason labels are set for the g groups of analysis data in turn;
[0096] Each set of feature vectors is used as the input of the cause analysis model. The cause analysis model takes a set of predicted cause labels corresponding to each set of analysis data as output, and takes the actual cause labels corresponding to each set of analysis data as the prediction target. The actual cause labels are the pre-set cause labels corresponding to the analysis data. The training goal is to minimize the sum of the prediction errors of all analysis data. The calculation formula of the prediction error is: ,in is the prediction error, k is the group number of the eigenvector corresponding to the analyzed data, β k is the predicted reason label corresponding to the k-th group of analysis data, is the actual cause label corresponding to the kth group of analysis data, k∈[1,g]; the cause analysis model is trained until the sum of the prediction errors converges and the training is stopped.
[0097] The above-mentioned cause analysis model is specifically a deep neural network model; it includes an input layer, a hidden layer and an output layer; each hidden layer includes multiple neurons, each neuron is connected to the neurons in the next layer, and the connection contains weights, which determine the importance and influence of data transmission in the neural network; an activation function is applied to each neuron between the hidden layer and the output layer, and the activation function introduces nonlinearity, allowing the network to learn more complex patterns and features.
[0098] Methods for converting crash stack information into vector form include:
[0099] Split the crash stack information by item and get the item , for example, by segmentation criteria such as paragraphs, so that each It can be processed as an independent document; create a vocabulary table D for the crash stack information, including all the words in the crash stack information; calculate the word frequency of each word b, and the expression of word frequency is: ; In the formula, is the word frequency of vocabulary b, For vocabulary b in the corresponding item The number of occurrences in For the corresponding The total number of words in ; calculate the prevalence of each word b, the expression of prevalence is: ; In the formula, is the prevalence of word b in the crash stack information E, is the number of items containing word b; according to the frequency and prevalence of each word b, calculate the number of items containing word b in the corresponding item The importance of ; the expression of importance is: ; In the formula For vocabulary b in the corresponding item The importance of each The importance of the corresponding vocabulary b is combined to obtain each item Corresponding vector, each target The corresponding vectors are combined to obtain the vector form corresponding to the crash stack information.
[0100] The cause judgment module is used by the mobile terminal to analyze the cause of the crash and determine whether to send the cause of the crash to the development terminal.
[0101] Methods for determining whether to send the crash reason to the development end include:
[0102] All crash reasons are classified to obtain a classification set, which includes a mobile set and a development set; the mobile set includes crash reasons solved by the mobile end (such as insufficient memory, network problems, etc.), and the development set includes crash reasons solved by the development end (such as code exceptions, thread deadlocks, etc.); the obtained crash reasons are marked as real-time reasons; if there is a crash reason in the mobile set that is the same as the real-time reason, the crash reason will not be sent to the development end; if there is a crash reason in the development set that is the same as the real-time reason, the crash reason will be sent to the development end.
[0103] The steps to obtain a classification collection include:
[0104] Step A1: All the reasons for the crash are converted into corresponding vector forms and marked as crash vectors; all the crash vectors are used as sample points, two sample points are randomly selected as classification center points, and the two classification center points are marked as μ1 and μ2 in ascending order;
[0105] Step A2: Mark the sample points that are not used as classification center points as calculation points, and mark the calculation points in ascending order as δ1, δ2, …, δ H-2 , which is marked as δ h , h∈[1,H-2], H is the number of reason labels; calculate the distance from each calculation point to each classification center point in turn;
[0106] The calculation method of the distance from the calculated point to the classification center point includes:
[0107] ;
[0108] Where, L hu To calculate the point δ h To the classification center point μ u The distance, U is the dimension of the sample point, δ hv To calculate the point δ h The value of the vth dimension, μ uv is the classification center point μ u The value of the vth dimension, u is 1 or 2, v∈[1,U];
[0109] Step A3: Establish two corresponding sets according to the two classification center points;
[0110] Step A4: Calculate the point δ h The distance to each classification center point is compared, and the calculated point δ h Assign to the calculation point δ h The set corresponding to the nearest classification center point;
[0111] Step A5: set h=h+1 and jump back to step A4;
[0112] Step A6: Repeat the above steps A4 to A5 until the loop ends when h=H-2, and assign H-2 calculation points to the corresponding sets;
[0113] Step A7: Recalculate the new classification center point of each set;
[0114] The calculation method of the new classification center point of each set includes:
[0115] ;
[0116] ;
[0117] In the formula, is the new classification center of the u-th set, δ r is the rth calculation point in the uth set, R is the number of calculation points in the uth combination, r∈[1,R], To calculate the point δ r Values in different dimensions.
[0118] Step A8: Repeat the above steps A2 to A7 until the new classification center point of each set recalculated in step A7 is consistent with the new classification center point of each set calculated in the previous cycle, the cycle ends, and the sample points in the two sets are obtained;
[0119] Step A9: Mark the crash cause solved by a random mobile terminal as the detection cause in advance, mark the set of the two sets that has the same crash cause as the detection cause as the mobile set, and mark the other set as the development set.
[0120] The first repair module is used by the development side to repair the crash of the mini program according to the crash cause, and push the repaired mini program to the mobile terminal.
[0121] The development end is a platform for mini-program developers to maintain mini-programs.
[0122] like Figure 2 As shown in the figure, the steps to repair the crash of the mini program include:
[0123] Step B1: Collect m crash recovery strategies, set different digital labels for different crash recovery strategies, and mark them as strategy labels; preset the population size Z and the number threshold T;
[0124] Step B2: Initialize the population, define the positions of individuals in the initialized population in a one-dimensional search space, the positions of individuals correspond to the strategy labels one by one, and the number of iterations t corresponding to the initialized population is 0;
[0125] Step B3: Determine the repair function;
[0126] Step B4: Select the follow target for each individual and update the position of each individual;
[0127] Step B5: Determine whether each individual moves independently and update the position of each individual;
[0128] Step B6: Set the number of iterations t=t+1 and jump back to step B4;
[0129] Step B7: loop steps 4 to 8 until t ≥ T, and then go to step B8;
[0130] Step B8: Calculate the repair degree corresponding to each individual position, sort all the repair degrees from large to small, obtain the individual position corresponding to the repair degree at the top, obtain the flashback repair strategy corresponding to the corresponding strategy label according to the obtained individual position, and perform flashback repair on the mini program;
[0131] In the above step B1, the crash repair strategy is a strategy for successfully repairing crashes when crashes occur during the operation of the historical mini program; for example, memory management optimization (such as checking memory leaks and releasing objects and resources that are no longer used in a timely manner; optimizing memory usage to avoid insufficient memory caused by excessive memory consumption), version compatibility check (such as ensuring that the application is compatible with different operating system versions and device configurations; conducting sufficient testing for different system versions and devices to discover and fix compatibility issues), code quality improvement (such as conducting code review and refactoring to discover and fix potential logical errors and bugs; writing unit tests and integration tests to improve code reliability and stability), etc.
[0132] The population size Z is determined by technical personnel in this field. During the process of repairing the crash of the historical mini-program, under multiple groups of different test data, multiple different population sizes are set for the same test data, and the steps of repairing the crash of the mini-program are implemented multiple times. After the same number of iterations, the corresponding policy labels are obtained, and the population size that is closest to the policy label and the actual policy label is used as the population size corresponding to the group of test data; the test data includes analysis data and cause labels, the actual policy label is the policy label that best matches the group of test data, and the actual policy label is obtained by technical personnel in this field based on actual experience; and the population size corresponding to each group of test data is obtained in this way, and the average of multiple population sizes is used as the preset population size Z.
[0133] The number threshold T is determined by technical personnel in this field. During the historical mini-program crash repair process, the same test data is used multiple times to perform the mini-program crash repair steps under multiple sets of different test data, and multiple policy labels are obtained, where the number of iterations each time is different, and the population size is the same and is Z; the number of iterations that is closest to the policy label and the actual policy label is used as the number of iterations corresponding to the set of test data; and the number of iterations corresponding to each set of test data is obtained in this way, and the average of multiple iteration numbers is used as the number threshold T.
[0134] In the above step B2, the population S0 is initialized to {X1,X2,…,X Z}, including Z individuals, X Z is the Zth individual; the range of the strategy label and the range of the one-dimensional search space are both [1,m]; the expression of each individual position is: ; In the formula, is the initial position of the ith individual, Fi is a random number between [0,1], i∈[1,Z].
[0135] In the above step B3, the expression of the repair function is: f=sg; wherein f is the repair degree, and sg is the flash back probability; the method for obtaining the flash back probability is: use the analysis data and the cause label as the test data; obtain the strategy label corresponding to the individual position, use the strategy label and the test data as the research data, input the research data into the trained probability prediction model, and predict the corresponding flash back probability; the training process of the probability prediction model is consistent with the training process of the cause analysis model, and both are deep neural network models; wherein, the flash back probability corresponding to the research data is obtained by technical personnel in this field in the process of historical mini-program flash back repair, collect w groups of research data, adopt the flash back repair strategy corresponding to the strategy label in each group of research data, and perform flash back repair on the mini-program corresponding to the corresponding test data. After the repair is completed, run the mini-program multiple times, count the number of flash backs, divide the number of flash backs by the number of runs, obtain the flash back probability, and set the corresponding flash back probability for the w groups of research data respectively.
[0136] In the above step B4, the method of selecting the following target for each individual includes:
[0137] Divide the individuals in the population into n sub-populations, where n is an integer greater than 1; the following targets include the first target and the second target; the first target is the individual with the highest degree of repair in the population, and the second target is the individual with the highest degree of repair in the sub-population; obtain the random number F corresponding to each individual i And perform rounding operation. If the rounded random number is 0, the target followed by the individual is the first target. If the rounded random number is 1, the target followed by the individual is the second target of the corresponding sub-population.
[0138] Methods for updating the location of each individual include:
[0139] Mark the location of the first target as , mark the position of the second target as , j∈[1,n];
[0140] If the target to be followed is the first target, the calculation method of the updated individual position includes:
[0141] ; ;
[0142] In the formula, is the position of the i-th individual after update, is the position of the i-th individual before the update, α is the search range adjustment coefficient, C' is a random number between [0,1], and e is a natural constant;
[0143] If the target to be followed is the second target, the calculation method of the updated individual position includes:
[0144] ;
[0145] In the formula, is the position of a random individual before updating, is the second target corresponding to the i-th individual.
[0146] In the above step B5, the method of determining whether each individual moves independently includes:
[0147] When an individual follows a target, it will make a tentative move based on the final position of the individual in the previous iteration and the individual's current position; calculate the position of the individual after the tentative move, and calculate the corresponding repair degree, marked as the tentative repair degree; mark the repair degree corresponding to the individual's current position as the current repair degree; compare the tentative repair degree with the current repair degree; if the tentative repair degree is greater than or equal to the current repair degree, the corresponding individual moves alone; if the tentative repair degree is less than the current repair degree, the corresponding individual does not move alone; the expression of the position of the individual after the tentative move is: ; In the formula, is the position of the ith individual after tentative movement, is the final position of the i-th individual in the last iteration, C1 is a random number with normal distribution between [0,1];
[0148] Methods for updating the location of each individual include:
[0149] Generate the corresponding individual speed for each individual moving separately. The method of generating individual speed is: ; In the formula, is the individual speed of the ith individual, C2 is a random number between [0,0.2]; each individual moving alone moves independently according to the corresponding individual speed, and the calculation method of the individual position after independent movement is: ; In the formula, is the position of the i-th individual after moving alone.
[0150] The second repair module is used for the mobile terminal to repair the flash back according to the flash back cause;
[0151] The user can repair the crash of the Mini Program based on the crash cause analyzed by the mobile terminal.
[0152] This embodiment detects and collects the crash data of mobile applets in real time, combines deep learning technology and classification technology to analyze and classify the causes, automatically distinguishes the crash causes that can be handled by the mobile terminal or the development terminal, and uses a swarm intelligence algorithm to generate targeted crash repair strategies; it can efficiently, automatically and comprehensively identify and repair the crash problems of applets, improve the efficiency of crash repair, and effectively solve the problems of strong lag in traditional crash management methods, thereby significantly improving the stability and user experience of applets, and improving the market competitiveness of applets.
[0153] Example 2
[0154] See also Figure 3 As shown, the part not described in detail in this embodiment is described in Example 1, and a method for managing the crash of a mobile app is provided, the method comprising:
[0155] The mobile terminal performs a flash back detection on the mini program to determine whether a flash back instruction is generated;
[0156] If a flash back instruction is generated, the mobile terminal collects flash back data;
[0157] The mobile terminal analyzes the cause of the crash based on the crash data and obtains the cause of the crash;
[0158] The mobile terminal analyzes the cause of the crash and determines whether to send the cause to the development terminal;
[0159] The developer repairs the mini program based on the cause of the crash and pushes the repaired mini program to the mobile terminal;
[0160] The mobile terminal will repair the crash based on the cause.
[0161] Example 3
[0162] The present application also provides an electronic device. The electronic device may include one or more processors and one or more memories. The memories store computer-readable codes, and when the computer-readable codes are executed by the one or more processors, a method for managing the flashback of a mobile applet may be executed.
[0163] The method or system according to the implementation mode of the present application can also be implemented with the help of the architecture of the electronic device shown in the present application. The electronic device may include a bus, one or more CPUs, ROM, RAM, a communication port connected to a network, input / output, a hard disk, etc. A storage device in an electronic device, such as a ROM or a hard disk, can store a mobile app crash management method provided in the present application. Furthermore, the electronic device may also include a user interface. Of course, the architecture shown in the present application is only exemplary. When implementing different devices, one or more components in the electronic device shown in the present application may be omitted according to actual needs.
[0164] Example 4
[0165] One embodiment of the present application discloses a computer-readable storage medium. Computer-readable instructions are stored on the computer-readable storage medium. When the computer-readable instructions are executed by the processor, a mobile phone applet flash back management method according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0166] In addition, according to the implementation of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, for example: a method for managing the flash back of a mobile phone applet. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0167] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0168] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for managing the crash of a mobile app, characterized in that: Applied to mobile terminals, including: Perform a crash detection on the mini program to determine whether a crash instruction is generated; If a flash back instruction is generated, the flash back data is collected; the flash back data includes device information, version information, operation information and crash stack information; Perform cause analysis based on the flash back data to obtain the cause of the flash back; the method for obtaining the cause of the flash back includes: Different digital labels are set for data that are not numerical in device information, version information, and running information, and marked as information labels; the crash stack information is converted into a vector form and marked as a stack vector; the numerical data, information labels, and stack vectors in device information, version information, and running information are used as analysis data, and the analysis data is input into a trained cause analysis model to predict the corresponding cause label, where the cause label is a digital label corresponding to the cause of the crash, and different causes of the crash have different corresponding digital labels; the cause analysis model is a deep neural network model; Analyze the cause of the crash and determine whether to send it to the development end; The method for determining whether to send the crash reason to the development end includes: Classify all the reasons for the crash and obtain a classification set, which includes a mobile set and a development set; wherein the mobile set includes the reasons for the crash solved by the mobile end, and the development set includes the reasons for the crash solved by the development end; mark the obtained reasons for the crash as real-time reasons; if there is a crash reason in the mobile set that is the same as the real-time reason, the crash reason is not sent to the development end; if there is a crash reason in the development set that is the same as the real-time reason, the crash reason is sent to the development end; The step of obtaining the classification set comprises: Step A1: All the reasons for the crash are converted into corresponding vector forms and marked as crash vectors; all the crash vectors are used as sample points, two sample points are randomly selected as classification center points, and the two classification center points are marked in ascending order as and ; Step A2: Mark the sample points that are not classified as the center points as calculation points, and mark the calculation points in ascending order as , , …, , which is marked as , , is the number of reason labels; calculate the distance from each calculation point to each classification center point in turn; Step A3: Establish two corresponding sets according to the two classification center points; Step A4: Calculate the points The distance to each classification center point is compared and the calculated point Assign to and calculate point The set corresponding to the nearest classification center point; Step A5: Make , jump back to step A4; Step A6: Repeat steps A4 to A5 until When the cycle ends, Each calculation point is assigned to the corresponding set; Step A7: Recalculate the new classification center point of each set; Step A8: Repeat the above steps A2 to A7 until the new classification center point of each set recalculated in step A7 is consistent with the new classification center point of each set calculated in the previous cycle, the cycle ends, and the sample points in the two sets are obtained; Step A9: Mark the crash cause solved by a random mobile terminal as the detection cause in advance, mark the set of the two sets that has the same crash cause as the detection cause as the mobile set, and mark the other set as the development set; The receiving developer completes the mini-program to fix the crash according to the cause of the crash; Repair the crash according to the cause.
2. A method for managing the crash of a mobile app according to claim 1, characterized in that: The method for determining whether to generate a flash back instruction includes: Set the activity signal and the generation mechanism of the activity signal. The activity signal is an HTTP request, which includes a timestamp. The generation mechanism of the activity signal is as follows: when the user uses the mini program, the activity signal is continuously generated at frequency A; when the mini program is manually opened or closed by the user, the activity signal is also generated; obtain the timestamp of the generated activity signal, and calculate the time interval between the last two adjacent activity signals, and mark it as the adjacent interval; if the adjacent interval is less than frequency A, generate an exit instruction; if the adjacent interval is equal to frequency A, generate a preliminary flash exit instruction; If a preliminary flash back instruction is generated, the last active signal is marked as the final signal; the time interval between the final signal and the next generated active signal is calculated and marked as the restart interval B; the restart interval B is compared with the preset interval threshold C; if , then generate a flash back instruction; if , no flash back instruction is generated.
3. A method for managing the crash of a mobile app according to claim 2, characterized in that: The training methods of the cause analysis model include: Collect g groups of analysis data in advance, set corresponding cause labels for the g groups of analysis data, where g is an integer greater than 1, and convert the analysis data and the corresponding cause labels into a corresponding set of feature vectors; use each set of feature vectors as the input of a cause analysis model, and the cause analysis model uses a set of predicted cause labels corresponding to each group of analysis data as output, and uses the actual cause labels corresponding to each group of analysis data as prediction targets, where the actual cause labels are the pre-set cause labels corresponding to the analysis data; minimize the sum of prediction errors of all analysis data as the training target; train the cause analysis model until the sum of prediction errors converges and stops training.
4. A method for managing the crash of a mobile app according to claim 3, characterized in that: The method for converting the crash stack information into a vector form comprises: Split the crash stack information by item and get the item ; Create a vocabulary for the crash stack information , including all words in the crash stack; calculate each word The word frequency of , the expression of word frequency is: ; In the formula, For vocabulary The word frequency, For vocabulary In the corresponding The number of occurrences in For the corresponding The total number of words in ; count each word The universality of , the universal expression is: ; In the formula, For vocabulary In the crash stack information The universality of To include vocabulary The number of items in each vocabulary The frequency and prevalence of each word In the corresponding The importance of ; the expression of importance is: ; In the formula For vocabulary In the corresponding The importance of each Corresponding vocabulary The importance of each item is combined to obtain Corresponding vector, each target The corresponding vectors are combined to obtain the vector form corresponding to the crash stack information.
5. A method for managing the crash of a mobile app according to claim 4, characterized in that: The calculation method of the distance from the calculated point to the classification center point includes: ; In the formula, For calculation point To classification center The distance is the dimension of the sample points, For calculation point No. The value of the dimension, The classification center point No. The value of the dimension, is 1 or 2, ; The calculation method of the new classification center point of each set includes: ; ; In the formula, For the A new classification center is set up. For the In the collection calculation points, For the The number of calculation points in a combination, , For calculation point Values in different dimensions.
6. A method for managing the crash of a mobile app according to claim 5, characterized in that: The steps to fix the mini program crash include: Step B1: Collect m crash recovery strategies, set different digital labels for different crash recovery strategies, and mark them as strategy labels; preset the population size Z and the number threshold T; Step B2: Initialize the population, define the positions of individuals in the initialized population in a one-dimensional search space, the positions of individuals correspond to the strategy labels one by one, and the number of iterations t corresponding to the initialized population is 0; Step B3: Determine the repair function; Step B4: Select the follow target for each individual and update the position of each individual; Step B5: Determine whether each individual moves independently and update the position of each individual; Step B6: Set the number of iterations , jump back to step B4; Step B7: Repeat steps 4 to 8 until When the loop ends, go to step B8; Step B8: Calculate the repair degree corresponding to each individual position, sort all the repair degrees from large to small, obtain the individual position corresponding to the repair degree at the top, obtain the flashback repair strategy corresponding to the corresponding strategy label according to the obtained individual position, and perform flashback repair on the mini program; In step B1, the crash repair strategy is a strategy for successfully repairing a crash when a crash occurs during the running of the historical mini program; In step B2, the population is initialized , including Z individuals, is the Zth individual; the range of the strategy label and the range of the one-dimensional search space are ; The expression for each individual position is: ; In the formula, is the initial position of the ith individual, for A random number between .
7. A method for managing the crash of a mobile app according to claim 6, characterized in that: In step B3, the expression of the repair function is: ; In the formula, For repairability, is the probability of crash; the method for obtaining the probability of crash is: using the analysis data and the cause label as the test data; obtaining the strategy label corresponding to the individual position, using the strategy label and the test data as the research data, inputting the research data into the trained probability prediction model, and predicting the corresponding probability of crash; the training process of the probability prediction model is consistent with the training process of the cause analysis model, and both are deep neural network models; In step B4, the method of selecting a follow target for each individual includes: Divide the individuals in the population into n sub-populations, where n is an integer greater than 1; the follow-up targets include the first target and the second target; the first target is the individual with the highest degree of repair in the population, and the second target is the individual with the highest degree of repair in the sub-population; obtain the random number corresponding to each individual And perform rounding operation. If the rounded random number is 0, the target followed by the individual is the first target. If the rounded random number is 1, the target followed by the individual is the second target of the corresponding sub-population. Methods for updating the location of each individual include: Mark the location of the first target as , mark the position of the second target as , ; If the target to be followed is the first target, the calculation method of the updated individual position includes: ; ; In the formula, is the position of the i-th individual after update, is the position of the i-th individual before updating, is the search range adjustment factor, for A random number between is a natural constant; If the target to be followed is the second target, the calculation method of the updated individual position includes: ; In the formula, is the position of a random individual before updating, is the second target corresponding to the i-th individual.
8. A mobile app crash management system, implementing a mobile app crash management method according to any one of claims 1 to 7, characterized in that: Applied to mobile terminals, including: A flash back detection module is used to detect the flash back of the mini program and determine whether to generate a flash back instruction; The data collection module collects the flash back data if a flash back instruction is generated; Cause analysis module, which analyzes the causes of crashes based on crash data and obtains the causes of crashes; The reason judgment module is used to analyze the reason for the crash and determine whether to send the reason to the development end; The first repair module is used to receive the small program that the developer completes the crash repair according to the crash cause; The second repair module repairs the crash according to the cause of the crash.
Citation Information
Patent Citations
Method and device for processing application flashback and equipment
CN109271269A
Application program flash-back processing method and device, equipment, medium and program product
CN116881028A