Page recovery method and apparatus, and storage medium

CN115687820BActive Publication Date: 2026-09-15JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211236060.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-10
Publication Date
2026-09-15
Estimated Expiration
2042-10-10

AI Technical Summary

Technical Problem

相关的应用程序崩溃重启的技术中,应用程序崩溃重启会导致用户浏览的页面以及页面上的内存数据随之丢失,重启之后应用程序从第一个启动页面重新加载,之前在页面上的用户数据也随之丢失,用户需要重新加载页面并且在页面上添加数据

Benefits of technology

[0040] In this embodiment of the invention, at least one page is created in response to a received user operation command. Within the creation cycle corresponding to each of the at least one page, relevant data corresponding to the at least one page is extracted in real time via callback and stored locally. If a program crash is detected, the user is redirected from the at least one page to a transit page. In response to a recovery command triggered by the user on the transit page, the at least one page is recovered using the relevant data. Because this solution extracts and saves the relevant data corresponding to the current at least one page in real time within the current construction cycle, and thus promptly recovers the current at least one page after a program crash via page redirection, this solution can promptly save all data of the current page after a software crash without reloading, improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115687820B_ABST
    Figure CN115687820B_ABST
Patent Text Reader

Abstract

The application provides a page recovery method and device and a storage medium. The method comprises the following steps: creating at least one page in response to an obtained user operation instruction; extracting relevant data corresponding to the at least one page in real time through callback and storing the relevant data in the local within a respective creation period of the at least one page; jumping from the at least one page to a transfer page if program crash is detected; and recovering the at least one page by using the relevant data in response to a recovery instruction triggered by a user on the transfer page. Since the relevant data corresponding to the at least one page is extracted and saved in real time within the construction period of the at least one page, the current at least one page is recovered in time through page jumping after program crash, so that the present application can save all data of the current page in time after software crash without reloading, thereby improving the use efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of front-end technology, and in particular to a page restoration method, apparatus and storage medium. Background Technology

[0002] When software on an Android device crashes due to an unexpected program error during normal operation, it displays a crash warning to the user and then restarts. However, in these crash-restart techniques, the user's viewed pages and their associated memory data are lost. After restarting, the application reloads from the first page launched, and all previous user data is lost. The user then needs to reload the page and add data. Therefore, the technical problem is that a crash causes the complete loss of current page data, requiring users to reload data and reducing usability. Summary of the Invention

[0003] The present invention provides a page recovery method, apparatus and storage medium that can promptly save all data of the current page after a software crash without reloading, thus improving efficiency.

[0004] The technical solution of this invention is implemented as follows:

[0005] This invention provides a page recovery method, including:

[0006] In response to received user operation commands, create at least one page;

[0007] Within the creation cycle corresponding to each of the at least one page, relevant data corresponding to the at least one page is extracted in real time via callback and stored locally;

[0008] If a program crash is detected, the user is redirected from the at least one page to an intermediate page.

[0009] In response to a user's recovery command triggered on the transit page, the at least one page is recovered using the relevant data.

[0010] In the above scheme, the relevant data includes: stack information corresponding to the at least one page and at least one business data;

[0011] The step of retrieving relevant data corresponding to the at least one page in real time via callback and storing it locally within the respective creation cycle of the at least one page includes:

[0012] Within the creation cycle corresponding to each of the at least one page, the stack information and at least one business data corresponding to the at least one page are extracted in real time through callbacks, and the stack information and at least one business data are stored locally; the at least one business data is sent by the server.

[0013] In the above solution, the step of extracting the stack information and at least one business data corresponding to the at least one page in real time through callback, and storing the stack information and at least one business data locally, includes:

[0014] Extract at least one page identifier information corresponding to at least one page and at least one business data in real time according to the creation order of the at least one page;

[0015] Establish at least one mapping information between the at least one business data and the corresponding page identification information;

[0016] The stack information is constructed based on at least one page identification information in a certain order;

[0017] The stack information and at least one mapping information are stored locally.

[0018] In the above scheme, the step of redirecting from the at least one page to a relay page if a program crash is detected includes:

[0019] If a first-type program crash is detected, a callback message is generated and sent to the local preset independent child process;

[0020] The callback message is responded to by the preset independent subprocess, and the intermediate page is formed based on the stack information and the at least one mapping information to complete the jump to the at least one page.

[0021] In the above scheme, the step of redirecting from the at least one page to a relay page if a program crash is detected includes:

