Page Return Data Processing Method and Its Device

Through the page callback framework, the back-pass data of associated pages is detected and processed, and the problem of inefficient determination of source pages under multiple source pages is solved, and data processing efficiency and code stability are improved.

CN111444453BActive Publication Date: 2025-07-18CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010122935.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-27
Publication Date
2025-07-18
Estimated Expiration
2040-02-27

AI Technical Summary

Technical Problem

Inefficient when determining the source page of the associated page in multiple source pages, resulting in low efficiency in page return data processing.

Method used

The page callback framework detects the opening operation of the associated page, determines its corresponding page processing information, and receives and processes the back-pass data through the framework, eliminating the process of determining the source page.

Benefits of technology

It improves the efficiency of back-passing data processing of associated pages, enhances the robustness and easy maintenance of the code, and avoids the impact of source page errors on processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111444453B_ABST
    Figure CN111444453B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a method and apparatus for processing page return data. The method is applied to a terminal device and can be applied to the research and development field. The method includes: when a start operation for an associated page is detected in a source page, starting the associated page through a page callback framework, where the source page is a page in the aforementioned terminal device that is in an opened state, and the associated page is in a closed state before the start operation for the associated page is detected in the source page; determining page processing information corresponding to the associated page, where the page processing information is used to indicate the processing process of the return data for the associated page in the source page; receiving the return data of the associated page through the page callback framework; and processing the return data according to the page processing information. By implementing the embodiments of the present invention, it is beneficial to improve the processing efficiency of the return data of the associated page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technologies, and particularly to a method and apparatus for processing page return data. Background Art

[0002] Currently, in an operating system, other Activity implementation classes can be run through an Activity implementation class, and an Activity implementation class is a page. Running an Activity implementation class b through an Activity implementation class a is equivalent to opening page b through page a. At this time, page a is the source page, and the page b opened by page a is the associated page of page a. In some scenarios, when it is detected that the associated page generates page return data, it is necessary to determine the source page that opened the associated page, and then process the page return data through the onActivityResult method in the source page.

[0003] However, in some application scenarios on the market currently, there may be multiple possible source pages, resulting in low efficiency in determining the true source page, or even being unable to accurately determine the source page. This will lead to low efficiency in processing the page return data of the associated page.

[0004] For example, page D can be opened through page A, page B, and page C, and currently page A, page B, page C, and page D are all in the open state. At this time, it is inefficient to determine which of page A, page B, and page C is the source page of page D, or even unable to determine the source page of page D. This will lead to low efficiency in processing the page return data of page D. Summary of the Invention

[0005] Embodiments of the present invention disclose a method and apparatus for processing page return data, which is beneficial to improving the processing efficiency of the return data of the associated page.

[0006] In a first aspect, embodiments of the present invention disclose a method for processing page return data. The method is applied to a terminal device and may include: when an opening operation for an associated page is detected in a source page, opening the associated page through a page callback framework, where the source page is a page in the aforementioned terminal device that is in an open state, and the associated page is in a closed state before the opening operation for the associated page is detected in the source page; determining page processing information corresponding to the associated page, where the page processing information is used to indicate the processing process of the return data of the associated page in the source page; receiving the return data of the associated page through the page callback framework; and processing the return data according to the page processing information.

[0007] In one implementation, the method may further include: creating a fragment component in the page callback framework; the specific implementation of opening the associated page through the page callback framework may be: opening the associated page through the fragment component.

[0008] In one implementation, the specific implementation of determining the page processing information corresponding to the associated page may be: determining the page information corresponding to the source page, where the page information includes one or more page data processing information; and according to the correspondence between the page operation and the page data processing information, taking the page data processing information corresponding to the opening operation in the page information as the page processing information corresponding to the associated page.

[0009] In one implementation, before receiving the callback data of the associated page through the page callback framework, the method may further include: creating an observed object for the associated page, where the observed object is used to monitor the page data of the associated page; if it is determined through the observed object that the page data is normal data, generating callback data through the aforementioned page callback framework, and the callback data is the page data.

