A plug-in operation method, device, equipment and computer storage medium
By directly starting the stable version of local backup on the terminal device and monitoring the crash rate, automatically handling the plug-in exception version, the problem of low processing efficiency in the existing technology is solved, and fast and efficient plug-in exception version processing is achieved.
Patent Information
- Application Number
- CN202010887660.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-28
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-08-28
AI Technical Summary
In the process of plug-in version update and iteration, the processing efficiency of the exception version is low, and terminal devices require uploading exception information and relying on manual analysis, which leads to lengthy and time-consuming processing.
By directly starting the local backup on the terminal device with high stability target version, monitoring the crash rate and recording abnormal versions, automatically determining the processing method, reducing information transmission and manual analysis time.
Improve the processing efficiency of plug-in exception versions, realize the rapid processing of exception versions of a single plug-in on terminal devices, and reduce the time for information transmission and manual analysis.
Smart Images

Figure CN114115974B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a plug-in operation method, device, equipment and computer storage medium. Background Art
[0002] During the update and iteration process of the plug-in version, the current version of the plug-in may become abnormal due to poor stability when running on the terminal device. At this time, the terminal device needs to upload the abnormal information of the current version to the server; then the engineer analyzes the abnormal information received by the server on multiple terminal devices, and after knowing that the current version is an abnormal version with poor stability, determines how to deal with the abnormal version, such as optimizing the abnormal version to obtain a new version or determining a historical version with better stability and releasing it, etc., and it is necessary to inform users of each terminal device to download and install the released new version or the determined historical version on the terminal device; but the above-mentioned process of handling abnormal versions is lengthy and time-consuming, and the processing efficiency is low. Therefore, how to improve the efficiency of handling abnormal versions of plug-ins has become a problem that needs to be considered. Summary of the invention
[0003] Embodiments of the present application provide a plug-in operation method, apparatus, device, and computer storage medium for improving the efficiency of processing abnormal versions of plug-ins.
[0004] In a first aspect of the present application, a plug-in operation method is provided, comprising:
[0005] Get the current version of the target plug-in to be started;
[0006] When it is determined that the current version is an abnormal version, the target version of the local backup is started; the abnormal version includes a version in the historical version of the target plug-in whose first stability during local operation meets the abnormal condition, and the target version includes a version in the historical version whose second stability during local operation meets the stable condition.
[0007] In a possible implementation, after starting the locally backed-up target version, the process further includes monitoring that the target version crashes during operation.
[0008] If it is determined that the crash rate of the target version is greater than the crash rate threshold, sending a second prompt message to the business process corresponding to the target plug-in;
[0009] Determine whether to continue running the target version according to a second running instruction sent by the business process, where the second running instruction is determined by the business process in response to the second prompt message.
[0010] In a possible implementation manner, determining that the current version is an abnormal version includes:
[0011] If it is determined that the version information of the current version is in the list of abnormal versions recorded locally, then the current version is determined to be an abnormal version;
[0012] The recording that the current version is the abnormal version includes:
[0013] The version information of the current version is recorded in the abnormal version list.
[0014] In a second aspect of the present application, a plug-in running device is provided, comprising:
[0015] A plug-in version obtaining unit, used to obtain the current version of the target plug-in to be started;
[0016] A plug-in running unit is used to start a local backup target version when it is determined that the current version is an abnormal version; the abnormal version includes a historical version of the target plug-in, whose first stability during local operation meets the abnormal condition, and the target version includes a historical version, whose second stability during local operation meets the stable condition.
[0017] In a possible implementation, the first stability includes a crash rate of the version during local operation, and the abnormal condition includes a crash rate greater than a crash rate threshold;
[0018] The second stability includes the crash rate of the version during local operation and the cumulative number of startups locally, and the stability condition includes that the crash rate is not greater than the crash rate threshold and the cumulative number of startups is greater than the startup number threshold.
[0019] In a possible implementation, the plug-in execution unit is further configured to:
[0020] When determining that the current version is not the abnormal version, starting the current version; and
[0021] If it is determined that the crash rate of the current version is not greater than the crash rate threshold, and the cumulative number of times the current version is started locally is greater than the number of times the current version is started, the current version is backed up as the target version.
[0022] In a possible implementation, the plug-in running unit is further configured to, after starting the current version, monitor a crash of the current version during operation.
[0023] If it is determined that the crash rate of the current version is greater than the crash rate threshold, the current version is recorded as the abnormal version, otherwise the cumulative crash count of the current version is updated, and the updated cumulative crash count is used to determine the crash rate of the current version when it crashes next time.
[0024] In a possible implementation, the plug-in running unit is specifically used to:
[0025] Obtaining, by monitoring the code, a monitoring result of the crash capture function monitoring whether the current version crashes;
[0026] If it is determined that the monitoring result indicates that the current version crashes, then it is monitored that the current version crashes during operation.
[0027] In a possible implementation, the target version includes multiple versions, and the plug-in running unit is specifically used to:
[0028] According to the backup time of each target version among the multiple target versions, start the target version with the smallest time difference between the backup time and the current time; or
[0029] Randomly start one of the multiple target versions; or
[0030] The target version with the third highest stability among the multiple target versions is started.
[0031] In a possible implementation, the plug-in running unit is specifically used to:
[0032] determining at least two target versions from the multiple target versions;
[0033] Determining the third stability of each of the at least two target versions through multiple restart operations, wherein each restart operation comprises: starting one of the at least two target versions, and determining the third stability of the one target version according to a crash rate of the one target version in a target period, wherein the third stability of the one target version is negatively correlated with the crash rate of the one target version in the target period;
[0034] The target version with the third highest stability among the at least two target versions is started.
[0035] In a possible implementation, the plug-in execution unit is further configured to:
[0036] After determining that the current version is the abnormal version, determining that there is no locally backed-up target version, or determining that the current version is the locally backed-up target version, sending a first prompt message to the business process corresponding to the target plug-in;
[0037] Determine whether to start the current version according to a first running instruction sent by the business process, where the first running instruction is determined by the business process in response to the first prompt message.
[0038] In a possible implementation, the plug-in running unit is further configured to start the locally backed-up target version, and then detect that the target version crashes during operation.
[0039] If it is determined that the crash rate of the target version is greater than the crash rate threshold, sending a second prompt message to the business process corresponding to the target plug-in;
[0040] Determine whether to continue running the target version according to a second running instruction sent by the business process, where the second running instruction is determined by the business process in response to the second prompt message.
[0041] In a third aspect of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect and any possible implementation manner is implemented.
[0042] In a fourth aspect of the present application, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various possible implementations of the first aspect above.
[0043] In a fifth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on a computer, the computer executes the method described in the first aspect and any possible implementation manner.
[0044] Since the embodiment of the present application adopts the above technical solution, it has at least the following technical effects:
[0045] 1) When the current version is an abnormal version, the highly stable target version of the local backup is directly started. The terminal device does not need to send the abnormal information of the current version to the server, which reduces the time for information transmission; there is no need to manually analyze the abnormal information of the current version to determine how to deal with the abnormal version, which reduces the time for determining how to deal with the abnormal version, thereby improving the efficiency of handling abnormal versions of the plug-in.
[0046] 2) In the embodiment of the present application, after determining that the current version on the terminal device is an abnormal version, the local backup target version is started to replace the current version. During this process, it is not necessary to know whether the current version on other terminal devices is an abnormal version, thereby realizing the processing of abnormal plug-ins for a single terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of the internal architecture of a terminal device 100 provided in an embodiment of the present application;
[0048] Figure 2 An example diagram of a plug-in running method provided in an embodiment of the present application;
[0049] Figure 3 An example diagram of an application description interface provided in an embodiment of the present application;
[0050] Figure 4 An example diagram of a normal loading interface of an application provided in an embodiment of the present application;
[0051] Figure 5 An example diagram of an abnormal loading interface of an application provided in an embodiment of the present application;
[0052] Figure 6 An example diagram of the interaction of internal modules of a terminal device provided in an embodiment of the present application;
[0053] Figure 7 A structural diagram of a plug-in running device provided in an embodiment of the present application;
[0054] Figure 8 A structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to better understand the technical solution provided by the embodiments of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0056] In order to help those skilled in the art better understand the technical solution of the present application, the technical terms involved in the present application are explained below.
[0057] Plugin: For the Android system, a plugin is an independent Android installation package (APK) file; an application app installed by the Android system can install and load the plugin through the plugin framework without going through the system installer, so the user does not need to be aware of the plugin installation process; plugins are generally used for dynamic expansion and repair of Android application APP functions.
[0058] Version information: information related to the version of the plug-in. In the embodiment of the present application, the version information may include but is not limited to one or more of the following information: version identification (such as version number), storage path of the version file, and signature information of the version.
[0059] Version file: a file corresponding to the version of the plug-in. The version file in the embodiment of the present application mainly refers to the APK file of the corresponding version of the plug-in.
[0060] Target plug-in: The target plug-in in the embodiment of the present application can be any type of plug-in running in the application of the terminal device, such as but not limited to a browser plug-in, an audio and video playback plug-in, a game application plug-in, etc.
[0061] Version, current version and historical version of the target plug-in: When some exceptions occur during the operation of the target plug-in or a function update is performed, the current APK file of the plug-in can be modified to obtain a new APK file, where an APK file corresponding to the target plug-in can be considered as a version of the target plug-in; the current version of the target plug-in refers to the version corresponding to the APK file of the target plug-in currently installed and running on the terminal device; the historical version of the target plug-in is the version of the target plug-in released before the current moment.
[0062] Abnormal version, target version, abnormal condition and stable condition: the abnormal version includes the historical version of the target plug-in, whose first stability meets the abnormal condition during the local operation on the terminal device; the target version includes the historical version of the target plug-in, whose second stability meets the stable condition during the local operation on the terminal device; the abnormal condition refers to the situation where the abnormal rate of the plug-in version (including the current version or the historical version) reaches the preset value during the operation; the stable condition refers to the situation where the abnormal rate of the plug-in version does not reach the preset value during the operation and the number of startups meets the requirements; wherein the abnormal situation in the embodiment of the present application may be but is not limited to a crash, and further in the embodiment of the present application, the crash rate of the version during the operation is determined as the first stability of the version, the crash rate greater than the crash rate threshold is set as the stable condition, the crash rate of the version during the operation and the cumulative number of startups of the version locally are determined as the second stability of the version, and the crash rate not greater than the crash rate threshold and the cumulative number of startups greater than the startup number threshold are set as the stable condition.
[0063] The design concept of this application is described below.
[0064] During the update and iteration process of the plug-in version, if an exception (such as a crash) occurs during the operation of the current version of the plug-in on the terminal device, the terminal device needs to upload the exception information to the server; then after the engineer analyzes the exception information uploaded by multiple terminal devices and finds out that the current version is an abnormal version, he determines the processing method for the abnormal version according to the actual situation, such as optimizing the abnormal version to obtain a new version or replacing the abnormal version with a historical version with better stability, and needs to inform the users of each terminal device to download and install the new version or the determined historical version on the terminal device; however, the above-mentioned processing of the abnormal version has the following disadvantages: 1) The terminal device needs to upload the exception information, and the abnormal information needs to be manually analyzed before the processing method for the abnormal version can be determined, which is a lengthy process and has low processing efficiency; the terminal device cannot upload the exception information in time when it is offline, which further slows down the processing of the abnormal version; 2) In the current related technology, the processing method for the same version is finally determined based on the exception information of the same version on multiple terminal devices, but the stability of the same version running on different terminal devices will be different due to the influence of the environment of the terminal device, the operation path of the version file and other information, and the related technology cannot effectively process the abnormal version of the plug-in on a single terminal device.
[0065] In view of this, the inventor has designed a plug-in operation method, apparatus, device and computer storage medium. On the one hand, because the related technology takes a long time to manually analyze the abnormal information and determine the processing method of the abnormal version based on the analysis result when processing the abnormal version of the plug-in, the embodiment of the present application considers saving manpower and automatically processing the abnormal version of the plug-in; and considering the environment of the terminal device where the plug-in is running, information such as the operation path of the plug-in version file will affect the stability of the plug-in operation. The stability of the same version when running on different terminal devices will be different. The related technology processes the same abnormal version on different terminal devices, and there is no solution for processing different abnormal versions on a single terminal device, which will affect the processing accuracy of the version on a single terminal device. This embodiment of the present application considers processing abnormal versions on a single terminal device; in addition, the terminal device uploading abnormal information of the current version also increases the processing flow and time, so the embodiment of the present application considers directly determining the processing method for abnormal versions on the terminal device and processing the abnormal versions; specifically, in the embodiment of the present application, the current version of the target plug-in to be started is obtained; when it is determined that the current version is an abnormal version, the target version of the local backup is started, wherein: the abnormal version and the target version are both determined based on the historical operation of the plug-in version on the terminal device, the abnormal version includes the historical version of the target plug-in, the version whose first stability meets the abnormal condition during the local operation, and the above-mentioned target version includes the historical version, the version whose second stability meets the stable condition during the local operation.
[0066] In order to more clearly understand the design concept of the present application, the following example introduces the plug-in running method provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0067] In an embodiment of the present application, a plug-in manager is provided to implement the above-mentioned plug-in running method. The plug-in manager provided in an embodiment of the present application is taken as an example to exemplarily introduce the plug-in running method.
[0068] See also Figure 1 , which is a schematic diagram of a processing mechanism of a plug-in manager, or can also be a schematic diagram of an internal architecture of a terminal device 100, the internal architecture diagram including a plug-in manager 110, a database 120 and an exception catcher 130; wherein:
[0069] After obtaining the current version to be started, the plug-in manager 110 obtains the target version of the local backup from the database 120 and starts it if it is determined that the current version is an abnormal version recorded in the database 120 of the terminal device 100. If it is determined that the current version is not an abnormal version, the current version can be started; and
[0070] A monitoring code is set in the plug-in manager 110. When the plug-in manager 110 executes the monitoring code, the monitoring result of whether an exception occurs during the running of the current version (or target version) on the terminal device by the exception catcher 130 can be obtained through the interface, and whether the current version (or target version) is abnormal can be determined based on the monitoring result.
[0071] The database 120 records the abnormal version and the backup target version, wherein the database 120 can record the abnormal version in the form of but not limited to recording the version information of the abnormal version, and can back up the target file abnormality in the form of but not limited to backing up the version file of the target version; and the database 120 can record the abnormal version and the target version to different data storage locations, such as recording the abnormal version to the abnormal version list, backing up the target version to the stable version file list, etc.
[0072] The exception catcher 130 runs on the terminal device 100, and is used to monitor whether an exception occurs during the operation of the plug-in version on the terminal device 100; when the terminal device 100 is installed with the Android system; the exception that occurs during the operation of the plug-in version may be but is not limited to a crash; in the embodiment of the present application, when the exception is a crash, the exception catcher 130 may be a crash catcher, which is used to monitor whether the plug-in version crashes during the operation of the terminal device 100; the crash catcher may be but is not limited to crash capture functions such as Thread.UncaughtExceptionHandler function, BroadcastReceive function, and unwind function. Specifically, the Thread.UncaughtExceptionHandler function can be used to collect Java layer crashes, the BroadcastReceiver function can be used to obtain the occurrence of ANR (the application attached to the target plug-in is unresponsive), and the unwind function can be used to obtain Native layer crashes, etc. to perform comprehensive crash information collection.
[0073] In the embodiment of the present application, the terminal device 110 may be, but is not limited to, a mobile terminal, a fixed terminal or a portable terminal, such as a mobile phone, a site, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a gaming device or any combination thereof, including accessories and peripherals of these devices or any combination thereof. Each terminal device 110 may install and run various versions of version files of the target plug-in, install and run the application corresponding to the target plug-in, run the program of the plug-in manager 110, and run the program of the exception catcher 130, etc.
[0074] The following is a detailed description of the method involved in the embodiment of the present application. Figure 2 The method can be used in the above-mentioned plug-in manager 110, and specifically comprises the following steps:
[0075] Step S201, obtaining the current version of the target plug-in to be started.
[0076] It should be noted that, in the embodiment of the present application, obtaining the current version of the target plug-in to be started refers to the process in which the user uses the application on the terminal device, after triggering the start of the target plug-in, and before starting the target plug-in, obtaining the version file of the target plug-in currently installed and used on the terminal device as the current version.
[0077] Step S202: when it is determined that the current version is an abnormal version, the target version of the local backup is started.
[0078] In an embodiment of the present application, during the local operation of each historical version of the target plug-in on the terminal device, it is determined whether each historical version of the target plug-in is an abnormal version and a stable version according to the stability of each historical version during the local operation; if the first stability of a historical version during the local operation meets the abnormal condition, the historical version is recorded locally as an abnormal version, and then after obtaining the current version to be started, it can be directly determined whether the current version to be started is an abnormal version according to the information of the locally recorded abnormal version; if the second stability of a historical version during the local operation meets the stable condition, the historical version is backed up locally as a target version, and then after determining that the current version to be started is an abnormal version, the locally backed up target version can be started.
[0079] As an embodiment, in the embodiment of the present application, multiple historical versions whose second stability meets the abnormal condition can be backed up as the target version; or only the historical version whose release time is closest to the current time among the multiple historical versions whose second stability meets the stability condition can be backed up as the target version; and each time a new historical version whose second stability meets the abnormal condition is determined, the newly determined historical version can replace the locally backed up target version.
[0080] Furthermore, if multiple target versions are backed up locally, then in step S202, the locally backed up target version may be started in the following startup manner, but is not limited to the following startup manner.
[0081] The first startup method: Start the target version of the latest backup
[0082] That is, according to the backup time of each target version among the multiple target versions of the backup, the target version with the smallest time difference between the backup time and the current time can be started.
[0083] The second startup method: randomly start one of the multiple target versions of the backup.
[0084] The third startup method: Start the target version with the third highest stability among the multiple target versions backed up.
[0085] Specifically, at least two target versions may be determined from the multiple target versions, and the third stability of each of the at least two target versions may be determined through multiple restart operations, and then the target version with the highest third stability among the at least two target versions may be started; wherein:
[0086] The above-mentioned at least two target versions may be some of the multiple target versions backed up, or may be all of the multiple target versions backed up; each of the above-mentioned restart operations includes: starting one of the above-mentioned at least two target versions, and determining the third stability of the above-mentioned target version according to the crash rate of the above-mentioned target version in the target period, wherein the above-mentioned third stability is used to characterize the stability of the target version in running in the target period.
[0087] The third stability of the above-mentioned target version is negatively correlated with the crash rate of the above-mentioned target version in the target period. For example, it is possible but limited to determining the inverse of the crash rate of a target version in the target period as the third stability of the target version, or determining the difference between a preset stability reference value and the crash rate of the target version in the target period as the third stability of the target version, etc.; wherein determining the crash rate of the target version in the target period will be introduced below, which is similar to determining the crash rate of historical versions in historical operating cycles.
[0088] It should be noted that in the embodiment of the present application, the stability of the target version in the corresponding historical operation cycle is higher than the stability of the abnormal version in the corresponding historical operation cycle, that is, for a version of the target plug-in, the first stability of the version may meet the above-mentioned abnormal condition, and the second stability of the version may also meet the above-mentioned stability condition; but in some special cases, the first stability of the version does not meet the abnormal condition and the second stability of the version does not meet the stability condition. For example, when a version of a target plug-in is initially started on a terminal device, since there is no historical operation information of the version on the terminal device, it is impossible to know whether the version can run stably on the terminal device. In this case, it may happen that the first stability of the version does not meet the abnormal condition and the second stability of the version does not meet the stability condition. In this case, it can be considered that the version is neither the abnormal version nor the target version. At this time, the version can be run by default until it is determined whether it is an abnormal version or a target version, or the business process can be notified to allow the business process to indicate whether to run the version. The version can be the current version or the historical version of the target plug-in.
[0089] As an embodiment, taking into account that saving storage space of the terminal device can improve the data processing efficiency on the terminal device to a certain extent, and in order to facilitate the query of abnormal versions and the acquisition of target versions, the embodiments of the present application can, but are not limited to, record the abnormal version locally on the terminal device in the form of recording the version information of the abnormal version, and can, but are not limited to, back up the target version locally on the terminal device in the form of backing up the version file of the target version.
[0090] As an embodiment, if the abnormal version is recorded in the above-mentioned local abnormal version list, then in step S202, the abnormal version list can be directly queried. If it is determined that the version information of the current version is in the locally recorded abnormal version list, it is determined that the current version is an abnormal version.
[0091] Furthermore, in order to more conveniently and quickly query the abnormal version and obtain the target version, the abnormal version and the target version can be recorded in different local data storage locations of the terminal device in the embodiment of the present application, such as but not limited to recording the abnormal version to an abnormal version list, and backing up the target version to a stable version file list (such as a backup target for a specific version), etc.
[0092] The following is a detailed description of the process of determining abnormal versions and target versions in historical versions.
[0093] Taking into account that the stability of the historical version during operation is related to the abnormal information during the operation of the historical version, and considering that whether the historical version is stable is related to the number of normal startups of the historical version, the embodiment of the present application uses the abnormal information and the number of startups of the historical version during operation to judge whether the stability of the historical version meets the abnormal conditions and the stability conditions and record them.
[0094] Further, considering that the main situation in which anomalies occur in historical versions of the target plug-in is a crash, the crash information of the historical version is used as the above-mentioned abnormal information in an embodiment of the present application. Specifically, in an embodiment of the present application, the first stability may be the crash rate of the version during local operation, and the abnormal condition may be that the crash rate is greater than the crash rate threshold; the second stability may be the crash rate of the version during local operation and the cumulative number of local startups, and the stable condition may be a version with a crash rate not greater than the crash rate threshold and a cumulative number of startups greater than the startup number threshold.
[0095] The above-mentioned crash rate can be the crash frequency of the historical version in the historical operation cycle, and the above-mentioned historical operation cycle can be the time period between the first installation time of the historical version and the most recent crash time. The above-mentioned first installation time refers to the time when the above-mentioned historical version is first installed on the terminal device; the above-mentioned most recent crash time is the time closest to the current time when the crash occurs during the operation of the historical version on the above-mentioned terminal device; specifically, the crash rate of a historical version of the target plug-in can be calculated by but not limited to the following formula 1.
[0096]
[0097] In formula 1, B p Is the identification result of whether a historical version of the target plug-in is an abnormal version, T p is the time when the historical version is first installed on the terminal device; T p ' is the most recent crash time of the historical version running on the terminal device; S p is the above-mentioned collapse rate threshold; (T p '-T p ) is the historical running cycle of the historical version; C p is the number of crashes that occurred in this historical version during its historical running cycle; It is the crash frequency of the historical version in the historical operation cycle; 1 is the identification information of the abnormal version, and 0 is the identification information of the non-abnormal version.
[0098] When it is determined that the Bp of a historical version is 0, it can be determined whether the historical version is the target version based on the following formula 2.
[0099]
[0100] In formula 2, Wp is the identification result of whether a historical version of the target plug-in is a stable version, Ep is the cumulative number of times the above historical version is started on a terminal device, and the above L p It is the above startup count threshold; 1 is the identification information of a stable version, and 0 is the identification information of an unstable version.
[0101] Here, in the third startup mode in the above step S202, the crash rate of each target version in the target period of time among the multiple target versions to be backed up is described:
[0102] For each target version, reinstall it on the terminal device and start it; determine the reinstallation time of the target version as the above-mentioned first installation time, and the number of crashes in the target period and the time when the last crash occurred in the target period as the above-mentioned most recent crash time, and then determine the crash rate of the target version based on the above-mentioned formula 2; wherein the target period can be but is not limited to a time period from the above-mentioned current reinstallation time to a set time period after the above-mentioned current reinstallation time.
[0103] As an embodiment, the current version to be started may not be an abnormal version that has been recorded locally. Therefore, in the above step S202, when it is determined that the current version is not an abnormal version recorded locally, the above current version is started; and after starting the current version, it is determined whether the current version is a stable version based on the second stability of the current version, that is, if it is determined that the crash rate of the current version is not greater than the crash rate threshold, and the cumulative number of local startups of the current version is greater than the startup number threshold, the current version is backed up locally as the target version.
[0104] Furthermore, after starting the current version, although the current version is not an abnormal version recorded locally, it does not mean that the current version is a highly stable version. The current version may still have abnormalities during operation due to the environment of the terminal device and other reasons. Therefore, in the embodiment of the present application, after starting the above-mentioned current version, it is possible to monitor whether the current version crashes during operation, and perform corresponding processing when the current version is detected to have crashed. Specifically, when the current version is detected to have crashed during operation, the crash rate of the current version at the time of the crash is determined. If it is determined that the crash rate of the current version is greater than the crash rate threshold, the current version is recorded locally on the terminal device as an abnormal version, such as recording the version information of the current version in the above-mentioned abnormal version list; if the crash rate of the current version is not greater than the crash rate threshold, the cumulative number of crashes of the current version is updated, and the updated cumulative number of crashes is used to determine the crash rate of the next crash of the current version during operation on the above-mentioned terminal device.
[0105] Among them, in the embodiments of the present application, it is possible but not limited to obtaining the monitoring result of the crash capture function monitoring whether the current version crashes by executing the monitoring code in the plug-in manager; when it is determined that the monitoring result indicates that the above-mentioned current version has crashed, it is determined that the above-mentioned current version is monitored to crash during operation.
[0106] As an embodiment, in step S202, it is determined that the current version is an abnormal version, and the following two abnormal situations may also exist:
[0107] The first abnormal situation: the terminal device does not have the target version of the backup locally.
[0108] Specifically, for example, the current version is the first version of the target plug-in that is started on the terminal device for the first time.
[0109] The second abnormal situation: The current version is the target version of the local backup.
[0110] That is, in this abnormal situation, the current version is both the abnormal version recorded locally and the target version of the local backup; for example, in the process of running the current version on the terminal device in the past, it is determined that the current version is a stable version and recorded locally, and since the plug-in service provider has not released a new version of the target plug-in, the current version will be used on the above terminal device. During the continued use, the crash rate of the current version is greater than the crash rate threshold, and the current version is recorded locally as an abnormal version;
[0111] In an embodiment of the present application, if it is determined in step S202 that the above two abnormal situations have occurred, a first prompt message is sent to the business process corresponding to the target plug-in, and the first prompt message is used to confirm with the business process whether to continue to start the current version; and determine whether to start the above current version based on the first running instruction sent by the business process, and the above first running instruction is determined by the above business process in response to the above first prompt message; if the target plug-in is a plug-in that needs to be loaded when the corresponding application displays the home page, the business process can instruct to continue to start the above current version through the first running instruction; if the target plug-in is a plug-in corresponding to the attachment function after the corresponding application is started, the business process can instruct not to start the above current version through the first running instruction, etc.
[0112] As an embodiment, the second stability of the target version in the historical operation process on the terminal device meets the stability condition, but the environment in which the terminal device is located and the network quality of its network may change at any time. The second stability of the historical operation of the target version cannot represent the stability of the target version in the operation process at the current moment. Therefore, after starting the locally backed up target version in step S202, the embodiment of the present application can also monitor whether the target version crashes during operation and handle it according to the monitoring result;
[0113] Specifically, if it is monitored that the target version crashes during operation and it is determined that the crash rate of the target version is greater than the crash rate threshold, a second prompt message is sent to the business process corresponding to the target plug-in; and based on the second running instruction sent by the above business process, it is determined whether to continue running the above target version, and the above second running instruction is determined by the above business process in response to the above second prompt message.
[0114] The following is a specific example of how to run the plugin.
[0115] In this example, the target plug-in is the WebView plug-in; see Figure 3 , provides a description interface of the game application corresponding to the WebView plug-in; when the current version of the WebView plug-in runs normally, the normal loading interface of the above game application is as follows Figure 4 ; When the current version of the WebView plug-in crashes during operation, the loading interface of the above game application may appear Figure 5 The example shows an incomplete loading interface (such as a blue screen or a white screen). Therefore, when an exception occurs in the current version of the target plug-in, the current version needs to be processed in time so that the above-mentioned game application can load the function of the WebView plug-in normally.
[0116] See also Figure 6 When the current version of the target plug-in is triggered to start, the information interaction between the internal plug-in manager of the terminal device, the abnormal version list, the stable version file list, and the crash catcher (in this example, the crash catcher is used as the above-mentioned abnormal catcher 130 for exemplary explanation) is as follows.
[0117] Step S601, triggering the startup of the current version P of the target plug-in.
[0118] Step S601 includes two cases: step S602 and step S608
[0119] Step S602: The plug-in manager determines that the current version P is an abnormal version based on the abnormal version list.
[0120] Step S602 includes two situations: step S603 and step S606.
[0121] Step S603, the plug-in manager determines that there is a backup target file in the stable version file list and the current version P is not the backup target version, then obtains the version file of the backup target version from the stable version file list; uses the version file of the target version to overwrite the version file of the current version P, sets the number of crashes of the target version to 0, and starts the target version.
[0122] Step S604: The plug-in manager obtains the monitoring result of the crash capturer on the target version by monitoring the code, determines according to the monitoring result that the target version crashes, and the crash rate of the target version is greater than the crash rate threshold, and then sends a second prompt message to the business process corresponding to the target plug-in.
[0123] Step S605: The plug-in manager determines whether to continue running the target version according to the second running instruction sent by the business process.
[0124] Step S606: The plug-in manager determines that the current version P is the target version backed up in the stable version file list, or determines that there is no target version backed up in the stable version file list, and then sends a first prompt message to the business process corresponding to the target plug-in.
[0125] Step S607: The plug-in manager determines whether to start the current version P according to the first running instruction sent by the business process.
[0126] Step S608: The plug-in manager determines that the current version P is not an abnormal version based on the abnormal version list, and then starts the current version P.
[0127] Step S609: The plug-in manager determines that the current version P is a target version that meets the stability condition based on the accumulated startup times of the current version P, and then backs up the version files of the current version P to the stable version file list.
[0128] In step S610, the plug-in manager obtains the monitoring result of the crash capturer on the current version P through the monitoring code, determines that the current version P crashes according to the monitoring result, and the crash rate of the current version P is greater than the crash rate threshold, then records the version information of the current version P into the abnormal version list.
[0129] The detailed process of the above steps S601 to S610 can be found in the above-mentioned relevant content of the embodiment of the present application, and will not be repeated here.
[0130] In an embodiment of the present application, when the current version is an abnormal version, the target version of the local backup is directly started. There is no need for the terminal device to send abnormal information to the server, nor is there any need to manually analyze the abnormal information sent by multiple terminal devices. Instead, the processing method for the abnormal version is determined, which reduces the time for determining the processing method for the abnormal version and improves the efficiency of processing abnormal versions of the plug-in. After determining that the current version on the terminal device is an abnormal version, the target version of the local backup of the terminal device is started to replace the current version. In this process, it is not necessary to know whether the current version is an abnormal version on other terminal devices, thereby achieving fast and effective processing of abnormal plug-ins on a single terminal device.
[0131] Please refer to Figure 7 Based on the same inventive concept, the present application embodiment provides a plug-in device 700, including:
[0132] A plug-in version obtaining unit 701 is used to obtain the current version of the target plug-in to be started;
[0133] The plug-in running unit 702 is used to start the local backup target version when determining that the current version is an abnormal version.
[0134] In a possible implementation, the plug-in execution unit 702 is further configured to:
[0135] When it is determined that the current version is not the abnormal version, starting the current version; and
[0136] If it is determined that the crash rate of the current version is not greater than the crash rate threshold, and the cumulative number of local startups of the current version is greater than the startup number threshold, the current version is backed up as the target version.
[0137] As an embodiment, the plug-in running unit 702 is also used to monitor the crash of the current version during operation after starting the current version. If it is determined that the crash rate of the current version is greater than the crash rate threshold, the current version is recorded as the abnormal version. Otherwise, the cumulative crash count of the current version is updated. The updated cumulative crash count is used to determine the crash rate of the current version when it crashes next time.
[0138] As an embodiment, the plug-in running unit 702 is specifically used to: obtain the monitoring result of the crash capture function to monitor whether the above-mentioned current version crashes through monitoring code; if it is determined that the above-mentioned monitoring result indicates that the above-mentioned current version crashes, then monitor that the above-mentioned current version crashes during operation.
[0139] As an embodiment, the above-mentioned target version includes multiple versions, and the plug-in running unit 702 is specifically used to: according to the backup time of each target version among the above-mentioned multiple target versions, start the target version with the smallest time difference between the backup time and the current time; or randomly start one of the above-mentioned multiple target versions; or start the target version with the third highest stability among the above-mentioned multiple target versions.
[0140] As an embodiment, the plug-in running unit 702 is specifically used to: determine at least two target versions from the above-mentioned multiple target versions; determine the third stability of each of the above-mentioned at least two target versions through multiple restart operations, wherein each restart operation includes: starting one of the above-mentioned at least two target versions, and determining the third stability of the above-mentioned target version according to the crash rate of the above-mentioned target version in the target time period, wherein the third stability of the above-mentioned target version is negatively correlated with the crash rate of the above-mentioned target version in the target time period; and starting the target version with the highest third stability among the above-mentioned at least two target versions.
[0141] As an embodiment, the plug-in running unit 702 is also used to: after determining that the above-mentioned current version is the above-mentioned abnormal version, determine that there is no target version backed up locally, or determine that the above-mentioned current version is the target version backed up locally, then send a first prompt message to the business process corresponding to the above-mentioned target plug-in; determine whether to start the above-mentioned current version according to the first running instruction sent by the above-mentioned business process, and the above-mentioned first running instruction is determined by the above-mentioned business process in response to the above-mentioned first prompt message.
[0142] As an embodiment, the plug-in running unit 702 is also used to start the locally backed-up target version, and then monitor that the above target version crashes during operation. If it is determined that the crash rate of the above target version is greater than the crash rate threshold, a second prompt message is sent to the business process corresponding to the above target plug-in; based on the second running instruction sent by the above business process, it is determined whether to continue running the above target version, and the above second running instruction is determined by the above business process in response to the above second prompt message.
[0143] As an example, Figure 7 The device in can be used to implement any of the plug-in running methods discussed above.
[0144] Based on the same inventive concept, an embodiment of the present application provides a terminal device, and the terminal device 100 is introduced below.
[0145] Please refer to Figure 8The above-mentioned plug-in manager and exception catcher can run on the terminal device 100, the current version and historical version of the target plug-in and the application software corresponding to the target plug-in can be installed on the terminal device 100, and the terminal device 100 includes a display unit 840, a processor 880 and a memory 820, wherein the display unit 840 includes a display panel 841 for displaying a user interactive operation interface, etc.
[0146] Optionally, the display panel 841 may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
[0147] The processor 880 is used to read the computer program and then execute the method defined by the computer program. For example, the processor 880 reads the program of the plug-in manager 110, the program of the exception catcher 130, the file corresponding to the target plug-in, and the file of the application corresponding to the target plug-in, so as to run the target plug-in on the terminal device 100 and display the interface of the application corresponding to the target plug-in on the display unit 840. The processor 880 may include one or more general-purpose processors and may also include one or more DSPs (Digital Signal Processors) to perform related operations to implement the technical solutions provided in the embodiments of the present application.
[0148] The memory 820 generally includes internal memory and external memory, and the internal memory can be a random access memory (RAM), a read-only memory (ROM), and a cache (CACHE), etc. The external memory can be a hard disk, an optical disk, a USB disk, a floppy disk or a tape drive, etc. The memory 820 is used to store computer programs and other data, and the computer program includes applications corresponding to each client, etc. Other data may include data generated after the operating system or application is run, and the data includes system data (such as configuration parameters of the operating system) and user data. In the embodiment of the present application, program instructions are stored in the memory 820, and the processor 880 executes the program instructions in the memory 820 to implement any of the plug-in operation methods discussed in the previous figure.
[0149] The display unit 840 is used to receive input digital information, character information or contact touch operation / contactless gesture, and generate signal input related to user settings and function control of the terminal device 100. Specifically, in the embodiment of the present application, the display unit 840 may include a display panel 841. The display panel 841, such as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or on the display panel 841), and drive the corresponding connection device according to a pre-set program.
[0150] Optionally, the display panel 841 may include a touch detection device and a touch controller. The touch detection device detects the touch position of the player, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 880, and can receive and execute the command sent by the processor 880.
[0151] The display panel 841 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 840, the terminal device 100 may further include an input unit 830, which may include a graphic input device 831 and other input devices 832, wherein the other input devices may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, and a joystick.
[0152] In addition to the above, the terminal device 100 may also include a power supply 890 for supplying power to other modules, an audio circuit 860, a near field communication module 870, and an RF circuit 810. The terminal device 100 may also include one or more sensors 850, such as an acceleration sensor, a light sensor, a pressure sensor, etc. The audio circuit 860 specifically includes a speaker 861 and a microphone 862, etc. For example, the terminal device 100 can collect the user's voice through the microphone 862 and perform corresponding operations.
[0153] As an embodiment, the number of processors 880 may be one or more, and the processor 880 and the memory 820 may be coupled or relatively independently configured.
[0154] As an example, Figure 8 The processor 880 in the embodiment may be used to implement the following Figure 7 The functions of the plug-in version obtaining unit 701 and the plug-in running unit 702 in the embodiment.
[0155] As an example, Figure 8The processor 880 in can be used to implement the functions of the plug-in manager discussed above.
[0156] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0157] Alternatively, if the above-mentioned integrated unit of the invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the above-mentioned methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0158] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0159] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A plug-in operation method, characterized in that: include: Get the current version of the target plug-in to be started; When determining that the current version is an abnormal version, starting the target version of the local backup; The abnormal version includes a version of the target plug-in whose first stability meets the abnormal condition during local operation among the historical versions, and the target version includes a version of the target plug-in whose second stability meets the stable condition during local operation among the historical versions; The target version includes multiple versions, and the target version for starting local backup includes: determining at least two target versions from the multiple target versions; Determining the third stability of each of the at least two target versions through multiple restart operations, wherein each restart operation comprises: starting one of the at least two target versions, and determining the third stability of the one target version according to a crash rate of the one target version in a target period, wherein the third stability of the one target version is negatively correlated with the crash rate of the one target version in the target period; The target version with the third highest stability among the at least two target versions is started.
2. The method according to claim 1, characterized in that The first stability includes the crash rate of the version during local operation, and the abnormal condition includes the crash rate being greater than a crash rate threshold; The second stability includes the crash rate of the version during local operation and the cumulative number of startups locally, and the stability condition includes that the crash rate is not greater than the crash rate threshold and the cumulative number of startups is greater than the startup number threshold.
3. The method according to claim 2, characterized in that Also includes: When determining that the current version is not the abnormal version, starting the current version; as well as If it is determined that the crash rate of the current version is not greater than the crash rate threshold, and the cumulative number of times the current version is started locally is greater than the number of times the current version is started, the current version is backed up as the target version.
4. The method according to claim 3, characterized in that After the current version is started, the method further includes monitoring the crash of the current version during operation. If it is determined that the crash rate of the current version is greater than the crash rate threshold, the current version is recorded as the abnormal version, otherwise the cumulative crash count of the current version is updated, and the updated cumulative crash count is used to determine the crash rate of the current version when it crashes next time.
5. The method according to claim 4, characterized in that The current version has been detected to crash during operation, including: Obtaining, by monitoring the code, a monitoring result of the crash capture function monitoring whether the current version crashes; If it is determined that the monitoring result indicates that the current version crashes, then it is monitored that the current version crashes during operation.
6. The method according to any one of claims 1 to 5, characterized in that: After determining that the current version is the abnormal version, the method further includes: Determining that there is no target version backed up locally, or determining that the current version is the target version backed up locally, sending a first prompt message to the business process corresponding to the target plug-in; Determine whether to start the current version according to a first running instruction sent by the business process, where the first running instruction is determined by the business process in response to the first prompt message.
7. A plug-in running device, characterized in that: include: A plug-in version obtaining unit, used to obtain the current version of the target plug-in to be started; A plug-in running unit, configured to start a locally backed-up target version when determining that the current version is an abnormal version; the abnormal version includes a version of the target plug-in whose first stability during local operation satisfies an abnormal condition among historical versions, and the target version includes a version of the target plug-in whose second stability during local operation satisfies a stable condition among historical versions; The target version includes multiple versions, and the target version for starting local backup includes: determining at least two target versions from the multiple target versions; Determining the third stability of each of the at least two target versions through multiple restart operations, wherein each restart operation comprises: starting one of the at least two target versions, and determining the third stability of the one target version according to a crash rate of the one target version in a target period, wherein the third stability of the one target version is negatively correlated with the crash rate of the one target version in the target period; The target version with the third highest stability among the at least two target versions is started.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