[0022] If a second type of program crash is detected, the at least one page is redirected by forming a transfer page through a preset independent subprocess based on the stack information and the at least one mapping information.

[0023] In the above scheme, recovering the at least one page using the relevant data includes:

[0024] According to the order of the at least one page identifier information in the stack information, the at least one business data is sequentially retrieved from the at least one mapping information for rendering to obtain the at least one page.

[0025] In the above scheme, the response to the obtained user operation command creates at least one page, including:

[0026] In response to the acquired user operation command, a request message is sent to the server;

[0027] Receive the server's response to the request information, and at least one piece of business data corresponding to the at least one page;

[0028] The at least one page is created by rendering using the at least one piece of business data.

[0029] In the above scheme, after retrieving and storing the relevant data corresponding to the at least one page in real time via callback within the respective creation cycle of the at least one page, the method further includes:

[0030] In response to the received user close command, the Nth page in the at least one page is destroyed; N is an integer greater than or equal to 1;

[0031] During the destruction cycle of the Nth page, based on the Nth page identifier information corresponding to the Nth page, the Nth mapping information corresponding to the Nth page is deleted locally from the at least one mapping information.

[0032] The Nth page identifier information corresponding to the Nth page in the stack information is deleted locally to form new stack information for storage.

[0033] This invention also provides a page recovery device, comprising:

[0034] The response creation unit is used to create at least one page in response to the received user operation instructions;

[0035] A callback storage unit is used to extract relevant data corresponding to the at least one page in real time through callbacks and store it locally within the respective creation cycles of the at least one page.

[0036] A detection unit is configured to jump from the at least one page to a transit page if a program crash is detected.

[0037] The recovery unit is used to respond to a recovery command triggered by the user on the transit page and recover the at least one page using the relevant data.

[0038] This invention also provides a page recovery device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the program to implement the steps in the above method.

[0039] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the above-described method.

[0040] In this embodiment of the invention, at least one page is created in response to a received user operation command. Within the creation cycle corresponding to each of the at least one page, relevant data corresponding to the at least one page is extracted in real time via callback and stored locally. If a program crash is detected, the user is redirected from the at least one page to a transit page. In response to a recovery command triggered by the user on the transit page, the at least one page is recovered using the relevant data. Because this solution extracts and saves the relevant data corresponding to the current at least one page in real time within the current construction cycle, and thus promptly recovers the current at least one page after a program crash via page redirection, this solution can promptly save all data of the current page after a software crash without reloading, improving efficiency. Attached Figure Description

[0041] Figure 1 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0042] Figure 2 This is an optional effect diagram of the page restoration method provided in an embodiment of the present invention;

[0043] Figure 3 This is an optional effect diagram of the page restoration method provided in an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0045] Figure 5 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0046] Figure 6 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0047] Figure 7 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0048] Figure 8 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0049] Figure 9 A schematic diagram of an optional process for a page recovery method provided in an embodiment of the present invention;

[0050] Figure 10This is a schematic diagram of the structure of the page recovery device provided in an embodiment of the present invention;

[0051] Figure 11 This is a schematic diagram of a hardware entity of the page recovery device provided in an embodiment of the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0053] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0054] If similar descriptions such as "first / second" appear in the invention document, the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0056] This invention provides a page recovery method; please refer to [link / reference]. Figure 1 This is an optional flowchart illustrating the page recovery method provided in an embodiment of the present invention, which will be combined with... Figure 1 The steps shown are explained.

[0057] S101. Respond to the obtained user operation command and create at least one page.

[0058] In this embodiment of the invention, the client responds to the acquired user operation instructions and creates at least one page.

[0059] In this embodiment of the invention, after the user opens the client on the terminal, he / she sends an operation command to the client. The client responds to the operation command, obtains relevant data of at least one page from the server, and uses the relevant data to render and create at least one page.

[0060] In this embodiment of the invention, after a user opens the client on their terminal, they sequentially send at least one operation instruction corresponding to at least one page to the client. The client sequentially responds to the at least one operation instruction and sequentially sends at least one request instruction to the server. The server responds to the at least one request instruction and sends at least one piece of business data back to the client. The client uses this at least one piece of business data to render and create at least one page.

[0061] For example, in combination Figure 2 Users can create two pages through the client: a requirement information page and an item list page. The requirement information page allows users to edit requirements regarding size, weight, and functionality. In this embodiment, the order in which the requirement information page and the item list page are created is not restricted.