[0010] In one implementation, the page callback framework may include an exception handling function, and the method may further include: if it is determined through the observed object that the page data of the associated page is abnormal data, processing the page data through the exception handling function.

[0011] In one implementation, the page processing information may include the data format of the source page and the data operation information for the aforementioned callback data; the data operation information for the callback data may include one or more of download operation information, upload operation information, and display operation information; the specific implementation of processing the callback data according to the page processing information may be: performing formatting processing on the callback data, and the data format of the callback data after formatting is the same as the data format of the source page; processing the callback data after formatting according to the data operation information for the callback data.

[0012] In one implementation, the associated page may include a first associated page and a second associated page; the first page processing information corresponding to the first associated page is different from the second page processing information corresponding to the second associated page; the callback data of the associated page may include the first callback data of the first associated page and the second callback data of the second associated page; the specific implementation of processing the callback data according to the page processing information may be: processing the first callback data according to the first page processing information and processing the second callback data according to the second page processing information.

[0013] Second aspect, an embodiment of the present invention discloses a page return data processing device, which includes a unit for executing the method described in the first aspect above.

[0014] Third aspect, an embodiment of the present invention discloses a terminal device, which includes a memory and a processor. The memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect above.

[0015] In the embodiment of the present invention, by determining the page processing information corresponding to the associated page, the return data of the associated page can be processed according to the page processing information. In this way, the process of determining the source page of the associated page can be omitted, which is beneficial to improving the processing efficiency of the return data of the associated page. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0017] Figure 1 is a schematic flowchart of a page return data processing method provided by an embodiment of the present invention;

[0018] Figure 2 is a schematic flowchart of another page return data processing method provided by an embodiment of the present invention;

[0019] Figure 3 is a schematic structural diagram of a page return data processing device provided by an embodiment of the present invention;

[0020] Figure 4 is a schematic structural diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0022] Please refer to Figure 1 , Figure 1It is a schematic flowchart of a method for processing page return data provided by an embodiment of the present invention. This method is applied to a terminal device. Specifically, as Figure 1 shown, the method for processing page return data in the embodiment of the present invention may include but is not limited to the following steps:

[0023] S101. When the terminal device detects an opening operation for an associated page in the source page, the associated page is opened through the page callback framework. Herein, the source page is a page that is in an opened state in the aforementioned terminal device, and the associated page is in a closed state before the opening operation for the associated page in the source page is detected.

[0024] Specifically, when the terminal device detects that the source page calls an open page application programming interface (API) to open the associated page, it can be determined that an opening operation for the associated page in the source page is detected. Optionally, the source page may include many links, and other pages can be jumped to by clicking on the link. When the terminal device detects that the user clicks on link a in the source page and can jump to the associated page through link a, it can be determined that an opening operation for the associated page in the source page is detected. The associated page is in a closed state before the opening operation for the associated page in the source page is detected, and the associated page is in an opened state after being opened through the page callback framework. When the page data of page a is displayed in the terminal device, page a is in an opened state. When the page data of page a is not displayed in the terminal device, page a is in a closed state.

[0025] It should be noted that one or more pages can be jumped to from the source page, and the pages that can be jumped to from the source page can be referred to as the associated pages of the source page. In the embodiments of the present application, the number of the associated pages of the aforementioned source page can be one or more. In the embodiments of the present application, the case where the number of associated pages is two is taken as an example for illustration. For example, the associated pages include a first associated page and a second associated page.

[0026] For example, page D can be opened from page A, page B, and page C, and currently page A, page B, page C, and page D are all in an opened state. The source page can be page A, page B, or page C, and the associated page can be page D.

[0027] When the terminal device detects an opening operation for an associated page in the source page, it indicates that the terminal device needs to open the associated page. It should be noted that the existing page switching is completed by the system underlying layer. In the implementation of this application, the terminal device can delegate the page switching call originally responsible for by the system underlying layer to the page callback framework, that is, the terminal device can open the associated page through this page callback framework. In one implementation manner, the specific implementation of the terminal device opening the associated page through the page callback framework can be: opening the associated page through a Fragment component. Among them, this Fragment component can be created by the terminal device in this page callback framework.