[0062] S102. During the creation cycle of at least one page, relevant data corresponding to at least one page is extracted in real time through callback and stored locally.

[0063] In this embodiment of the invention, the client extracts relevant data corresponding to at least one page in real time through callbacks and stores it locally within the creation cycle corresponding to at least one page.

[0064] In this embodiment of the invention, the client extracts at least one piece of business data corresponding to at least one page, and stack information of at least one page, in real time through callbacks within the creation cycle corresponding to at least one page. The client stores the at least one piece of business data and stack information locally.

[0065] In this embodiment of the invention, after the client stores at least one business data of at least one page locally, and receives a user's close command to destroy the Nth page among the at least one pages, the client will then delete the Nth business data corresponding to the Nth page locally. Here, N is an integer greater than or equal to 1.

[0066] In this embodiment of the invention, the user clicks the client icon on the terminal to start the client. At this stage, the client begins calling the plugin to perform initialization operations, preparing for the subsequent processes. First, the `Application#registerActivityLifecycleCallbacks` method registers callback methods for the entire application's page lifecycle, detecting the creation and destruction of each page in the application. Next, the `Thread#setDefaultUncaughtExceptionHandler` method registers callback methods for Java layer application crashes, allowing detection of crashes in the application's Java layer code. Simultaneously, the `BreakPad` tool is initialized through the `NativeCrash.cpp` native interface, and crash callback methods are added. `BreakPad` can handle crashes caused by exceptions in the application's native layer code. Here, `BreakPad` is an open-source tool for capturing application crash reports. `Java` is a computer programming language used in Android application development. `Native` refers to system modules developed in Android applications using the C++ language.

[0067] During normal client use, users may open or close one or more browsing pages. The registered ActivityLifecycleCallbacks callback methods can detect the opening and closing of each page. During the onCreate lifecycle of each page, the current page's Intent data is stored in the local RecoveryStore (page data storage). During the onDestroy lifecycle, the current page's Intent data is removed from the RecoveryStore. By adding and removing data, the RecoveryStore maintains the correct data for the user's page opening, allowing the user to restore their page data. OnCreate: This is a marker indicating that a page has been created and opened in an Android application. OnDestroy: This is a marker indicating that a page has been closed and destroyed in an Android application.

[0068] S103. If a program crash is detected, the user is redirected from at least one page to an intermediate page.

[0069] In this embodiment of the invention, if the client detects a program crash, it will redirect from at least one page to a transit page.

[0070] In this embodiment of the invention, the client can use a program crash detection tool or the UnCaughtExceptionHandler plugin built into Android to detect program crashes.

[0071] In this embodiment of the invention, if the program crashes, the client extracts relevant data from the local machine, constructs a relay page, and uses the relay page to hold the relevant data to complete the redirection to at least one page.

[0072] Program crashes can include both native layer program crashes and Java layer program crashes.

[0073] In this embodiment of the invention, if the program crashes, a pre-defined independent subprocess of the client extracts stack information and at least one piece of business data from the local machine to construct a relay page. Using the stack information and at least one piece of business data held in the relay page, a redirect to at least one page is completed.

[0074] S104. Respond to the recovery command triggered by the user on the transit page, and recover at least one page using relevant data.

[0075] In this embodiment of the invention, the client responds to the recovery command triggered by the user on the transit page and recovers at least one page using relevant data.

[0076] In this embodiment of the invention, the client responds to the recovery command triggered by the user on the terminal page, and uses stack information to sequentially retrieve at least one business data from the transit page for rendering, thereby obtaining at least one page.

[0077] For example, in combination Figure 3 The transit page may include a "Restart Software" control and a "Restore Page" control. Users can click the "Restore Page" control on the transit page to trigger a restore command and restore at least one page using relevant data.

[0078] In this embodiment of the invention, at least one page is created in response to a received user operation command. Within the creation cycle corresponding to each of the at least one page, relevant data corresponding to the at least one page is extracted in real time via callback and stored locally. If a program crash is detected, the user is redirected from the at least one page to a transit page. In response to a recovery command triggered by the user on the transit page, the at least one page is recovered using the relevant data. Because this solution extracts and saves the relevant data corresponding to the current at least one page in real time within the current construction cycle, and thus promptly recovers the current at least one page after a program crash via page redirection, this solution can promptly save all data of the current page after a software crash without reloading, improving efficiency.

[0079] In some embodiments, see Figure 4 , Figure 4 This is a schematic diagram of an optional process for the page recovery method provided in an embodiment of the present invention. Figure 1 The steps S101 to S102 shown can also be implemented by S105 to S108, which will be explained in conjunction with each step.

[0080] S105. Respond to the obtained user operation command and send a request message to the server.

[0081] In this embodiment of the invention, the client responds to the acquired user operation command and sends request information to the server.

[0082] In this embodiment of the invention, the client sequentially obtains at least one operation instruction from the user, responds to the at least one operation instruction, and sends request information to the server in sequence.

[0083] Among them, user operation commands can be commands to open a page.

[0084] S106. Receive server response request information, including at least one business data corresponding to at least one page.

[0085] In this embodiment of the invention, the client receives a response request from the server, which provides at least one piece of business data corresponding to at least one page.

[0086] In this embodiment of the invention, the client receives at least one request message from the server and at least one piece of business data corresponding to at least one page.

[0087] The business data may include text information, image information, and video information, as well as the positional information of various elements on the page. In some embodiments, the business data may also include any type of information edited by the user on the page during its operation. For example, any type of information may include form information filled out by the user on the corresponding page.

[0088] S107. Render at least one page using at least one business data.

[0089] In this embodiment of the invention, the client uses at least one piece of business data to render and create at least one page.

[0090] In this embodiment of the invention, the business data may include: the length and width information of the corresponding page, the position information of the center point, and the element information within the corresponding page, as well as the position information of each element. The client uses the position information of each element to render the element information at its corresponding position to obtain the corresponding page. The element information may include: text information, image information, and video information.

[0091] S108. Within the creation cycle corresponding to at least one page, the stack information and at least one business data corresponding to at least one page are extracted in real time through callback, and the stack information and at least one business data are stored locally.

[0092] In this embodiment of the invention, the client extracts stack information and at least one business data corresponding to at least one page in real time through callbacks within the creation cycle corresponding to at least one page, and stores the stack information and at least one business data locally.

[0093] At least one piece of business data is sent by the server.

[0094] In this embodiment of the invention, the client extracts stack information and at least one business data corresponding to at least one page in real time through callbacks within the creation cycle of at least one page, and stores the stack information and at least one business data locally. When the program crashes, the stack information and business data retrieved locally can be used to restore the page without requiring the user to reload the data, thus improving efficiency.

[0095] In some embodiments, see Figure 5 , Figure 5 This is a schematic diagram of an optional process for the page recovery method provided in an embodiment of the present invention. Figure 4 The shown S108 can also be implemented by S109 to S112, which will be explained in conjunction with each step.

[0096] S109. Within the creation cycle corresponding to at least one page, extract at least one page identifier information and at least one business data corresponding to at least one page in real time according to the creation order of at least one page.

[0097] In this embodiment of the invention, the client extracts at least one page identifier information and at least one business data corresponding to at least one page in real time according to the creation order of at least one page within the creation cycle corresponding to at least one page.

[0098] In this embodiment of the invention, when the server sends the business data corresponding to the page, it also sends the page identification information to the client. The client can also obtain the corresponding page identification information from the created page.

[0099] For example, in combination Figure 2 The page identifier information can be "Demand Information Page" or "Item List Page". In other embodiments, the page identifier information can also be a string of numbers or letters.

[0100] S110. Establish at least one mapping information between at least one business data and the corresponding page identification information.

[0101] In this embodiment of the invention, the client establishes at least one mapping information between at least one business data and the corresponding page identification information.

[0102] For example, the client can extract demand information business data and item list business data, as well as the identification information of the "demand information page" corresponding to the demand information business data and the identification information of the "item list page" corresponding to the item list business data. The client establishes a first mapping information between the demand information business data and the "demand information page," and a second mapping information between the item list business data and the "item list page," thus obtaining two mapping information sets.

[0103] S111. Construct stack information based on at least one page identification information in a certain order.

[0104] In this embodiment of the invention, the client constructs stack information based on at least one page identifier information in a certain order.

[0105] In this embodiment of the invention, stack information is a data structure, specifically a data structure where data items are arranged sequentially. Page identifier information can only be inserted and deleted at one end (called the top of the stack). The stack is part of Random Access Memory (RAM), and its main function is to temporarily store data and addresses, typically used to protect breakpoints and the current context.

[0106] S112. Store the stack information and at least one mapping information locally.

[0107] In this embodiment of the invention, the client stores stack information and at least one mapping information locally.