[0028] A Fragment depends on an Activity and cannot exist independently. There can be multiple Fragments in an Activity. An Activity is one of the four major components in Android (Android), providing an interface for users to interact with the system. Each application has one or more Activities. An Activity is an application component that provides a screen through which users can interact to complete a certain task. For example, making a call, taking a photo, sending an email, and viewing a map. Specifically, a user interaction interface can correspond to an Activity.

[0029] In one implementation manner, the source page (or the associated page) can be a page in a browser or a page of an application running on the terminal device. Optionally, the source page (or the associated page) can be the native page of the application or a non-native page. Among them, the native page can refer to the Activity object and Fragment object in Android.

[0030] In the embodiments of the present invention, the terminal device can be a smart phone, a tablet computer, a personal computer (Personal Computer, PC), a smart TV, a smart watch, a vehicle-mounted device, a wearable device, a terminal device in the future fifth-generation mobile communication technology (the 5th Generation, 5G) network, etc. The embodiments of the present invention do not make any limitations in this regard.

[0031] S102. The terminal device determines the page processing information corresponding to the associated page, and the page processing information is used to indicate the processing process of the data passed back for the associated page in the foregoing source page.

[0032] Specifically, after the terminal device opens the associated page through the page callback framework, it can determine the page processing information corresponding to the associated page. In one implementation, the terminal device can use the onActivityResult function in the source page to determine the page processing information corresponding to the associated page. In the embodiments of the present application, the page processing information corresponding to the associated page can be referred to as a page callback listener, and the page callback listener includes the processing logic when receiving the return data of the associated page, that is, the processing process of the return data of the associated page in the aforementioned source page. Among them, the page callback listener can be injected by the source page.

[0033] The fact that the page callback listener is injected by the source page can mean that the source page can tell the page callback listener what to do after receiving the return data of the associated page. Compared with the prior art, after obtaining the return data, it is necessary to first determine the source page corresponding to the associated page, and then rewrite the onActivityResult function of the source page of the associated page to correctly process the return data. However, in this solution, the page callback listener has determined what to do with the return data after obtaining the return data, so it is not necessary to determine the source page of the associated page. It can be seen that by implementing the embodiments of the present application, it is possible to decouple the return data from the specific page, that is, to decouple the return data from the source page. Since the process of determining the source page is reduced, the processing efficiency of the return data can be effectively improved. In addition, decoupling the return data from the source page can also prevent the processing of the return data from being affected when an error occurs in the source page, making the code more robust and reliable, and easier for developers to maintain.

[0034] In one implementation, when the terminal device determines the page processing information corresponding to the associated page, it can save the page processing information in the aforementioned page callback framework so that after the page callback framework obtains the return data of the associated page, it can more quickly call the page processing information in the page callback framework to process the return data.

[0035] In one implementation, the specific implementation of the terminal device to determine the page processing information corresponding to the associated page can be: determining the page information corresponding to the source page, and the page information can include one or more page data processing information; and according to the correspondence between the page operation and the page data processing information, taking the page data processing information corresponding to the aforementioned opening operation in the page information as the page processing information corresponding to the associated page.

[0036] Among them, the page data processing information can indicate what kind of processing to perform on the returned data after obtaining the returned data of different pages. In one implementation, the page data processing information can correspond to the page, where the page can be a page that can be opened from the source page. For example, if page 1 and page 2 can be opened through the source page, the page information of the source page can include page data processing information 1 and page data processing information 2. Among them, the page data processing information 1 can indicate to display the returned data after receiving the returned data of page 1. The page data processing information 2 can indicate to upload the returned data to a specified server after receiving the returned data of page 2.

[0037] In one implementation, the page data processing information can correspond to the page operation. In one implementation, in the source page, when the same associated page is opened through different operations and the returned data of the associated page is received, different processing can be performed on the returned data corresponding to different operations. For example, when the associated page 1 is opened through operation 1 in the source page and the returned data of the associated page is received, the returned data can be displayed. When the associated page 1 is opened through operation 2 in the source page and the returned data of the associated page is received, the returned data can be displayed and downloaded. According to the corresponding relationship between the page operation and the page data processing information, taking the page data processing information corresponding to the foregoing opening operation in the page information as the page processing information corresponding to the associated page can improve the accuracy of the determined page processing information, so as to correctly process the returned data.