[0108] In this embodiment of the invention, the client can store stack information and at least one mapping information in the RecoveryStore.

[0109] In this embodiment of the invention, the client stores stack information and at least one mapping information locally. When the program crashes, the corresponding business data in the mapping information can be quickly retrieved using the page identification information in the stack information to restore the page, thus improving efficiency.

[0110] In some embodiments, see Figure 6 , Figure 6 This is a schematic diagram of an optional process for the page recovery method provided in an embodiment of the present invention. Figure 4 The steps S103 to S104 shown can also be implemented by S113 to S115, which will be explained in conjunction with each step.

[0111] S113. If a first-type program crash is detected, a callback message is generated and sent to the local preset independent child process.

[0112] In this embodiment of the invention, if the client detects a first type of program crash, a callback message is generated and sent to a local preset independent subprocess.

[0113] The first type of program crash can be a crash of the native layer program.

[0114] In this embodiment of the invention, when a native crash occurs on the client side, the crash detection engine BreakPad will detect that the application has crashed. At this time, the NativeCrash.cpp interface will receive the callback information of the crash and send the message to CrashService via Socket communication. CrashService is an independent child process outside the application process. After receiving the crash message, CrashService will initiate the behavior of redirecting to the crash redirection page.

[0115] S114. By pre-setting an independent subprocess to respond to callback messages, a transit page is formed based on stack information and at least one business data to complete the jump to at least one page.

[0116] In this embodiment of the invention, the client responds to callback messages through a preset independent subprocess, and forms a transit page based on stack information and at least one business data to complete the jump to at least one page.

[0117] In this embodiment of the invention, a pre-defined independent sub-process first retrieves the stack trace information and at least one mapping information saved by the client before the crash from the RecoveryStore. The relay page carries the stack trace information and at least one mapping information, and is accessed via startActivity. At this time, the relay page holds the stack trace information and at least one mapping information. The relay page runs in an independent sub-process, so it can be displayed normally even after the client's main process crashes.

[0118] S115. In response to the recovery command triggered by the user on the transit page, according to the order of at least one page identification information in the stack information, at least one business data is sequentially retrieved from at least one mapping information for rendering to obtain at least one page.

[0119] In this embodiment of the invention, the client responds to the recovery command triggered by the user on the transit page, and renders at least one business data in at least one mapping information according to the order of at least one page identification information in the stack information, thereby obtaining at least one page.

[0120] In this embodiment of the invention, when a Native crash occurs on the client side, the crash detection engine BreakPad will detect that the application has crashed. At this time, the NativeCrash.cpp interface will receive the callback information of the crash and send the message to CrashService via Socket communication. CrashService is independent of the application process and is a separate child process, so it will not be affected by the program crash and can therefore perform page redirection and page recovery, improving the success rate of page recovery.

[0121] In some embodiments, see Figure 7 , Figure 7 This is a schematic diagram of an optional process for the page recovery method provided in an embodiment of the present invention. Figure 6 S113 to S114 shown can also be implemented by S116, which will be explained in conjunction with each step.

[0122] S116. If a second type of program crash is detected, the at least one page is redirected by forming a transfer page based on the stack information and the at least one mapping information through a preset independent subprocess.

[0123] In this embodiment of the invention, if the client detects a second type of program crash, it completes the jump to the at least one page by forming the transit page based on the stack information and the at least one mapping information through a preset independent subprocess.

[0124] The second type of program crash can be a Java-level program crash.

[0125] In this embodiment of the invention, when a Java-layer program crashes on the client side, the UnCaughtExceptionHandler system class triggers its uncaughtException callback method. Within this callback method, a redirection to a crash-intercepting page is initiated. A redirecting page is formed by holding stack information and at least one mapping information through a pre-defined independent sub-process, thus completing the redirection to at least one page.

[0126] Similarly, when a Java-layer program crashes, it uses a pre-defined independent sub-page to hold stack information and at least one mapping information to form a transfer page, completing a jump to at least one page and improving the success rate of page recovery.

[0127] In some embodiments, see Figure 8 , Figure 8 This is a schematic diagram of an optional process for the page recovery method provided in an embodiment of the present invention. Figure 1 The implementation of S102 can also include S117 to S119, which will be explained in conjunction with each step.

[0128] S117. In response to the obtained user close command, destroy the Nth page in at least one page.

[0129] In this embodiment of the invention, the client responds to the received user close command by destroying the Nth page in at least one page. Here, N is an integer greater than or equal to 1.