[0038] In one implementation, the corresponding relationship between the page operation and the page data processing information can be set by default on the terminal device or can be user-defined, and the terminal device can change the corresponding relationship according to the user operation. The embodiments of the present invention do not limit this. In one implementation, the corresponding relationship between the page data processing information and the page can be set by default on the terminal device or can be user-defined, and the terminal device can change the corresponding relationship according to the user operation. The embodiments of the present invention do not limit this.

[0039] In one implementation, when the foregoing associated page includes a first associated page and a second associated page, the first associated page can correspond to first page processing information, the second associated page can correspond to second page processing information, and the first page processing information and the second page processing information can be different.

[0040] S103. The terminal device receives the returned data of the associated page through the foregoing page callback framework.

[0041] Specifically, when the terminal device detects a close operation on the aforementioned associated page, it can obtain the return data of the associated page through the page callback framework. Optionally, the terminal device can obtain the return data of the associated page through the aforementioned Fragment component.

[0042] S104. The terminal device processes the return data according to the page processing information.

[0043] Specifically, the page processing information may include the data format of the source page and the data operation information for the aforementioned return data; the data operation information for the return data may include, but is not limited to, one or more of download operation information, upload operation information, and display operation information; the specific implementation of the terminal device processing the return data according to the page processing information may be: performing formatting processing on the return data, and the data format of the return data after formatting is the same as the data format of the source page; processing the return data after formatting according to the data operation information for the return data.

[0044] By performing formatting processing on the return data, the return data can be formatted into the format required by the source page of the associated page or a format recognizable by the source page, which can avoid the situation where the source page cannot recognize the return data of the associated page, thus facilitating the improvement of the success rate of data processing. For example, when the source page is a page of a book website and the return data is a binary string corresponding to a book, but when presented to the user on the source page, it needs to be displayed as the book title and author. Therefore, by formatting the return data into the data format of the source page (i.e., the original form of the book), the return data can be displayed as the book title and author.

[0045] When the data operation information for the return data includes download operation information, the terminal device can download the return data after formatting. When the data operation information for the return data includes upload operation information, the terminal device can upload the return data after formatting. When the data operation information for the return data includes display operation information, the terminal device can display the return data after formatting.

[0046] In one implementation, the data format of the source page can be determined through the onActivityResult function in the source page.

[0047] In one implementation, when the foregoing associated pages include a first associated page and a second associated page, and the first associated page corresponds to first page processing information, and the second associated page corresponds to second page processing information, the feedback data of the foregoing associated pages may include first feedback data of the first associated page and second feedback data of the second associated page. The specific implementation of the terminal processing the feedback data according to the page processing information may be: processing the first feedback data according to the first page processing information, and processing the second feedback data according to the second page processing information.

[0048] In one implementation, when each of multiple source pages opens a corresponding associated page, and the processing processes of the feedback data of the corresponding associated pages in each of the source pages are the same, each of the multiple source pages may share the same Fragment component and may share the same page callback listener. For example, after page 1, page 2, and page 3 call the page opening API to open different pages, and the processing after receiving the feedback data is to download data, then page 1, page 2, and page 3 may share the same Fragment component and may share the same page callback listener. In this way, the utilization rate of the Fragment component and the utilization rate of the code in the Fragment component can be improved.

[0049] In one implementation, it is possible to implement listening to different callback logics when opening different associated pages on a single source page without modifying any code of the source page. For example, after source page 1 and source page 2 call the page opening API to open different associated pages, the processing after receiving the feedback data is uploading data and downloading data respectively. Then when source page 1 calls the page opening API to open associated page a, the callback business logic in the page callback listener can be modified to upload data, that is, when receiving the feedback data of associated page a, the page callback listener can upload the feedback data. When source page 2 calls the page opening API to open associated page b, the callback business logic in the page callback listener can be modified to download data, that is, when receiving the feedback data of associated page b, the page callback listener can download the feedback data. It can be seen that in this way, the code can be made easier to maintain and more robust.