[0130] In this embodiment of the invention, after the client opens at least one page, the user can close one of the pages within that page, causing that page to enter the OnDestroy cycle.

[0131] S118. During the destruction period of the Nth page, based on the Nth page identifier information corresponding to the Nth page, delete the Nth mapping information corresponding to the Nth page in at least one mapping information locally.

[0132] In this embodiment of the invention, during the destruction cycle of the Nth page, the client deletes the Nth mapping information corresponding to the Nth page from at least one mapping information locally, based on the Nth page identifier information corresponding to the Nth page.

[0133] In this embodiment of the invention, since at least one mapping information stored locally includes at least one page identifier, the client can find the corresponding Nth mapping information through the Nth page identifier and delete it.

[0134] S119. Delete the Nth page identifier information corresponding to the Nth page in the local stack information to form new stack information for storage.

[0135] In this embodiment of the invention, during the destruction cycle of the Nth page, the client deletes the Nth page identifier information corresponding to the Nth page in the stack information locally to form new stack information for storage.

[0136] In this embodiment of the invention, when a page is destroyed, the client deletes the mapping information and page identification information corresponding to that page in real time to obtain the relevant data corresponding to the remaining pages, thus ensuring the accuracy of page recovery.

[0137] See Figure 9 , Figure 9 This is an optional flowchart illustrating the page recovery method provided in an embodiment of the present invention, which will be explained in conjunction with each step.

[0138] S201, Register client lifecycle callback.

[0139] In this embodiment of the invention, the user clicks the client icon on the terminal to start the client. At this stage, the client begins invoking plugins to perform initialization operations, preparing for the subsequent processes. First, it registers the entire application's page lifecycle callback methods using the `Application#registerActivityLifecycleCallbacks` method, thus detecting the creation and destruction of each page in the application.

[0140] S202. Initialize and register the crash capture modules for the Java layer and native method layer.

[0141] In this embodiment of the invention, the client registers a callback method for Java layer application crashes via the `Thread#setDefaultUncaughtExceptionHandler` method. This interface allows the client to detect crashes in the Java layer code of the application. Simultaneously, the BreakPad tool is initialized through the native `NativeCrash.cpp` interface, and crash callback methods are added. BreakPad can then handle crashes caused by exceptions in the application's native layer code.

[0142] S203, Add data when creating a page.

[0143] S204. Delete data when destroying the page.

[0144] In this embodiment of the invention, the client senses the opening and closing of each page of the application in real time, stores page data during the creation lifecycle, and removes page data during the destruction lifecycle.

[0145] S205. Send socket messages when the native method layer crashes.

[0146] In this embodiment of the invention, when a Native crash occurs on the client side, the crash detection engine BreakPad will detect that the application has crashed. At this time, the NativeCrash.cpp interface will receive the callback information of the crash and send the message to CrashService via Socket communication.

[0147] S206. A thread exception is triggered when the Java layer crashes.

[0148] In this embodiment of the invention, when a Java-layer program crashes on the client side, the UnCaughtExceptionHandler system class triggers its uncaughtException callback method. Within this callback method, a redirection to a crash-intercepting page is initiated. A redirecting page is formed by holding stack information and at least one mapping information through a pre-defined independent sub-process, thus completing the redirection to at least one page.

[0149] S207. When the native method layer crashes, an independent child process receives the crash socket information.

[0150] S208, Java layer crash callback method thread exception.

[0151] S209. Retrieve the locally saved page data and then redirect to the vocational school page.

[0152] In this embodiment of the invention, the independent child process CrashService obtains the locally stored page data and then redirects to the crash center page.

[0153] S210, an independent child process carries page data to display a crash relay page.

[0154] S211. Based on the saved data, launch the recovery page and the page where the data recovery crash occurred through the interface jump method, and restore the data on the page.

[0155] In this embodiment of the invention, the client, based on stack trace information and business data, uses the startActivities method to launch the recovery page and the page where the data recovery crash occurred, and restores the data on the page.

[0156] This invention relates to a technology for restoring browsed pages and page data before the crash of an Android application. This technology involves the application saving the user's browsing history and corresponding business data for each page in real time using the ActivityLifecycleCallbacks callback method while browsing. When the application crashes, it restores the page data to the state before the crash through a crash relay page independent of the main application process.

[0157] See Figure 10 , Figure 10 A schematic diagram of the page recovery device provided in an embodiment of the present invention.