[0050] In one implementation, when it is necessary to add a new associated page that can be opened in the source page and process the callback data of the new associated page, it is only necessary to modify the page callback framework or the code of the Fragment component in the page callback framework, without modifying the code of the source page. In this way, the code can be made more maintainable and more robust. For example, associated page 2 and associated page 3 can be opened in source page 1. When it is necessary to open associated page 4 in source page 1, if the existing technology is adopted, it is necessary to add code in source page 1 to implement the listening of associated page 4. However, in the embodiments of the present application, it can be implemented by inserting listening code in the page callback framework (or the Fragment component in the page callback framework), that is, the callback listening for associated page 4 can be implemented without modifying the code of source page 1.

[0051] In the embodiments of the present invention, by determining the page processing information corresponding to the associated page, the callback data of the associated page can be processed according to the page processing information. In this way, the process of determining the source page of the associated page can be omitted, which is beneficial to improving the processing efficiency of the callback data of the associated page.

[0052] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another method for processing page callback data provided by the embodiments of the present invention. This method is applied to a terminal device. Specifically, as Figure 2 shown, the method for processing page callback data in the embodiments of the present invention may include but is not limited to the following steps:

[0053] S201. When the terminal device detects an opening operation for an associated page in the source page, the associated page is opened through the page callback framework, where the source page is a page that is in an opened state in the foregoing terminal device, and the associated page is in a closed state before the opening operation for the associated page in the source page is detected.

[0054] S202. The terminal device determines the page processing information corresponding to the associated page, and the page processing information is used to indicate the processing process of the callback data for the associated page in the foregoing source page.

[0055] It should be noted that the execution processes of steps S201 to S202 can be respectively referred to the specific descriptions of steps S101 to S102 in Figure 1 and will not be elaborated here.

[0056] S203. The terminal device creates an observed object for the associated page, and the observed object is used to monitor the page data of the associated page.

[0057] In one implementation, the page information of the associated page may include the page data of the associated page, and may also include the attribute information of the associated page (such as whether the associated page is a native page or a non-native page (such as a fifth-generation Hypertext Markup Language (HTML) page)). Among them, the page data of the associated page may include some data generated in the associated page. For example, a user enters data in the associated page, or some data displayed in the associated page itself.

[0058] Specifically, the terminal device can create an observable object for the associated page through RxJava. The observable object can also be referred to as the observed object, and the embodiments of the present application do not limit the name of the observed object. Among them, RxJava is a library for implementing asynchronous operations.

[0059] S204. If it is determined through the observable object that the page data is normal data, the terminal device generates backhaul data through the page callback framework, and the backhaul data is the page data.

[0060] The observable object is used to monitor the page data of the associated page. In one implementation, the observable object can be used to monitor both normal page data and abnormal page data. When the page data is normal data, the observable object can notify the page callback framework to use the page data as backhaul data. In one implementation, the page data of the associated page may include the value of resultCode in the setResult function. The specific implementation for determining whether the page data is abnormal through the observable object may be: the observable object obtains the value of resultCode in the setResult function. If the value of resultCode is RESULT_FAIL, it may indicate that an exception has occurred in the associated page, that is, the page data of the associated page is abnormal data; if the value of resultCode is not RESULT_FAIL, it may indicate that no exception has occurred in the associated page, that is, the page data of the associated page is normal data.

[0061] In one implementation, the page callback framework may include an exception handling function. If it is determined through the observable object that the page data is abnormal data, the page data is processed through the exception handling function. In one implementation, if it is determined through the observable object that the page data is abnormal data, the observable object can notify the page callback framework not to generate backhaul data. In this way, it is possible to avoid processing abnormal backhaul data, which is beneficial to avoiding unnecessary overhead.

[0062] In one implementation, the exception handling function may include multiple exception types and handlers corresponding to different exception types. The terminal device can determine the exception type to which the exception that occurs in the associated page belongs through the exception handling function, and then use the handler corresponding to the exception type to handle the exception that occurs in the associated page. In this way, the exception can be handled by an exception handler that matches the exception type, which helps to improve the exception handling efficiency. In one implementation, the exception handling function can determine the exception type to which the exception that occurs in the associated page belongs according to the value of resultCode. The exception types to which the exception that occurs in the associated page belongs may include output exceptions (such as format exceptions of output data, range exceptions of output data, etc.), calculation exceptions (such as unrecognized characters appearing during the calculation process), etc. If the value of resultCode is the first preset value, it can be determined that the exception type to which the exception that occurs in the associated page belongs is an output exception; if the value of resultCode is the second preset value, it can be determined that the exception type to which the exception that occurs in the associated page belongs is a calculation exception. Among them, the first preset value and the second preset value can be set by default by the terminal device or can be user-defined, and the embodiments of the present application do not make any limitations on this.

[0063] In one implementation, after obtaining the return data of the associated page through the page callback framework or through the foregoing Fragment component, some time-consuming tasks can be processed for the return data (such as after reading the data, some time-consuming input / output (I / O) operations need to be performed). In this scenario, the terminal device can switch the time-consuming task to a child thread for processing through the thread switching provided by the observed object, avoiding the phenomenon that the page freezes or even the application becomes unresponsive (Application Not Responding, ANR) when the user interface (UI) thread processes the time-consuming task.

[0064] S205. The terminal device receives the return data of the associated page through the foregoing page callback framework.

[0065] Specifically, the terminal device can obtain the return data of the associated page through the page callback framework when detecting a close operation on the foregoing associated page. Optionally, the terminal device can obtain the return data of the associated page through the foregoing Fragment component.

[0066] S206. The terminal device processes the return data according to the page processing information.

[0067] It should be noted that the execution processes of steps S205 to S206 can be respectively referred to Figure 1The specific descriptions in steps S103 to S104 are not elaborated here.

[0068] In an embodiment of the present invention, when it is determined that the page data is normal data through the observed object, the page callback framework is used to generate the feedback data, which can avoid processing the abnormal page data in the case of abnormal page data, and is beneficial to avoiding unnecessary overhead.

[0069] Please refer to Figure 3 , Figure 3 FIG. is a schematic structural diagram of a page feedback data processing device provided by an embodiment of the present invention. The page feedback data processing device may be a terminal device or a device with terminal device functions (such as a chip). Specifically, as Figure 3 shown, the page feedback data processing device 30 may include:

[0070] A processing module 301, configured to detect an opening operation for an associated page in a source page, and open the associated page through a page callback framework, where the source page is a page in the aforementioned terminal device that is in an opened state, and the associated page is in a closed state before the opening operation for the associated page in the source page is detected;

[0071] The processing module 301 is further configured to determine page processing information corresponding to the associated page, where the page processing information is used to indicate a processing process of feedback data for the associated page in the source page;

[0072] A communication module 302, configured to receive feedback data of the associated page through the page callback framework;

[0073] The processing module 301 is further configured to process the feedback data according to the page processing information.

[0074] In one implementation, the processing module 301 may further be configured to create a fragment component in the page callback framework; when the processing module 301 is configured to open the associated page through the page callback framework, specifically, it may be configured to open the associated page through the fragment component.

[0075] In one implementation, when the processing module 30 is configured to determine the page processing information corresponding to the associated page, specifically, it may be configured to: determine page information corresponding to the source page, where the page information includes one or more page data processing information; and according to the correspondence between the page operation and the page data processing information, use the page data processing information corresponding to the opening operation in the page information as the page processing information corresponding to the associated page.

[0076] In one implementation, the processing module 301 can also be used to create an observed object for an associated page, where the observed object is used to monitor the page data of the associated page; if it is determined through the observed object that the page data is normal data, the page callback framework is used to generate return data, and the return data is the page data.

[0077] In one implementation, the page callback framework can include an exception handling function, and the processing module 301 can also be used to process the page data through the exception handling function if it is determined through the observed object that the page data of the associated page is abnormal data.