[0158] This invention also provides a page recovery device 800, including: a response creation unit 803, a callback storage unit 804, a detection unit 805, and a recovery unit 806.

[0159] The response creation unit 803 is used to respond to the acquired user operation instructions and create at least one page;

[0160] The callback storage unit 804 is used to extract relevant data corresponding to the at least one page in real time through callback and store it locally within the creation cycle corresponding to the at least one page.

[0161] The detection unit 805 is used to jump from the at least one page to a transit page if a program crash is detected.

[0162] The recovery unit 806 is used to respond to a recovery command triggered by the user on the transit page and recover the at least one page using the relevant data.

[0163] In this embodiment of the invention, the callback storage unit 804 in the page recovery device 800 is used to extract the stack information and the at least one business data corresponding to the at least one page in real time through callback during the creation cycle corresponding to the at least one page, and store the stack information and the at least one business data locally; the at least one business data is sent by the server.

[0164] In this embodiment of the invention, the callback storage unit 804 in the page recovery device 800 is used to extract at least one page identification information corresponding to the at least one page and at least one business data in real time according to the creation order of the at least one page; establish at least one mapping information between the at least one business data and the corresponding page identification information; construct the stack information based on the at least one page identification information in a certain order; and store the stack information and the at least one mapping information locally.

[0165] In this embodiment of the invention, the detection unit 805 in the page recovery device 800 is used to generate a callback message and send it to a local preset independent subprocess if a first type of program crash is detected; the preset independent subprocess responds to the callback message and forms the transit page based on the stack information and the at least one mapping information to complete the jump of the at least one page.

[0166] In this embodiment of the invention, the detection unit 805 in the page recovery device 800 is used to complete the jump of the at least one page by forming the transit page based on the stack information and the at least one mapping information through a preset independent subprocess if a second type of program crash is detected.

[0167] In this embodiment of the invention, the recovery unit 806 in the page recovery device 800 is used to sequentially retrieve at least one business data from at least one mapping information according to the order of at least one page identification information in the stack information, and render it to obtain at least one page.

[0168] In this embodiment of the invention, the response creation unit 803 in the page restoration device 800 is used to respond to the acquired user operation instruction and send request information to the server; receive at least one business data corresponding to the at least one page from the server in response to the request information; and use the at least one business data to render and create the at least one page.

[0169] In this embodiment of the invention, the page restoration device 800 is used to respond to the acquired user close command and destroy the Nth page among the at least one pages; N is an integer greater than or equal to 1; during the destruction period of the Nth page, according to the Nth page identifier information corresponding to the Nth page, the Nth mapping information corresponding to the Nth page in the at least one mapping information is deleted locally; the Nth page identifier information corresponding to the Nth page in the stack information is deleted locally to form new stack information for storage.

[0170] In this embodiment of the invention, at least one page is created by responding to user operation instructions received by the creation unit 803; the callback storage unit 804 extracts relevant data corresponding to at least one page in real time during the creation cycle corresponding to each of the at least one page and stores it locally; if the detection unit 805 detects a program crash, it jumps from the at least one page to a transit page; and the recovery unit 8006 responds to the recovery instruction triggered by the user on the transit page and recovers the at least one page using the relevant data. Because this solution extracts and saves the corresponding relevant data in real time during the construction cycle of the current at least one page, and thus promptly recovers the current at least one page after a program crash through page jump, this solution can promptly save all data of the current page after a software crash without reloading, improving efficiency.

[0171] It should be noted that, in the embodiments of the present invention, if the above-described page recovery method is implemented as a software functional 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 embodiments of the present invention, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a page recovery device (which may be a personal computer, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a magnetic disk, or an optical disk. Thus, the embodiments of the present invention are not limited to any specific hardware and software combination.

[0172] Correspondingly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.

[0173] Correspondingly, this embodiment of the invention provides a page recovery device, including a memory 802 and a processor 801. The memory 802 stores a computer program that can run on the processor 801. When the processor 801 executes the program, it implements the steps in the above method.

[0174] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the descriptions of the method embodiments of the present invention for understanding.

[0175] It should be noted that, Figure 11 This is a schematic diagram of a hardware entity of the page recovery device provided in an embodiment of the present invention, such as... Figure 11 As shown, the hardware entity of the page recovery device 800 includes: a processor 801 and a memory 802, wherein;

[0176] The processor 801 typically controls the overall operation of the page recovery device 800.

[0177] The memory 802 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or already processed by the various modules in the processor 801 and the page recovery device 800 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).