[0078] In one implementation, the page processing information can include the data format of the source page and the data operation information for the foregoing return data; the data operation information for the return data can include one or more of download operation information, upload operation information, and display operation information; when the processing module 301 is used to process the return data according to the page processing information, it can specifically be used to perform formatting processing on the return data, and the data format of the return data after formatting is the same as the data format of the source page; the return data after formatting is processed according to the data operation information for the return data.

[0079] In one implementation, the associated page can include a first associated page and a second associated page; the first page processing information corresponding to the first associated page is different from the second page processing information corresponding to the second associated page; the return data of the associated page can include the first return data of the first associated page and the second return data of the second associated page; when the processing module 301 is used to process the return data according to the page processing information, it can specifically be used to process the first return data according to the first page processing information and process the second return data according to the second page processing information.

[0080] The embodiments of the present invention and Figures 1 - 2 The method embodiments shown are based on the same concept, and the technical effects brought by them are also the same. For the specific principle, please refer to Figures 1 - 2 the description of the embodiments shown, which will not be elaborated here.

[0081] Please refer to Figure 4 , Figure 4 FIG. is a schematic structural diagram of a terminal device provided by an embodiment of the present invention. The terminal device 40 can include a memory 401, a processor 402, and a communication interface 403. The memory 401, the processor 402, and the communication interface 403 are connected through one or more communication buses. Among them, the communication interface 403 is controlled by the processor 402 to send and receive information.

[0082] The memory 401 may include a read-only memory and a random access memory, and provide instructions and data to the processor 402. A part of the memory 401 may also include a non-volatile random access memory.

[0083] The processor 402 may be a central processing unit (CPU), and the processor 402 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor. Optionally, the processor 402 may also be any conventional processor, etc. Among them:

[0084] The memory 401 is used to store program instructions.

[0085] The processor 402 is used to call the program instructions stored in the memory 401 to enable the terminal device 40 to perform the following operations:

[0086] When it is detected that an opening operation for an associated page is performed in the source page, the associated page is opened through the page callback framework, where the source page is a page in the foregoing terminal device that is in an opened state, and the associated page is in a closed state before it is detected that an opening operation for the associated page is performed in the source page;

[0087] Determine the page processing information corresponding to the associated page, where the page processing information is used to indicate the processing process of the data passed back for the associated page in the source page;

[0088] Receive the data passed back by the associated page through the page callback framework;

[0089] Process the data passed back according to the page processing information.

[0090] In one implementation, the processor 402 may also perform the following operations: create a fragment component in the page callback framework; when the processor 402 executes to open the associated page through the page callback framework, specifically, the following operations may be performed: open the associated page through the fragment component.

[0091] In one implementation, when the processor 402 determines the page processing information corresponding to the associated page, it can specifically perform the following operations: determining the page information corresponding to the source page, where the page information includes one or more page data processing information; and according to the correspondence between the page operations and the page data processing information, taking the page data processing information corresponding to the opening operation in the page information as the page processing information corresponding to the associated page.

[0092] In one implementation, before receiving the feedback data of the associated page through the page callback framework, the processor 402 can also perform the following operations: creating an observed object for the associated page, where the observed object is used to monitor the page data of the associated page; if it is determined through the observed object that the page data is normal data, generating feedback data through the aforementioned page callback framework, and the feedback data is the page data.

[0093] In one implementation, the page callback framework can include an exception handling function, and the processor 402 can also perform the following operations: if it is determined through the observed object that the page data of the associated page is abnormal data, processing the page data through the exception handling function.

[0094] In one implementation, the page processing information can include the data format of the source page and the data operation information for the aforementioned feedback data; the data operation information for the feedback data can include one or more of download operation information, upload operation information, and display operation information; when the processor 402 processes the feedback data according to the page processing information, it can specifically perform the following operations: performing formatting processing on the feedback data, and the data format of the feedback data after formatting is the same as the data format of the source page; processing the feedback data after formatting according to the data operation information for the feedback data.

[0095] In one implementation, the associated page can include a first associated page and a second associated page; the first page processing information corresponding to the first associated page is different from the second page processing information corresponding to the second associated page; the feedback data of the associated page can include the first feedback data of the first associated page and the second feedback data of the second associated page; when the processor 402 processes the feedback data according to the page processing information, it can specifically perform the following operations: processing the first feedback data according to the first page processing information, and processing the second feedback data according to the second page processing information.

[0096] It should be noted that Figure 4 For the content not mentioned in the corresponding embodiments and the specific implementation manners of each step, reference can be made to Figures 1 - 2 the embodiments shown and the foregoing content, which will not be elaborated here.

[0097] An embodiment of the present invention also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to execute the steps performed in the method embodiment as Figures 1 - 2 shown.

[0098] The above-disclosed are only some embodiments of the present invention. Of course, the scope of the rights of the present invention cannot be limited thereby. Those of ordinary skill in the art can understand the entire or part of the processes of implementing the above embodiments, and equivalent changes made according to the claims of the present invention still fall within the scope covered by the invention.

Claims

1. A method for processing page callback data, which is applied to a terminal device, and is characterized in that, The method includes: When a start operation for an associated page is detected in the source page, the associated page is started through a page callback framework, where the source page is a page in the terminal device that is in an opened state, and the associated page is in a closed state before the start operation for the associated page is detected in the source page; Determine the page processing information corresponding to the associated page, and save the page processing information in the page callback framework, where the page processing information is used to indicate the processing procedure of the data passed back for the associated page in the source page; among them, there are multiple pages that can start the associated page, and the source page is one of the multiple pages that can start the associated page; the page data processing information corresponds to the page operation. In the source page, if the same associated page is started through different operations, the processing of the data passed back corresponding to different operations is different; Receive the data passed back from the associated page through the page callback framework; where the page callback framework includes an exception handling function, the exception handling function includes multiple exception types and corresponding handlers for different exception types. If the page data is abnormal data, determine the exception type to which the exception that occurs in the associated page belongs through the exception handling function included in the page callback framework, and use the handler corresponding to this exception type to handle the exception that occurs in the associated page; Process the data passed back according to the page processing information.

2. The method according to claim 1, wherein The method further includes: Create a fragment component in the page callback framework; The starting of the associated page through the page callback framework includes: Start the associated page through the fragment component.

3. The method according to claim 1, characterized in that The determining of the page processing information corresponding to the associated page includes: Determine the page information corresponding to the source page, where the page information includes one or more page data processing information; According to the correspondence between the page operation and the page data processing information, use the page data processing information corresponding to the start operation in the page information as the page processing information corresponding to the associated page.

4. The method according to any one of claims 1 to 3, characterized in that Before receiving the data passed back from the associated page through the page callback framework, the method further includes: Create an observed object for the associated page, where the observed object is used to monitor the page data of the associated page; If it is determined through the observed object that the page data is normal data, generate the data passed back through the page callback framework, and the data passed back is the page data.

5. The method according to any one of claims 1 to 3, characterized in that The page processing information includes the data format of the source page and the data operation information for the data passed back; the data operation information for the data passed back includes one or more of download operation information, upload operation information, and display operation information; The processing of the data passed back according to the page processing information includes: Perform formatting processing on the data passed back, and the data format of the data passed back after formatting is the same as the data format of the source page; Process the data passed back after the formatting processing according to the data operation information for the data passed back.

6. The method according to any one of claims 1 to 3, characterized in that, The associated pages include a first associated page and a second associated page; the first page processing information corresponding to the first associated page is different from the second page processing information corresponding to the second associated page; the feedback data of the associated pages includes first feedback data of the first associated page and second feedback data of the second associated page; The processing of the feedback data according to the page processing information includes: processing the first feedback data according to the first page processing information and processing the second feedback data according to the second page processing information.

7. A page data feedback processing device, characterized in that The apparatus includes units for performing the method according to any one of claims 1 to 6.

8. A terminal device, characterized in that, It includes a memory and a processor, the memory is used for storing a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions, when executed by a processor, cause the processor to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Event distributing method and device based on Web page

    CN101000544A

  • Page information processing method and system

    CN107688570A