[0178] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of the invention, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the invention. The sequence numbers of the above-described embodiments of the invention are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0179] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0180] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the apparatus or units can be electrical, mechanical, or other forms.

[0181] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0182] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0183] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0184] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0185] The above description is merely an embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A page recovery method, characterized in that, include: In response to received user operation commands, create at least one page; During the creation cycle of each of the at least one page, relevant data corresponding to the at least one page is extracted in real time via callback and stored locally; the relevant data includes: any type of information edited by the user on the page during the opening of the corresponding page; If a Native layer program crash is detected, a callback message is generated and sent to a local preset independent subprocess. The preset independent subprocess responds to the callback message and forms a transit page based on stack information and at least one mapping information to complete the jump to at least one page. Alternatively, if a Java layer program crash is detected, the preset independent subprocess forms the transit page based on the stack information and at least one mapping information to complete the jump to at least one page. The mapping information is the mapping information between at least one business data and the corresponding page identification information. In response to a user's recovery command triggered on the transit page, the at least one page is recovered using the relevant data.

2. The page recovery method according to claim 1, characterized in that, The relevant data includes: stack information corresponding to the at least one page and at least one piece of business data; The step of retrieving relevant data corresponding to the at least one page in real time via callback and storing it locally within the respective creation cycle of the at least one page includes: Within the creation cycle corresponding to each of the at least one page, the stack information and at least one business data corresponding to the at least one page are extracted in real time through callbacks, and the stack information and at least one business data are stored locally; the at least one business data is sent by the server.

3. The page recovery method according to claim 2, characterized in that, The step of extracting the stack information and at least one business data corresponding to the at least one page in real time through callback, and storing the stack information and at least one business data locally, includes: Extract at least one page identifier information corresponding to at least one page and at least one business data in real time according to the creation order of the at least one page; Establish at least one mapping information between the at least one business data and the corresponding page identification information; The stack information is constructed based on at least one page identification information in a certain order; The stack information and at least one mapping information are stored locally.

4. The page recovery method according to claim 1, characterized in that, The process of recovering the at least one page using the relevant data includes: According to the order of the at least one page identifier information in the stack information, the at least one business data is sequentially retrieved from the at least one mapping information for rendering to obtain the at least one page.

5. The page recovery method according to claim 1, characterized in that, The user operation instructions obtained from the response are used to create at least one page, including: In response to the acquired user operation command, a request message is sent to the server; Receive the server's response to the request information, and at least one piece of business data corresponding to the at least one page; The at least one page is created by rendering using the at least one piece of business data.

6. The page recovery method according to claim 3, characterized in that, After retrieving relevant data corresponding to the at least one page in real time via callback and storing it locally within the respective creation cycle of the at least one page, the method further includes: In response to the received user close command, the Nth page in the at least one page is destroyed; N is an integer greater than or equal to 1; During the destruction cycle of the Nth page, based on the Nth page identifier information corresponding to the Nth page, the Nth mapping information corresponding to the Nth page is deleted locally from the at least one mapping information. The Nth page identifier information corresponding to the Nth page in the stack information is deleted locally to form new stack information for storage.

7. A page recovery device, characterized in that, include: The response creation unit is used to create at least one page in response to the received user operation instructions; A callback storage unit is used to extract relevant data corresponding to the at least one page in real time through callbacks and store it locally during the creation cycle of the at least one page; the relevant data includes: any type of information edited by the user on the page during the opening of the corresponding page; The detection unit is configured to, if a Native layer program crash is detected, generate a callback message and send it to a local preset independent subprocess. The preset independent subprocess responds to the callback message and, based on stack information and at least one mapping information, forms a transit page to complete the redirection to at least one page. Alternatively, if a Java layer program crash is detected, the preset independent subprocess forms the transit page based on the stack information and the at least one mapping information to complete the redirection to at least one page. The mapping information is the mapping information between at least one business data and its corresponding page identifier information. The recovery unit is used to respond to a recovery command triggered by the user on the transit page and recover the at least one page using the relevant data.

8. A page recovery device, characterized in that, It includes a memory and a processor, the memory storing a computer program that can run on the processor, the processor executing the program to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Browser exception recovery processing method and device

    CN106371946A

  • Browser page abnormity recovery processing method and device

    CN106383752A

  • Data processing method and device, electronic equipment and computer readable medium

    CN111274503A